Gtk2-Perl Study Guide

Gaining an understanding of Gtk2-Perl

Dirk van der Walt

CSIR

      
      


Table of Contents
Introduction
1. Why I wrote this book?
2. Audience
3. Revision History
4. Sources
5. Feedback
6. Copyright information
7. What do you need?
8. Conventions used in this document
9. Organization of this document
1. Background
2. The trivial "Hello Gtk2-Perl "
2.1. Solution
2.1.1. Screenshot
2.1.2. Discussion
3. Documentation
3.1. Looking at a sample
3.1.1. Hierarchy
3.1.2. Methods
3.1.3. Properties
3.1.4. Signals
3.1.5. ENUMS AND FLAGS
3.1.6. Conclusion
4. The packing problem
4.1. Gtk2::Bin and its subclasses
4.2. Containers with more than one child
5. Reacting to user input
5.1. Signals
5.1.1. Event Signals
5.1.2. Signal Callbacks
5.1.3. Events from the mouse
5.1.4. Events from the keyboard
6. Gtk2::Label
6.1. The Code
7. Gtk2::Button
7.1. The Code
8. Gtk2::MessageDialog
8.1. The Code
8.2. Looking at Gtk2::MessageDialog and interesting parts of our program.
9. Gtk2::Dialog and Gtk2::Entry
9.1. The Code
9.2. Bringing the code and method of implementation together
10. Gtk2::Gdk
10.1. Gtk2::Gdk in general
10.2. Gtk2::Gdk - Bouncing Ball
10.2.1. General discussion on Gtk2::Gdk::Pixmap.
10.2.2. Creating the animation.
10.2.3. The program's interface.
10.2.4. The Code.
10.2.5. Discussing the code.
10.3. Gtk2::Gdk - On Screen Clock
10.3.1. Classes new to us.
10.3.2. Discussion on the program.
10.3.3. The program's interface.
10.3.4. The Code
10.4. Conclusion
11. More on Images
11.1. Image manipulation
11.1.1. The Screenshot.
11.1.2. The Code.
11.1.3. Discussing the program.
12. Gtk2::TextView
12.1. Gtk2::TextView overview
12.2. Gtk2::TextViews
12.2.1. Available Methods for Gtk2::TextView
12.2.2. Screenshot of the Gtk2::TextView demo program
12.2.3. Classes in use
12.2.4. The Code
12.3. Gtk2::TextBuffers
12.3.1. Gtk2::TextBuffer Status Information
12.3.2. Creating Gtk2::TextIters
12.3.3. Text Insertion, Retrieval and Deletion
12.3.4. Gtk2::TextMarks
12.3.5. Creating and Applying Gtk2::TextTags
12.3.6. Inserting Images and Widgets
12.4. Gtk2::TextIters
12.4.1. Gtk2::TextIter Attributes
12.4.2. Text Attributes at a Gtk2::TextIter
12.4.3. Retrieving Text and Objects
12.4.4. Checking Conditions at a Gtk2::TextIter
12.4.5. Checking Location in Text
12.4.6. Moving Through Text
12.4.7. Moving to a Specific Location
12.4.8. Searching in Text
12.5. Gtk2::TextMarks
12.6. Gtk2::TextTags and Gtk2::TextTagTables
12.6.1. Gtk2::TextTags
12.6.2. Gtk2::TextTagTable
12.7. Example: Cursors and Gtk2::TextView content
12.8. Example: The use of Gtk2::TextMarks
13. Glib::MainLoop
13.1. Introduction - Less is More
13.1.1. The Code
13.1.2. The Discussion
13.2. Gtk2::Helper - Countdown to Extinction
13.2.1. Objective
13.2.2. Discussion
13.2.3. The Screenshot
13.2.4. The Code
13.2.5. A last Point
13.3. Gtk2::Helper - Simple Chat
13.3.1. Objective
13.3.2. Requirements
13.3.3. The Screenshot
13.3.4. The Code
13.3.5. Code to fulfill the requirements
14. Gtk2::TreeView
14.1. Overview
14.1.1. The Screenshot.
14.1.2. Classes
14.1.3. The Code.
14.1.4. Important points
14.2. Editing Text in a Gtk2::TreeView
14.2.1. Introduction
14.2.2. Requirements
14.2.3. Working example
14.2.4. Same ice-cream, different topping
14.3. Display tricks using Gtk2::CellRenderers
14.3.1. Introduction
14.3.2. Background
14.3.3. A Sample Program
14.4. Making use of Gtk2::TreeSelection.
14.4.1. Introduction
14.4.2. A Sample Program
14.5. Using Gtk2::SimpleList for quick and easy lists.
14.5.1. Introduction
14.5.2. Advantages
14.5.3. End message
15. Gtk2::ComboBox and Gtk2::ComboBoxEntry Widgets
15.1. Gtk2::ComboBox Widgets
15.1.1. Basic Gtk2::ComboBox Use
15.1.2. Advanced Gtk2::ComboBox Use
15.2. Gtk2::ComboBoxEntry Widgets
15.2.1. Basic Gtk2::ComboBoxEntry Use
15.2.2. Advanced Gtk2::ComboBoxEntry Use
16. Menus
16.1. Background
16.1.1. The Screenshot.
16.1.2. The Code.
16.1.3. Points of interest.
17. Gtk2::Toolbar
17.1. Lesson
17.1.1. The Screenshot.
17.1.2. The Code.
17.1.3. Points of interest.
18. Gtk2::UIManager
18.1. Overview
18.1.1. Background on Gtk2::ActionGroup and Gtk2::Action
18.1.2. Background on UI Descriptions
18.1.3. Practical sample
19. Handy Containers
19.1. Descriptions
19.1.1. Practical sample
20. Selecting Files
20.1. A simple program to demonstrate
20.1.1. Screenshots.
20.1.2. The Code.
20.1.3. Points of interest.
20.1.4. Conclusion.
21. Drag and Drop
21.1. A few rules to play by.
21.1.1. A Checklist for functional Drag and Drop
21.1.2. Two data types explained
21.1.3. Quit dragging and start dropping!
21.1.4. A Screenshot
21.1.5. The Code.
21.1.6. Code that needs further explanation.
21.1.7. Conclusion.
22. The system tray
22.1. A simple sample program.
22.1.1. A Screenshot
22.1.2. The Code.
A. Pango Appendix
A.1. Pango Markup
B. POD Appendix
B.1. Introduction
B.1.1. POD readers
B.1.2. Writing POD
B.1.3. Eazy POD
C. Resource File Appendix
C.1. Introduction
C.1.1. Toplevel declarations
C.1.2. Pathnames and patterns
C.1.3. Creating a style
C.1.4. Creating a binding
C.2. Sample rc file
List of Tables
1. Typographic and usage conventions
6-1. Gtk2 object classes used
6-2. Special Class used
7-1. Gtk2 object classes used
8-1. Gtk2 object classes used
8-2. Special Classes used
9-1. Gtk2 object classes used
10-1. Gtk2::Gdk object classes used
10-2. Gtk2 object classes used
10-3. Gtk2::Gdk object classes used
10-4. Special Class used
10-5. Gtk2 object classes used
10-6. Gtk2::Gdk object classes used
10-7. Special Class used
11-1. Gtk2 object classes used
11-2. Gtk2::Gdk object classes used
12-1. Gtk2 object classes used
12-2. Gtk2::TextTag Attributes
12-3. Gtk2::TextTag Attributes
12-4. Gtk2 object classes used
13-1. Special Perl module used
13-2. Gtk2 object classes used
13-3. Special Perl module used
13-4. Gtk2 object classes used
14-1. Gtk2 object classes used
14-2. Pre-defined Gtk2::CellRenderer Types
14-3. Gtk2 object classes used
14-4. Gtk2 object classes used
16-1. Available menu items
17-1. Available Gtk2::ToolItem subclasses
18-1. Available Gtk2::Action subclasses
18-2. Available XML elements for the UI definition
18-3. Gtk2 object classes used
19-1. Gtk2 object classes used
20-1. Gtk2 object classes used
21-1. Gtk2 object classes used
22-1. Gtk2 object classes used
A-1. <span> attributes
A-2. Convenience tags
List of Figures
2-1. Hello Gtk2-Perl
3-1. Man page of Gtk2::Window
4-1. Packing Schematic
4-2. HBox packing
4-3. VBox packing
4-4. Expand not Fill
4-5. Expand AND Fill
4-6. Schematic of Table
5-1. Event Demo (Mouse)
5-2. Event Demo (Keyboard)
6-1. Gtk2::Label
7-1. Gtk2::Button
7-2. Icon on corner of window
8-1. Gtk2::MessageDialog
8-2. Info Message
9-1. Gtk2::Dialog and Gtk2::Entry
10-1. Bouncing Ball
10-2. Gtk2::Gdk - On Screen Clock
11-1. Images
12-1. TextView
12-2. Cursors and Gtk2::TextViews
13-1. Countdown to extinction
13-2. Simple Chat
14-1. Simple Gtk2::TreeView
14-2. Rendering Tricks
14-3. Finding a selection
15-1. Basic Gtk2::ComboBox
15-2. Gtk2::ComboBox with Wrapped Layout
15-3. Gtk2::ComboBoxEntry
16-1. Basic Menu
17-1. Toolbar
18-1. UIManager
19-1. Handy containers
20-1. The main program
20-2. File Chooser - Open
20-3. File Chooser - Save
21-1. Screenshot of the Drag and Drop sample program
22-1. Screenshot of the tray icon sample program