GTK2-Perl Tutorial [ALPHA]

Emmanuele Bassi

James Curbo

& the GTK2-Perl team

Abstract

This is a tutorial on how to use GTK (the GIMP Toolkit) through its Perl interface. It is based on the original GTK Tutorial by Tony Gale and Ian Main.


Table of Contents

1. Tutorial Availability
2. Introduction
3. Using GTK+ in Perl and This Tutorial
4. Getting Started
1. Hello World in GTK2-Perl
2. Theory of Signals and Callbacks
3. Events
4. Stepping Through Hello World
5. Moving On
1. More on Signal Handlers
2. An Upgraded Hello World
6. Packing Widgets
1. Theory of Packing Boxes
2. Details of Boxes
3. Packing Demonstration Program
4. Packing Using Tables
5. Table Packing Example
7. Widget Overview
1. Widget Hierarchy
2. Widgets Without Windows
8. The Button Widget
1. Normal Buttons
2. Toggle Buttons
3. Check Buttons
4. Radio Buttons
9. Adjustments
1. Creating an Adjustment
2. Using Adjustments the Easy Way
3. Adjustment Internals
10. Range Widgets
1. Scrollbar Widgets
2. Scale Widgets
2.1. Creating a Scale Widget
2.2. Functions and Signals (well, functions, at least)
3. Common Range Functions
3.1. Setting the Update Policy
3.2. Getting and Setting Adjustments
4. Key and Mouse bindings
5. Example
11. Miscellaneous Widgets
1. Labels
2. Arrows
3. The Tooltips Object
4. Progress Bars
5. Dialogs
6. Rulers
7. Statusbars
8. Text Entries
9. Spin Buttons
10. Combo Box
11. Calendar
12. Color Selection
13. File Selections
12. Container Widgets
1. The EventBox
2. The Alignment widget
3. Fixed Container
4. Layout Container
5. Frames
6. Aspect Frames
7. Paned Window Widgets
8. Viewports
9. Scrolled Windows
10. Button Boxes
11. Toolbar
12. Notebooks
13. Menu Widget
1. Manual Menu Creation
2. Manual Menu Example
3. Using ItemFactory
3.1. ItemFactory entries
3.2. Creating an ItemFactory
3.3. Making use of the menu and its menu items
4. Item Factory Example
14. Undocumented Widgets
1. Accel Label
2. Option Menu
3. Menu Items
3.1. Check Menu Item
3.2. Radio Menu Item
3.3. Separator Menu Item
3.4. Tearoff Menu Item
4. Curves
5. Drawing Area
6. Font Selection Dialog
7. Message Dialog
8. Gamma Curve
9. Image
10. Plugs and Sockets
11. Tree View
12. Text View
15. Setting Widget Attributes
16. Timeouts, IO and Idle Functions
1. Timeouts
17. Advanced Events And Signals
18. Managing Selections
1. Overview
2. Retrieving the selection
3. Supplying the selection
19. Drag-and-drop (DND)
1. Overview
2. Properties
3. Functions
3.1. Signals on the source widget:
3.2. Signals on the destination widget:
20. GLib
21. GTK's rc Files
1. Functions For rc Files
2. GTK's rc File Format
3. Example rc file
22. Writing Your Own Widgets
1. Overview
23. Scribble, A Simple Example Drawing Program
1. Overview
24. Tips For Writing GTK Applications
25. Contributing
26. Credits of the GTK2-Perl Tutorial
27. Original GTK C Tutorial Credits
28. Tutorial Copyright and Permissions Notice
A. GTK Signals
B. GDK Event Types
C. Code Examples