GTK v1.2 Tutorial
Tony Gale <gale@gtk.org> Ian Main <imain@gtk.org>,
February 21st, 1999
This is a tutorial on how to use GTK (the GIMP Toolkit) through its C
interface.
______________________________________________________________________
Table of Contents
1. Introduction
2. Getting Started
2.1 Hello World in GTK
2.2 Compiling Hello World
2.3 Theory of Signals and Callbacks
2.4 Events
2.5 Stepping Through Hello World
3. Moving On
3.1 Data Types
3.2 More on Signal Handlers
3.3 An Upgraded Hello World
4. Packing Widgets
4.1 Theory of Packing Boxes
4.2 Details of Boxes
4.3 Packing Demonstration Program
4.4 Packing Using Tables
4.5 Table Packing Example
5. Widget Overview
5.1 Casting
5.2 Widget Hierarchy
5.3 Widgets Without Windows
6. The Button Widget
6.1 Normal Buttons
6.2 Toggle Buttons
6.3 Check Buttons
6.4 Radio Buttons
7. Adjustments
7.1 Creating an Adjustment
7.2 Using Adjustments the Easy Way
7.3 Adjustment Internals
8. Range Widgets
8.1 Scrollbar Widgets
8.2 Scale Widgets
8.2.1 Creating a Scale Widget
8.2.2 Functions and Signals (well, functions, at least)
8.3 Common Functions
8.3.1 Setting the Update Policy
8.3.2 Getting and Setting Adjustments
8.4 Key and Mouse bindings
8.4.1 Vertical Range Widgets
8.4.2 Horizontal Range Widgets
8.5 Example
9. Miscellaneous Widgets
9.1 Labels
9.2 Arrows
9.3 The Tooltips Widget
9.4 Progress Bars
9.5 Dialogs
9.6 Pixmaps
9.7 Rulers
9.8 Statusbars
9.9 Text Entries
9.10 Spin Buttons
9.11 Combo Box
9.12 Color Selection
9.13 File Selections
10. Container Widgets
10.1 The EventBox
10.2 The Alignment widget
10.3 Fixed Container
10.4 Layout Container
10.5 Frames
10.6 Aspect Frames
10.7 Paned Window Widgets
10.8 Viewports
10.9 Scrolled Windows
10.10 Button Boxes
10.11 Toolbar
10.12 Notebooks
11. CList Widget
11.1 Creating a GtkCList widget
11.2 Modes of operation
11.3 Working with titles
11.4 Manipulating the list itself
11.5 Adding rows to the list
11.6 Setting text and pixmaps in the cells
11.7 Storing data pointers
11.8 Working with selections
11.9 The signals that bring it together
11.10 A GtkCList example
12. Tree Widget
12.1 Creating a Tree
12.2 Adding a Subtree
12.3 Handling the Selection List
12.4 Tree Widget Internals
12.4.1 Signals
12.4.2 Functions and Macros
12.5 Tree Item Widget
12.5.1 Signals
12.5.2 Functions and Macros
12.6 Tree Example
13. Menu Widget
13.1 Manual Menu Creation
13.2 Manual Menu Example
13.3 Using GtkItemFactory
13.4 Item Factory Example
14. Text Widget
14.1 Creating and Configuring a Text box
14.2 Text Manipulation
14.3 Keyboard Shortcuts
14.3.1 Motion Shortcuts
14.3.2 Editing Shortcuts
14.3.3 Selection Shortcuts
14.4 A GtkText Example
15. Undocumented Widgets
15.1 Calendar
15.2 CTree
15.3 Curves
15.4 Drawing Area
15.5 Font Selection Dialog
15.6 Gamma Curve
15.7 Image
15.8 Packer
15.9 Plugs and Sockets
15.10 Preview
16. Setting Widget Attributes
17. Timeouts, IO and Idle Functions
17.1 Timeouts
17.2 Monitoring IO
17.3 Idle Functions
18. Advanced Event and Signal Handling
18.1 Signal Functions
18.1.1 Connecting and Disconnecting Signal Handlers
18.1.2 Blocking and Unblocking Signal Handlers
18.1.3 Emitting and Stopping Signals
18.2 Signal Emission and Propagation
19. Managing Selections
19.1 Overview
19.2 Retrieving the selection
19.3 Supplying the selection
20. glib
20.1 Definitions
20.2 Doubly Linked Lists
20.3 Singly Linked Lists
20.4 Memory Management
20.5 Timers
20.6 String Handling
20.7 Utility and Error Functions
21. GTK's rc Files
21.1 Functions For rc Files
21.2 GTK's rc File Format
21.3 Example rc file
22. Writing Your Own Widgets
22.1 Overview
22.2 The Anatomy Of A Widget
22.3 Creating a Composite widget
22.3.1 Introduction
22.3.2 Choosing a parent class
22.3.3 The header file
22.3.4 The
22.3.5 The
22.3.6 The
22.3.7 And the rest...
22.4 Creating a widget from scratch.
22.4.1 Introduction
22.4.2 Displaying a widget on the screen
22.4.3 The origins of the Dial Widget
22.4.4 The Basics
22.4.5 (TT
22.4.6 Size negotiation
22.4.7 (TT
22.4.8 Event handling
22.4.9 Possible Enhancements
22.5 Learning More
23. Scribble, A Simple Example Drawing Program
23.1 Overview
23.2 Event Handling
23.3 The DrawingArea Widget, And Drawing
23.4 Adding XInput support
23.4.1 Enabling extended device information
23.4.2 Using extended device information
23.4.3 Finding out more about a device
23.4.4 Further sophistications
24. Tips For Writing GTK Applications
25. Contributing
26. Credits
27. Tutorial Copyright and Permissions Notice
28. GTK Signals
28.1 GtkObject
28.2 GtkWidget
28.3 GtkData
28.4 GtkContainer
28.5 GtkCalendar
28.6 GtkEditable
28.7 GtkTipsQuery
28.8 GtkCList
28.9 GtkNotebook
28.10 GtkList
28.11 GtkMenuShell
28.12 GtkToolbar
28.13 GtkTree
28.14 GtkButton
28.15 GtkItem
28.16 GtkWindow
28.17 GtkHandleBox
28.18 GtkToggleButton
28.19 GtkMenuItem
28.20 GtkListItem
28.21 GtkTreeItem
28.22 GtkCheckMenuItem
28.23 GtkInputDialog
28.24 GtkColorSelection
28.25 GtkStatusBar
28.26 GtkCTree
28.27 GtkCurve
28.28 GtkAdjustment
29. GDK Event Types
30. Code Examples
30.1 Tictactoe
30.1.1 tictactoe.h
30.1.2 tictactoe.c
30.1.3 ttt_test.c
30.2 GtkDial
30.2.1 gtkdial.h
30.2.2 gtkdial.c
30.2.3 dial-test.c
30.3 Scribble
30.3.1 scribble-simple.c
30.3.2 scribble-xinput.c
31. List Widget
31.1 Signals
31.2 Functions
31.3 Example
31.4 List Item Widget
31.5 Signals
31.6 Functions
31.7 Example
______________________________________________________________________
11.. IInnttrroodduuccttiioonn
GTK (GIMP Toolkit) is a library for creating graphical user
interfaces. It is licensed using the LGPL license, so you can develop
open software, free software, or even commercial non-free software
using GTK without having to spend anything for licenses or royalties.
It's called the GIMP toolkit because it was originally written for
developing the General Image Manipulation Program (GIMP), but GTK has
now been used in a large number of software projects, including the
GNU Network Object Model Environment (GNOME) project. GTK is built on
top of GDK (GIMP Drawing Kit) which is basically a wrapper around the
low-level functions for accessing the underlying windowing functions
(Xlib in the case of X windows). The primary authors of GTK are:
+o Peter Mattis petm@xcf.berkeley.edu
+o Spencer Kimball spencer@xcf.berkeley.edu
+o Josh MacDonald jmacd@xcf.berkeley.edu
GTK is essentially an object oriented application programmers
interface (API). Although written completely in C, it is implemented
using the idea of classes and callback functions (pointers to
functions).
There is also a third component called glib which contains a few
replacements for some standard calls, as well as some addition
没有合适的资源?快使用搜索试试~ 我知道了~
gtk+-1.2.4.tar.gz
需积分: 10 7 下载量 93 浏览量
2011-05-12
20:17:59
上传
评论
收藏 2.65MB GZ 举报
温馨提示
共604个文件
c:179个
h:137个
html:94个
gtk+-1.2.4.tar.gzgtk+-1.2.4.tar.gzgtk+-1.2.4.tar.gz
资源推荐
资源详情
资源评论
收起资源包目录
gtk+-1.2.4.tar.gz (604个子文件)
testgtk.1 476B
README.1ST 1KB
ABOUT-NLS 11KB
Makefile.am 11KB
Makefile.am 5KB
Makefile.am 4KB
Makefile.am 2KB
AUTHORS 1KB
makeenums.awk 3KB
maketypes.awk 2KB
extract.awk 1KB
testgtk.c 244KB
gtkclist.c 206KB
gtkctree.c 162KB
gtktext.c 145KB
gdkrgb.c 135KB
gtkstyle.c 128KB
gtkwidget.c 124KB
gtknotebook.c 115KB
gtkfontsel.c 113KB
gdkdnd.c 83KB
gtkcalendar.c 77KB
gtkdnd.c 75KB
gtkfilesel.c 71KB
gtklist.c 68KB
gdkwindow.c 63KB
gtkentry.c 62KB
gdkevents.c 56KB
gtkcolorsel.c 53KB
gtkrc.c 49KB
gtkwindow.c 49KB
gtksignal.c 49KB
gtktypebuiltins_evals.c 48KB
gtkcontainer.c 48KB
gtkspinbutton.c 43KB
gtkitemfactory.c 42KB
gtkselection.c 41KB
gtkrange.c 40KB
gdkcc.c 40KB
gtktable.c 40KB
gdkim.c 39KB
gtkpacker.c 35KB
gtkhandlebox.c 35KB
gtkbindings.c 34KB
gdk.c 34KB
gtkmain.c 33KB
gtkscrolledwindow.c 32KB
gtktoolbar.c 32KB
gtkmenu.c 32KB
gtktree.c 31KB
gtklayout.c 31KB
gtktreeitem.c 30KB
gtkobject.c 29KB
gdkcolor.c 29KB
gtkmenushell.c 28KB
gtkaccelgroup.c 28KB
gtkcombo.c 27KB
gtkeditable.c 26KB
gtkbutton.c 25KB
gtkviewport.c 25KB
gtktypeutils.c 24KB
gtklabel.c 24KB
gtkcurve.c 23KB
testdnd.c 23KB
pack.c 23KB
gtkmenuitem.c 22KB
gtkprogressbar.c 22KB
gtkoptionmenu.c 21KB
gtklistitem.c 20KB
gtkinputdialog.c 20KB
gtksocket.c 19KB
gdkpixmap.c 19KB
gdkgc.c 19KB
gtkvscale.c 19KB
gtkhscale.c 18KB
gtktogglebutton.c 18KB
gtkbox.c 18KB
gxid.c 18KB
gdkfont.c 17KB
gtkprogress.c 17KB
gtkarg.c 17KB
gtktooltips.c 16KB
gtkpaned.c 16KB
gtkmarshal.c 15KB
gtkvscrollbar.c 15KB
gtkhscrollbar.c 15KB
gtkdial.c 15KB
gtktipsquery.c 14KB
gtkframe.c 14KB
gtkpreview.c 14KB
gdkdraw.c 14KB
gtkaspectframe.c 13KB
gtkmenufactory.c 13KB
gtkaccellabel.c 13KB
testselection.c 13KB
gtkfixed.c 13KB
gtkcheckbutton.c 12KB
gdkimage.c 12KB
gtkgamma.c 12KB
gtkplug.c 12KB
共 604 条
- 1
- 2
- 3
- 4
- 5
- 6
- 7
资源评论
zhigongjz
- 粉丝: 60
- 资源: 7
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功