Application Programming Using the GNOME Libraries

Application Programming Using the GNOME Libraries

Application Programming Using the GNOME Libraries George Lebl The GNOME Project [email protected] Application Programming Using the GNOME Libraries by George Lebl Copyright © 1999 by George Lebl In this tutorial, you will receive an overview of the GNOME libraries. You will learn how to speed up development of applications by using the many utility routines and objects available through the GNOME libraries, and how to make the GUI more consistent by using standard GNOME UI components. Focus will also be given to C applications using the GTK+ toolkit. Table of Contents Credits, Copyrights and Other Such Informations ....................................................................7 1. GNOME Libraries Overview....................................................................................................8 1.1. Where Do GNOME Libraries Fit .....................................................................................8 1.2. Structure of GNOME Libraries ........................................................................................8 2. GTK+ Programming ...............................................................................................................10 2.1. Overview.........................................................................................................................10 2.2. GLib ................................................................................................................................10 2.2.1. Naming Conventions............................................................................................10 2.2.2. Typedefs...............................................................................................................10 2.2.3. Portability and Utility Functions..........................................................................11 2.2.4. Containers ............................................................................................................13 2.2.4.1. GList, Doubly Linked List........................................................................14 2.2.4.2. GString, Dynamically Sized String Type..................................................15 2.2.4.3. GHashTable...............................................................................................16 2.2.5. More GLib Information .......................................................................................19 2.3. GTK+ ..............................................................................................................................19 2.3.1. GUI Basics...........................................................................................................19 2.3.2. GTK+ Object Model............................................................................................20 2.3.3. GTK+ Method Types ...........................................................................................20 2.3.4. Data on Objects....................................................................................................21 2.3.5. GTK+/GNOME Naming Conventions ................................................................21 2.3.6. Using GTK+ Methods .........................................................................................21 2.3.7. Example Hello World Program............................................................................22 3. GNOME Programming ...........................................................................................................26 3.1. Introduction.....................................................................................................................26 3.1.1. What Is a GNOME Program................................................................................26 3.1.2. Very Basic GNOME Program..............................................................................26 3.2. Overview.........................................................................................................................28 3.3. Using the libgnome Library............................................................................................28 3.3.1. Configuration Files ..............................................................................................29 3.3.1.1. Reading Configuration Info ......................................................................29 3.3.1.2. Writing Configuration Info .......................................................................29 3.3.1.3. Privacy Functions......................................................................................30 3.3.1.4. Using gnome-config for Arbitrary Files ...................................................30 3.3.1.5. Automatic Prefixes....................................................................................30 3.3.1.6. Misc gnome-config Stuff ..........................................................................31 3.3.2. .desktop Files .......................................................................................................31 3.3.3. Utility and Files ...................................................................................................32 3 3.3.3.1. Files...........................................................................................................32 3.3.3.2. Utility ........................................................................................................33 3.3.4. Mime Types .........................................................................................................34 3.3.5. Meta Data.............................................................................................................35 3.4. Using the GnomeApp Framework ..................................................................................37 3.4.1. GnomeApp Overview ..........................................................................................37 3.4.2. Creating a GnomeApp Window...........................................................................37 3.4.3. Menu and Tool-bar Creation................................................................................38 3.4.3.1. Automatic Menu and Tool-bar Creation ...................................................38 3.4.3.2. GnomeUIInfo Structure Definition...........................................................38 3.4.3.3. Helper Macros...........................................................................................40 3.4.3.4. Standard Menu Item Macros.....................................................................40 3.4.3.4.1. Menu Items ....................................................................................41 3.4.3.4.2. Menu Trees and Subtrees...............................................................43 3.4.3.5. Help Menu ................................................................................................44 3.4.3.6. Example ....................................................................................................45 3.4.3.7. Accelerator Keys.......................................................................................47 3.4.4. GnomeAppBar, The Status Bar ...........................................................................47 3.4.5. Talking To The User ............................................................................................48 3.5. Using the libgnomeui Library.........................................................................................51 3.5.1. Stock Icons...........................................................................................................51 3.5.2. Dialogs .................................................................................................................56 3.5.2.1. Generic Dialogs ........................................................................................56 3.5.2.2. Message Box.............................................................................................59 3.5.2.3. Property Dialogs .......................................................................................59 3.5.2.4. File Picking Dialog ...................................................................................61 3.5.2.5. About Box.................................................................................................62 3.5.3. Entries ..................................................................................................................63 3.5.3.1. GnomeEntry..............................................................................................64 3.5.3.2. GnomeFileEntry........................................................................................64 3.5.3.3. GnomePixmapEntry..................................................................................64 3.5.3.4. GnomeIconEntry.......................................................................................65 3.5.3.5. GnomeNumberEntry.................................................................................66 3.5.4. Using Images .......................................................................................................66 3.5.5. Session Management ...........................................................................................67 3.5.6. Multiple Document Interface...............................................................................69 3.5.6.1. The Main MDI Window............................................................................69 3.5.6.2. The MDI Children.....................................................................................70 3.5.7.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    84 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us