|
Pro PHP-GTK
PHP is gaining positive reputation for its system administration and client-side application development capabilities. This administration and development is accomplished using the PHP-GTK extension. You can take advantage of client-side applications by implementing language bindings for the GTK (the GIMP Toolkit) library for creating cross-platform
graphical user interfaces.
Pro PHP-GTK acts as both a definitive reference and a hands-on tutorial to the PHP-GTK extension. The book couples the extension's key topics with practical examples to guide you through a real-world project: developing a database-driven client-side inventory manager. You'll also learn how to integrate this feature with other emerging technologies like SOAP and RSS, and how to generate XML-based interfaces.
Pro PHP-GTK
Scott Mattocks
Pro PHP-GTK
Copyright 2006 by Scott Mattocks
All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means,
electronic or mechanical, including photocopying, recording, or by any information storage or retrieval
system, without the prior written permission of the copyright owner and the publisher.
ISBN-13: 978-1-59059-613-5
ISBN-10: 1-59059-613-7
Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1
Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence
of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark
owner, with no intention of infringement of the trademark.
Lead Editor: Jason Gilmore
Technical Reviewers: Christian Weiske, Steph Fox
Editorial Board: Steve Anglin, Dan Appleman, Ewan Buckingham, Gary Cornell, Jason Gilmore,
Jonathan Hassell, James Huddleston, Chris Mills, Matthew Moodie, Dominic Shakeshaft, Jim Sumser,
Matt Wade
Project Manager: Kylie Johnston
Copy Edit Manager: Nicole LeClerc
Copy Editors: Marilyn Smith, Jennifer Whipple
Assistant Production Director: Kari Brooks-Copony
Production Editor: Ellie Fountain
Compositor: Kinetic Publishing Services, LLC
Proofreader: Dan Shaw
Indexer: Valerie Perry
Cover Designer: Kurt Krames
Manufacturing Director: Tom Debolski
Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor,
New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail orders-ny@springer-sbm.com, or
visit http://www.springeronline.com.
For information on translations, please contact Apress directly at 2560 Ninth Street, Suite 219, Berkeley, CA
94710. Phone 510-549-5930, fax 510-549-5939, e-mail info@apress.com, or visit http://www.apress.com.
The information in this book is distributed on an as is basis, without warranty. Although every precaution
has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to
any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly
by the information contained in this work.
The source code for this book is available to readers at http://www.apress.com in the Source Code section.
Contents at a Glance
About the Author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
About the Technical Reviewer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix
■CHAPTER 1 Introducing PHP-GTK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
■CHAPTER 2 Installing PHP-GTK. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
■CHAPTER 3 Understanding PHP-GTK Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
■CHAPTER 4 Handling Events and Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
■CHAPTER 5 Getting an Application Up and Running . . . . . . . . . . . . . . . . . . . . . . . . . 65
■CHAPTER 6 Laying Out Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
■CHAPTER 7 Displaying and Collecting Simple Data . . . . . . . . . . . . . . . . . . . . . . . . 119
■CHAPTER 8 Using Multiline Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
■CHAPTER 9 Working with Trees and Lists. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
■CHAPTER 10 Scrolling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
■CHAPTER 11 Adding Menus and Toolbars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
■CHAPTER 12 Adding Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
■CHAPTER 13 Drag-and-Drop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
■CHAPTER 14 Using Selectors & Dialogs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
■CHAPTER 15 Doing Background Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
■CHAPTER 16 Changing the Look and Feel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
■CHAPTER 17 Distributing PHP-GTK Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
■INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
v
|