krause-foundations of gtk development

655 549 0
krause-foundations of gtk development

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

this print for content only—size & color not accurate spine = 1.235" 656 page count Books for professionals By professionals ® Foundations of GTK+ Development Dear Reader, Maybe you have a great idea for the world’s next killer application. Or perhaps you just want to add a simple graphical interface to that clumsy command-line utility. No matter the goal, developers regularly look to the open source toolkit known as GTK+ to build sophisticated graphical interfaces. But learning how to effectively use GTK+ can be a daunting task. Some features can be difficult to understand, and online documentation is often scant. Figuring out where to begin may be even trickier, since GTK+ depends on so many libraries. For these reasons, I decided to write a practical guide to GTK+ development. Because so many newcomers struggle with simply getting started using GTK+, I thought it appropriate to dirty your hands as quickly as possible. After devoting Chapter 1 to an overview of key concepts, I will show you how to create, compile, and execute your first application. The chapters that follow introduce you to the wide variety of widgets and signals at your disposal, which embody your application’s look and behavior respectively. To cement your knowledge, along the way we will create several interesting applications such as a file browser and a text editor. By the time you complete the last chapter, you will be able to implement very complex GUI applications. I wrote this book to be not only a practical tutorial but also a reasonably complete reference. To that end, I’ve included an extensive array of appendixes covering object properties, widget signals, style properties, stock items, and GError types; the information they contain will become indispensable as you begin writing your own applications. Andrew Krause US $49.99 Shelve in Linux User level: Beginner–Intermediate Krause GTK+ Development The eXperT’s Voice ® in open source Foundations of GTK+ Development cyan MaGenTa yelloW Black panTone 123 c Andrew Krause Companion eBook Available THE APRESS ROADMAP Foundations of Qt ® Development Foundations of GTK+ Development Beginning C, Fourth Edition Beginning SUSE Linux, Second Edition Beginning Ubuntu Linux, Second Edition www.apress.com SOURCE CODE ONLINE Companion eBook See last page for details on $10 eBook version ISBN-13: 978-1-59059-793-4 ISBN-10: 1-59059-793-1 9 781590 597934 5 4 9 9 9 Build sophisticated graphical applications using one of the world's most powerful cross-platform toolkits! Foundations of Foundations of GTK+ Development ■■■ Andrew Krause 7931.book Page i Wednesday, March 28, 2007 7:35 PM Foundations of GTK+ Development Copyright © 2007 by Andrew Krause 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 (pbk): 978-1-59059-793-4 ISBN-10 (pbk): 1-59059-793-1 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 Editors: Jason Gilmore, Matt Wade Technical Reviewers: Christiana Evelyn Johnson, Micah Carrick Editorial Board: Steve Anglin, Ewan Buckingham, Gary Cornell, Jason Gilmore, Jonathan Gennick, Jonathan Hassell, James Huddleston, Chris Mills, Matthew Moodie, Jeff Pepper, Paul Sarknas, Dominic Shakeshaft, Jim Sumser, Matt Wade Project Manager: Richard Dal Porto Copy Edit Manager: Nicole Flores Copy Editor: Heather Lang Assistant Production Director: Kari Brooks-Copony Production Editor: Katie Stence Compositor: Pat Christenson Proofreader: Elizabeth Berry Indexer: Ann Rogers Artist: April Milne 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/ Download section or at the official book site, http://www.gtkbook.com. 7931.book Page ii Wednesday, March 28, 2007 7:35 PM I dedicate this book to Mrs. Kaminsky, for never allowing me to settle for anything but my best. I hope you can look at this book and see everything that you have done for me, even though I have yet to broaden the scope of my writing beyond technology. 7931.book Page iii Wednesday, March 28, 2007 7:35 PM 7931.book Page iv Wednesday, March 28, 2007 7:35 PM v Contents at a Glance About the Author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xvii Acknowledgments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi ■CHAPTER 1 Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 ■CHAPTER 2 Your First GTK+ Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 ■CHAPTER 3 Container Widgets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 ■CHAPTER 4 Basic Widgets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 ■CHAPTER 5 Dialogs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 ■CHAPTER 6 Using GLib. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 ■CHAPTER 7 The Text View Widget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 ■CHAPTER 8 The Tree View Widget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261 ■CHAPTER 9 Menus and Toolbars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315 ■CHAPTER 10 Dynamic User Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355 ■CHAPTER 11 Creating Custom Widgets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381 ■CHAPTER 12 Additional GTK+ Widgets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431 ■CHAPTER 13 Putting It All Together . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471 ■APPENDIX A GTK+ Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481 ■APPENDIX B GTK+ Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529 ■APPENDIX C GTK+ Styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565 ■APPENDIX D GTK+ Stock Items. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583 ■APPENDIX E GError Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587 ■APPENDIX F Exercise Solutions and Hints. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595 ■INDEX. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605 7931.book Page v Wednesday, March 28, 2007 7:35 PM 7931.book Page vi Wednesday, March 28, 2007 7:35 PM Contents vii About the Author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii Acknowledgments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi ■CHAPTER 1 Getting Started. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 A Brief History of GTK+ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 The X Window System. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 GTK+ and Supporting Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 GLib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 GObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 GDK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 GdkPixbuf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Pango . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 ATK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Language Bindings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Installing GTK+ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 ■CHAPTER 2 Your First GTK+ Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Hello World. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Initializing GTK+ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Widget Hierarchy. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 GTK+ Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 The Main Loop Function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Using GCC and pkg-config to Compile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Extending “Hello World” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Signals and Callbacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Connecting the Signal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Callback Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 Emitting and Stopping Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Events. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Event Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Using Specific Event Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 7931.book Page vii Wednesday, March 28, 2007 7:35 PM viii ■CONTENTS Further GTK+ Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 GtkWidget Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 GtkWindow Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Process Pending Events. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 Widget Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Test Your Understanding. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 ■CHAPTER 3 Container Widgets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 GtkContainer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 Decorator Containers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 Layout Containers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 Resizing Children. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 Container Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 Horizontal and Vertical Boxes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 Horizontal and Vertical Panes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 Tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 Table Packing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Table Spacing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 Fixed Containers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 Expanders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 Handle Boxes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 Notebooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 GtkNotebook Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Tab Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 Event Boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Test Your Understanding. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 ■CHAPTER 4 Basic Widgets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 Using Stock Items. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 Toggle Buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 Managing Widget Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 Check Buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 Radio Buttons. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 7931.book Page viii Wednesday, March 28, 2007 7:35 PM ■CONTENTS ix Text Entries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 Entry Properties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 Inserting Text into a GtkEntry Widget . . . . . . . . . . . . . . . . . . . . . . . . . 87 Manipulating GtkEntry Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 Spin Buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 Adjustments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 A Spin Button Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 Horizontal and Vertical Scales . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 Widget Styles. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 The GtkStyle Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 Resource Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 Additional Buttons. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 Color Buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 File Chooser Buttons. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 Font Buttons. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 Test Your Understanding. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 ■CHAPTER 5 Dialogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 Creating Your Own Dialogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 Creating a Message Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 Nonmodal Message Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 Another Dialog Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 Built-in Dialogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 Message Dialogs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 The About Dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 File Chooser Dialogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 Color Selection Dialogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 Font Selection Dialogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 Dialogs with Multiple Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 Creating GtkAssistant Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 GtkProgressBar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 Page Forward Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 Test Your Understanding. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 7931.book Page ix Wednesday, March 28, 2007 7:35 PM [...]... available at www .gtk. org/bindings.html: • Gtkmm is the official set of C++ bindings You can use GTK+ with C++ because of backward compatibility, but Gtkmm provides all of the GTK+ features in a series of classes, the style of which will be familiar to all C++ programmers The sources for Gtkmm, GLibmm, Libglademm, and other dependencies are available at www.gtkmm.org • PyGTK, available at www.pygtk.org, provides... bindings for the GTK+ libraries The advantage of using PyGTK is that it takes care of memory management and type casting for you This alleviates problems that can plague programmers using other language bindings • Gtk2 -perl, available at http:/ /gtk2 -perl.sf.net, provides all of the GTK+ libraries in an object-oriented Perl toolkit Each of the libraries is split into modules called Glib, Gtk2 , and Gtk2 ::GladeXML... located at www.gtkbook.com You can also find more information about the book at www.apress.com How This Book Is Organized Foundations of GTK+ Development is composed of 13 chapters Each chapter will give you a broad understanding of its topic For example, Chapter 3 covers container widgets and will introduce many of the most important widgets derived from the GtkContainer class Because of this structure,... their dependencies The development packages of GTK+ and each of its dependencies are also required In Debian and Debian-based distributions, these packages will end in -dev In Fedora Core and other distributions that use the RedHat Package Manager (RPM), they will end in -devel If you install the development package of GTK+ , most modern package managers will take care of all of the necessary dependencies... screenshot of the GIMP application, which uses GTK+ Figure 1-1 The GIMP Other, less visible basics of GUI development, such as synchronous and asynchronous event processing, are supported mainly by other libraries Yet, GTK+ does give access to many of them through its own API A 2-D vector graphics rendering library called Cairo has provided the rendering capabilities to GTK+ since the release of version... required by GTK+ , it can also be used independently Because of this, some applications use GLib without the other GTK+ libraries for the many capabilities it provides One of the main benefits of using GLib is that it provides a cross-platform interface that allows your code to be run on any of its supported operating systems with little to no rewriting of code! Another advantageous aspect of GLib is... provides GTK+ with two other vital data types: GValue and GObject GValue is a generic container that can hold any structure of which the system is already aware This allows functions to return a piece of data of an arbitrary type Without GValue, the object-oriented nature of GTK+ would not be possible G_TYPE_GOBJECT, or GObject, is the fundamental type that the widget class inheritance structure of GTK+ ... understanding of GIMP Toolkit (GTK+ ) that can help you to become a proficient graphical programmer Before continuing, you should be aware that this book is aimed at C programmers, so we will jump right into using GTK+ Time will not be spent covering information you already know To get the most out of this book, you should follow along with each of the examples and try the exercises found at the end of most... chapter GTK+ 2 introduced a lot of new features including a font-rendering engine called Pango and a newly enhanced theme engine Furthermore, improved accessibility support was implemented through the Accessibility Toolkit (ATK) This book uses version 2 of GTK+ for all code examples While GTK+ 2.10 has already been released, most of the examples should work with any version in the second branch GTK+ 2... chunks of memory that are all of the same size They can be used to create arrays of evenly sized elements This structure replaced memory chunks when it was introduced in the release of GLib 2.10 • Caches allow you to share large, complex data structures in an easy API, which helps you to save space These are used by GTK+ for styles and graphics contexts, since both of these objects consume a lot of resources . of the world's most powerful cross-platform toolkits! Foundations of Foundations of GTK+ Development ■■■ Andrew Krause 7931.book Page i Wednesday, March 28, 2007 7:35 PM Foundations of. $49.99 Shelve in Linux User level: Beginner–Intermediate Krause GTK+ Development The eXperT’s Voice ® in open source Foundations of GTK+ Development cyan MaGenTa yelloW Black panTone 123 c Andrew. 123 c Andrew Krause Companion eBook Available THE APRESS ROADMAP Foundations of Qt ® Development Foundations of GTK+ Development Beginning C, Fourth Edition Beginning SUSE Linux, Second Edition Beginning

Ngày đăng: 29/04/2014, 15:08

Từ khóa liên quan

Mục lục

  • Table of Content

  • Chapter 1

  • Chapter 2

  • Chapter 3

  • Chapter 4

  • Chapter 5

  • Chapter 6

  • Chapter 7

  • Chapter 8

  • Chapter 9

  • Chapter 10

  • Chapter 11

  • Chapter 12

  • Chapter 13

  • Appendix A

  • Appendix B

  • Appendix C

  • Appendix D

  • Appendix E

  • Appendix F

Tài liệu cùng người dùng

Tài liệu liên quan