
GTK+ / Gnome Application Development Havoc Pennington Red Hat Advanced Development Labs GTK+ / Gnome Application Development by Havoc Pennington First Release Edition Published 1999 Copyright © 1999 by New Riders Publishing This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at http://www.opencontent.org/openpub/ ( http://www.opencontent.org/openpub/) ) Table of Contents I. Overview...........................................................................................................................24 1. Introduction ............................................................................................................24 What is Gnome?................................................................................................24 The Gnome Development Framework..........................................................24 Non-Gnome Libraries.............................................................................25 glib ...................................................................................................25 GTK+ ...............................................................................................25 ORBit ...............................................................................................25 Imlib ................................................................................................26 Gnome Libraries......................................................................................26 libgnome.........................................................................................26 libgnomeui ....................................................................................26 libgnorba ......................................................................................27 libzvt.............................................................................................27 libart_lgpl ..................................................................................27 Other Libraries ........................................................................................27 gnome-print ..................................................................................27 gnome-xml ......................................................................................27 Guile ................................................................................................28 Bonobo ............................................................................................28 A Word About Header Files ..................................................................28 Structure of the Book........................................................................................28 2. glib: Portability and Utility...................................................................................30 Basics ..................................................................................................................30 Type Definitions ......................................................................................30 Frequently Used Macros ........................................................................30 Debugging Macros..................................................................................31 Memory ....................................................................................................33 String Handling.......................................................................................34 Data Structures..................................................................................................37 Lists ...........................................................................................................37 Trees ..........................................................................................................41 GTree ...............................................................................................41 GNode.............................................................................................43 Hash Tables ..............................................................................................46 Other Features...................................................................................................48 3. GTK+ Basics ............................................................................................................50 Whirlwind Tour of GTK+................................................................................50 A Complete Hello, World ......................................................................50 Compiling Hello, World ...............................................................51 How It Works...........................................................................................52 Initialization ...................................................................................52 Widgets ...........................................................................................52 Signals .............................................................................................53 Entering the Main Loop................................................................53 More on Signals and Callbacks ...................................................54 Containers And Widget Layout .....................................................................55 Size Allocation.........................................................................................56 Requisition......................................................................................56 Allocation........................................................................................56 GtkBox.......................................................................................................57 GtkBox Layout Details ..................................................................58 Non-Homogeneous Box Packing Patterns ................................59 Homogeneous Box Packing Patterns..........................................60 3 Box Packing Summary..................................................................61 GtkTable ..................................................................................................61 GtkTable Example ........................................................................62 Using gtk_table_attach_defaults() ....................................65 Other Layout Widgets ............................................................................65 Manually Affecting Layout ...................................................................66 Widget Concepts...............................................................................................67 Widget Life Cycle....................................................................................67 Realizing, Mapping, and Showing .......................................................68 Other Widget Concepts..........................................................................70 Sensitivity .......................................................................................70 Focus................................................................................................70 Grabs ...............................................................................................71 Default.............................................................................................71 Widget States..................................................................................71 The Main Loop..................................................................................................72 Main Loop Basics ....................................................................................72 Quit Functions .........................................................................................73 Timeout Functions ..................................................................................73 Idle Functions ..........................................................................................74 Input Functions .......................................................................................74 II. Building a Gnome Application...................................................................................76 4. Creating Your Source Tree.....................................................................................76 Overview of a Gnome Source Tree.................................................................76 Source Tree Checklist .......................................................................................77 configure.in ...................................................................................................78 Makefile.am .....................................................................................................80 Relevant GNU Documentation.......................................................................82 Installing Support Files....................................................................................83 Installing Datafiles: Documentation and Pixmaps.............................83 Pixmaps...........................................................................................83 Documentation ..............................................................................84 .desktop Entries.....................................................................................85 EXTRA_DIST..............................................................................................86 5. Gnome
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages414 Page
-
File Size-