GTK+ 2.0 Tutorial using Ocaml

Tony Gale

Ian Main

& the GTK team

Ocaml Adaptation: SooHyoung Oh


Table of Contents
Tutorial Availability
Ocaml Version Tutorial Availability
Introduction
GTK+ 2.0 in Ocaml
Getting Started
Hello World in GTK
Compiling Hello World
Theory of Signals and Callbacks
Events
Stepping Through Hello World
Moving On
More on Signal Handlers
An Upgraded Hello World
Packing Widgets
Theory of Packing Boxes
Details of Boxes
Packing Demonstration Program
Packing Using Tables
Table Packing Example
Widget Overview
Type Conversion
Widget Hierarchy
Widgets Without Windows
Structure of Widgets
Creating Widgets
Default Arguments
Memory Management
The Button Widget
Normal Buttons
Toggle Buttons
Check Buttons
Radio Buttons
Adjustments
Creating an Adjustment
Using Adjustments the Easy Way
Adjustment Internals
Range Widgets
Scrollbar Widgets
Scale Widgets
Creating a Scale Widget
Functions and Signals (well, functions, at least)
Common Range Functions
Setting the Update Policy
Getting and Setting Adjustments
Key and Mouse bindings
Example
Miscellaneous Widgets
Labels
Arrows
The Tooltips Object
Progress Bars
Dialogs
Rulers
Statusbars
Text Entries
Spin Buttons
Combo Box
Calendar
Color Selection
File Selections
Container Widgets
The EventBox
The Alignment widget
Fixed Container
Layout Container
Frames
Aspect Frames
Paned Window Widgets
Viewports
Scrolled Windows
Button Boxes
Toolbar
Notebooks
Menu Widget
Manual Menu Creation
Manual Menu Example
Automatic Menu Generation
Automatic Menu Generation Example
Undocumented Widgets
Accel Label
Option Menu
Menu Items
Check Menu Item
Radio Menu Item
Separator Menu Item
Tearoff Menu Item
Curves
Drawing Area
Font Selection Dialog
Message Dialog
Gamma Curve
Image
Plugs and Sockets
Tree View
Text View
Setting Widget Attributes
Timeouts and Idle Functions
Timeouts
Idle Functions
Advanced Event and Signal Handling
Signal Functions
Connecting and Disconnecting Signal Handlers
Blocking and Unblocking Signal Handlers
Signal Emission and Propagation
Clipboard
Overview
Clipboard Example
Drag-and-drop (DND)
Overview
Properties
Functions
Setting up the source widget
Signals on the source widget:
Setting up a destination widget:
Signals on the destination widget:
GTK's rc Files
Functions For rc Files
GTK's rc File Format
Example rc file
Scribble, A Simple Example Drawing Program
Overview
Event Handling
The DrawingArea Widget, And Drawing
Contributing
Ocaml Version Contributing
Credits
Ocaml Version Credits
Tutorial Copyright and Permissions Notice
Ocaml Version Tutorial Copyright and Permissions Notice
GTK Signals
GObj
GObj.gtkobj
GObj.widget
Widget
Misc signals
Drag signals
GData.adjustment
GRange.range
GContainer
GContainer.container
GContainer.item
GBin
GBin.handle_box
GBin.expanderhandle_box
GPack.notebook
GMenu
GMenu.menu_shell
GMenu.menu_item
GMenu.check_menu_item
GEdit
GEdit.editable
GEdit.entry
GEdit.spin_button
GEdit.combo_box
GButton
GButton.button
GButton.toggle_button
GButton.color_button
GButton.fontcolor_button
GButton.toolbar
GButton.tool_button
GButton.toggle_tool_button
GWindow
GWindow.dialog
GWindow.file_chooser_dialog
GFile
GFile.chooser
GFile.chooser_widget
GMisc
GMisc.calendar
GMisc.tips_query
GTree
GTree.model
GTree.tree_sortable
GTree.selection
GTree.view_column
GTree.view
GTree.cell_renderer_text
GTree.cell_renderer_toggle
GDK Event Types
Code Examples
Scribble
scribble.ml