Skip to content

GTK+ Programming in 21 Days

Spend $50 to get a free DVD!

ISBN-10: 0672318296

ISBN-13: 9780672318290

Edition: 2000

Authors: Donna S. Martin

List price: $39.99
Blue ribbon 30 day, 100% satisfaction guarantee!
Out of stock
what's this?
Rush Rewards U
Members Receive:
Carrot Coin icon
XP icon
You have reached 400 XP and carrot coins. That is the daily max!


GTK+ is a multi-platform open source toolkit used to create graphical user interfaces and desktop applications. This text provides a step-by-step tutorial on GTK+ programming. An accompanying website includes the GTK libraries.
Customers also bought

Book details

List price: $39.99
Copyright year: 2000
Publisher: Pearson Education
Publication date: 2/18/2000
Binding: Paperback
Pages: 936
Size: 7.50" wide x 9.50" long x 1.75" tall
Weight: 3.278

What You Need to Know to Use This Book
This Book's Special Features
At a Glance
An Introduction to GTK+
What Is GTK+?
What Is the X Window System?
GTK+ and the X Window System
What Are GDK and GLib?
What Kind of Widgets Are Available in GTK+?
Language Bindings
Why Should You Use GTK+?
How to Compile Sample Programs
An Overview of GTK+ Applications
An Application's Instance Tree
Widget Attributes and States
Foreground and Background Color
Background Pixmap
Styles and RC Files
More on Styles
More on RC Files
Widget Classes
The Seven Steps to a Basic GTK+ Program
Seven Steps to a Basic GTK+ Program
Initializing the Environment
Creating Widgets and Setting Widget Attributes
Registering Callback Routines
Defining an Instance Hierarchy
Showing Widgets
Processing Signals and Events
Quitting the Program
Summary of the Seven steps
Shutting Down Your Application
Expanding Your Program
Detailing the GtkBox widget
Packing Attributes
A Few More Packing Routines
Components of a User Interface
Modifying gtkfun
Implementing a Menu Bar with Menus
Creating the Menu Bar and Its Items
Creating and Attaching Menus
Attaching the Menu to the Menu Bar
A Quick Review
Creating a Work Area
A Look at the GtkTable widget
A Table's Packing Attributes
Adding Help to plotter
Using Simple Pop-ups
Using Dialog Widgets
Hiding Dialog Widgets
What About the delete-event?
Popping Up Your Own Instance Trees
Providing Hints (Tooltips)
Providing Context-Sensitive Help
More on Menus
Adding Menu Shortcuts (Accelerators)
Adding Underline Accelerators
Creating Cascading Menus
Using an Item Factory
Item Factory Callbacks and Callback Data
Passing Data to Item Factory Callbacks
Additional Widgets and Issues to Consider
Implementing File Selections
Attaching Signal Handlers
Controlling the Work Area
Using Scrollbars
Setting Scrollbar Policy
General Design Techniques
Program Layout
Data Sharing
General Debugging Advice
At a Glance
Adding Graphics To Your Application
Introduction To Graphics
Graphics Contexts
Drawing Primitives
A Complete Program with all Primitives
Utilizing Color
The RGB Color Model
Using Color in Your Application
Understanding Visuals
The Pseudo-Color Visual
The True-Color Visual
The Grayscale Visual
Allocating and Using Colors
More on Color Specifications
Using the Color Selection Dialog
Accessing the OK and Cancel Buttons
Customizing Graphics Contexts
Changing Your Fonts
Introduction to Fonts
Using Fonts in GDK
Loading and Unloading Fonts
Determining the Size of a Labeling String
Using the Font Selection Dialog
Incorporating Pixmaps
What Are Pixmaps?
Creating and Initializing Pixmaps
Using Pixmaps for Animation
Implementing Icons
Using XPM Files as Pixmaps
Using GtkPixmap to display icons
Placing the Icon on a Menu
A Note About Window IDs
Customizing the Cursor
Using Predefined Cursors
Creating a Cursor
Adding GDK Event Handling
Writing Event Handlers
The GdkEventButton Structure
Selecting Events
Event Types, Signals, and Structures
Handling Expose Events (Revisiting Pixmaps)
What Really Happens when a Button Is Clicked?
GLib Basic Functions
Introduction to GLib
Types and Type Conversion
Standard Macros and Defined Values
Type Conversion Macros
Byte Order Macros
Printing Errors and Other Messages
Assertion Functions
Message Logging
Memory Allocation
Memory Allocation Functions
Memory Allocation Macros
Copying Memory Blocks
String Handling
String Conversion Functions
String Modification Functions
String Generation Functions
Automatic String Growth Functions
GLib Datatypes
Implementing Arrays with GLib
Ordinary Arrays
Pointer Arrays
Byte Arrays
Using Linked Lists
Singly Linked Lists
Doubly Linked Lists
Binary Trees
Using Hash Tables
At a Glance
Using Lists
An Overview of the Two List Widgets
Using the GtkList
Initializing the GtkList
Getting help from Glib
Populating the GtkList
Removing Items from a GtkList
Being Notified About GtkList Selection Changes
Obtaining the GtkList Focused Item and Selected Items
Providing Scrollbars for a GtkList
Explicitly Selecting and Deselecting Items in a GtkList
Example Illustrating the Covered GtkList Functionalities
Moving Onward to the GtkCList
Initializing a GtkCList
Populating a GtkCList
Removing GtkCList Rows
Being Notified About GtkCList Selection Changes
Obtaining the GtkCList Focused Item and Selected Items
Providing Scrollbars for a GtkCList
Explicitly Selecting and Deselecting Rows in a GtkCList
Showing Specific Parts of a GtkCList Without Using Scrollbars
Optimizing GtkCList Content Changes
Rearranging Existing GtkCList Rows
Working with the GtkCList Title Bar
Using the GtkCList Column Widths
Using Styles with GtkCList Rows and Cells
Attaching Data to GtkCList Rows
Accessing GtkCList Cell Contents
Sorting GtkCList Columns
Example Illustrating the Covered GtkCList Functionalities
Using Trees
Overview of the Tree Widgets
Using the GtkTree
Initializing the GtkTree
Populating the GtkTree
Creating Branches in a GtkTree
Finding Items in the Entire GtkTree
Removing Items from a GtkTree
Obtaining the Selected Items from a GtkTree
Being Notified About Selection Changes in a GtkTree
Being Notified When GtkTree Nodes Are Collapsed or Expanded
Simulating Focused Items for a GtkTree
Providing Scrollbars for a GtkTree
Explicitly Selecting and Deselecting GtkTree Items
Explicitly Expanding and Collapsing GtkTree Nodes
An Example GtkTree
Introduction to the GtkCTree Widget
Initializing the GtkCTree
Populating the GtkCTree
Modifying GtkCTree Nodes
Removing Nodes from a GtkCTree
Obtaining the Selected Nodes from a GtkCTree
Explicitly Selecting and Deselecting Nodes in a GtkCTree
Explicitly Collapsing and Expanding Nodes in a GtkCTree
Being Notified About GtkCTree Selection Changes
Being Notified when GtkCTree Nodes Are Expanded or Collapsed
Attaching Data to GtkCTree Nodes
Just a Few More Widgets
A Button Review
The GtkTogg1eButton
The GtkCheckButton
The GtkRadioButton
More Menu and Menu Item Choices
The GtkTearOffMenuItem
The GtkCheckMenuItem
The GtkRadioMenuItem
The GtkOptionMenu
What About Text Input and Editing?
The GtkEntry
The GtkText
Range Widgets
The GtkScale
The GtkScrollbar
More Container Widgets
Using GtkFixed Widgets
Using GtkLayout Widgets
Sizing the Widget Placement Area
Putting Widgets into the Layout Widget
Using Paned Widgets
Packing Widgets into Your Panes
Resizing the Panes
Using GtkNotebook Widgets
Notebook Creation and Tab Properties
Adding Pages to the Notebook
Manipulating Notebook Pages
The switch-page Signal
Look at the Bin Widgets
Another Look at the GtkScrolledWindow and GtkViewport
Using Frames
Aspect Frames
Controlling a Child Widget's Size and Positioning with Alignment
Supplying Windows for Child Widgets with Event Boxes
Implementing Selections
Using Targets and Atoms
Introducing the GClipper Utility
How to Compile and Install GClipper
A Brief Usage Overview of GClipper
Acting as a Requestor
Requesting the Selection Data
Determining the Selection Targets
Receiving the Selection Data
Simple Example Demonstrating the Requestor's Role
Becoming an Owner
Defining the Targets
Registering the Targets
Taking the Ownership
Providing the Selection Data
Handling the Loss of Ownership
A Simple Ownership Example
Implementing Drag and Drop
An Overview of Drag and Drop
Understanding the Destination Side of Drag and Drop
Defining a Destination Widget
Receiving the Data After a Drop
Understanding the Source Side of Drag and Drop
Defining a Source Widget
Setting the Drag Icon
Reacting to the Start of a Drag-and-Drop Event
Providing the Data After a Drop
Finishing a Drag-and-Drop Event
A Simple Drag-and-Drop Example
Utilizing Advanced Drag and Drop
Initiating a Drag Operation Manually
Dynamically Changing the Drag Icon
Verifying a Possible Drag Destination
Leaving the Destination Widget
Highlighting and Unhighlighting the Destination Widget
Receiving the Data After a Drop Event
Finishing a Drag-and-Drop Event
An Advanced Drag-and-Drop Example
So, What's Next?
A Parting Note
C Programming Review
Anatomy of a C Program
Variable Datatypes, Definition and Scope
Standard C Datatypes
Variable Definitions
Variable Arrays
Scope of Variables
Further Reading on Variables
Assignment Operators
Mathematical Operators
Relational Operators
Logical Operators
Iterative Statements
Conditional Statements
Pointers Introduction/Character Strings
Escape Codes Within Character Strings
Creating and Calling Functions
Command Line Arguments
Pointers to Structures
C Preprocessing
Standard Library Header Files
Useful Standard Functions
Compiling Your Programs
The make Utility
Automake, autoscan, aclocal, and autoconf
List of Reserved Keywords
The GTK+ Widget Class Hierarchy
Function Prototypes
Partial Signal List
Callback Prototypes
GDK Functions
GTK+ Functions
Datatypes and Structures
GLib Basic Datatypes
GDK Basic Datatypes
GDK Cursors
GDK Events
GDK Drawing Primitives
GDK Graphics
GTK+ Basic Datatypes
GTK+ Item Factories
GTK+ Styles
GTK+ Tooltips
GTK+ Widgets
GTK+ Copyright
Information for Motif and Xt Programmers
General Information
GTK+ Widgets
GDK Versus Xlib
Event Processing