Transcription of GTK+ / Gnome Application Development
1 GTK+ / Gnome ApplicationDevelopmentHavoc PenningtonRed Hat Advanced Development LabsGTK+ / Gnome Application Developmentby Havoc PenningtonFirst Release EditionPublished 1999 Copyright 1999 by New Riders PublishingThis material may be distributed only subject to the terms and conditions set forth in the Open Publication License, or later (the latest version is presently available at ( ) )Table of ContentsI. is Gnome ?..24 The Gnome Development +.. Word About Header of the glib: Portability and Used GTK+ Tour of GTK+..50A Complete Hello, Hello, It the Main on Signals and And Widget Box Packing Box Packing Packing ().
2 65 Other Layout Affecting Life , Mapping, and Widget Main Loop Building a Gnome Creating Your Source of a Gnome Source Tree GNU Support Datafiles: Documentation and Gnome Application the Parsing Parsing in Configuration Stored Config Data In Configuration File Example Config File the GnomeClient The Main and Toolbars with GnomeUIInfo to a : An a Status Documentation and Help Menu to Screen Window Class User Communication: a in the Dialog Dialog Gnome Application Advanced GTK+/ Gnome The GTK+ Object and Type and Class Checking and New a New and the Type Object Object Object Arguments in Your Own GtkObject the Available Object a New Existing A Happens When A Signal Is Data to GDK and and and of and a and of Event GDK Events in GTK+.
3 176 Button Movement Change Change and Drop Mouse the the Resource and Writing of a Widget Example: and s , Hiding, and : Containers With One and Removing Over : A Windowless a GTK_NO_WINDOW : A Trivial Composite to the Canvas the Items and Canvas Canvas Item and Ellipse Writing a Update Render Method (Antialiased Mode)..284 Speed and RGB Draw Method (GDK Mode)..287 Other and GTK+/ Gnome Object Table of Header Frequently Asked , with do I make my Application beep?
4 375 When do I need to destroy my widgets?..375 When I turn on memory profiling in glib, my Application becomesunstable. What gives?..375To create a custom display, I want to place widgets in arbitrarylocations, or move them around rapidly, or draw to themdirectly. How?..375 Why does my memory debugging tool show memory leaks in glib?375I get a bunch of "assertion failed" warnings from GTK+. Whatcauses these?..376 Why are some things in Gnome rather than GTK+?..376 How can I center a window on the screen?..376Is there a widget that does printing?..377 When Ifork(), I get a bunch of warnings and my program s going on?
5 377 When do I need to callgtk_widget_realize() ()?..377 When creating a pixmap, I get the warning:Creating pixmapfrom xpm with NULL window and colormap. What swrong?..378 How can I separate the GUI from the rest of my Application ?..378I don t like the default appearance of [some widget]. How do Ichange its appearance?..379 Thanks for the lecture, but I have a really good reason to change theappearance of a widget. How do I override the theme?..380 Why are signals specified as strings rather than integers or somesort of macro?..380 Why is GTK+ written in C?..380My motion event handler is only invoked once; why is that?
6 38018 Can I move the mouse pointer myself?..380 How do I read the pixels out of a GdkPixmap?..381I m drawing a lot of points to the screen withgdk_draw_point(),and it s unbelievably slow. What s wrong? How can I renderimage data to the screen?..381I m trying to set the background of aGtkLabel, and it doesn t the GTK+ and Gnome source code, many functions have twovariants: one calledgtk_whatever_foo(), and another calledgtk_whatever_real_foo(). What s the difference?..382 How do I "gray out" a widget, so the user can t select it?..382I m connecting to "button_press_event" or some other event signal,but the callback is never want to use the arrow keys as a control in my Application , butGTK+ keeps stealing the key press events to move the GTK+ have multiple inheritance?
7 383I m getting error messages from GDK. How can I determine thecause of these?..383 How do I update the GUI without returning control to the mainloop?..383 How should I format code to be included in GTK+ or Gnome ?..383Is there a GUI builder for GTK+ and Gnome ?..384 How well do GTK+ and Gnome support internationalization?..38417. Online and Compiling the Relay Code GnomeHello of Tables4-1. GnomeUIInfoType The GTK+ Fundamental GdkWindowAttr GdkEventType Event Modifier Masks for Key and Button GC GnomeCanvasRE GnomeCanvasLine GnomeCanvasPolygon GnomeCanvasImage GnomeCanvasText GnomeCanvasWidget glib, GTK+, and Gnome Header of Figures2-1.
8 Familiar C Macros for storing integers in Precondition glib memory Allocation Portability In-place string String Allocating Concatenating Manipulating NULL-terminated string Changing linked list Accessing data in a linked Manipulating a linked Sorted Creating and destroying balanced binary Manipulating GTree Determining the size of a Traversing Accessing GNode Creating a Building a GNode Building a Destroying a Predicates for GNode Accessing a Pre-written Manipulating Freezing and thawing Hello, Buttons packed into Non-homogeneous, with expand = Non-homogeneous, with expand = TRUE and fill = Non-homogeneous, with expand = TRUE and fill = Homogeneous, with fill = Homogeneous.
9 With fill = All Five Ways to Pack a GtkTable before GtkTable after expanding the window GtkTable after expanding the window GtkTable after shrinking the window GtkTable after shrinking the window Attaching with Forcing Default Window Widget Reference Showing/Realizing Widget Changing State Main Quit Timeout Idle Input Initializing Translation Init with Argument Retrieving data from configuration Saving data to configuration Configuration file Miscellaneous configuration file The Gnumeric spreadsheet, which uses Adding Widgets Creating Widgets from Installing a Extracting Help Installing Menu Querying Screen Setting Class AGnomeDialogfrom the Gnumeric Modal "Running" a Property Box Message Box Convenience Macros for Accessing GtkArg Manipulating Object Using Signal Attaching key-value pairs to a Default Color GdkPixmap GdkWindow Event Widget Event Querying Pointer Grabbing the Font Font Five dashed lines, with Default dash pattern.
10 With varied A complex dash Drawing Drawing Drawing Drawing Drawing Drawing Drawing TheGtkEvwidget. Events are reported for the white Root Group Coordinate Affine Canvas Canvas Canvas Canvas Using A dialog filled ThreeGtkToggleButtonwidgets; the center one is "active."..30914-6. ThreeGtkCheckButtonwidgets; the center one is "active."..31014-7. A group of , with , with the four shadow positions pixmaps in a separate column to theleft of the menu item A torn-offGtkHandleBoxcontaining a toolbar, alongside its original the optional progress bar turned Gnome file manager, The Gnome file manager s list view Horizontal and Y2K compliant!