~canonical-dx-team/ubuntu/maverick/gtk+2.0/menuproxy

« back to all changes in this revision

Viewing changes to docs/tutorial/html/x442.html

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-05-04 12:24:25 UTC
  • mfrom: (1.1.21 upstream)
  • Revision ID: james.westby@ubuntu.com-20070504122425-0m8midgzrp40y8w2
Tags: 2.10.12-1ubuntu1
* Sync with Debian
* New upstream version:
  Fixed bugs:
  - 379414 file chooser warnings when changing path in the entry
  - 418585 GtkFileChooserDefault sizing code is not DPI independent
  - 419568 Crash in search if start with special letter
  - 435062 build dies with icon cache validation
  - 379399 Segfault to call gtk_print_operation_run twice.
  - 387889 cups backend has problems when there are too many printers
  - 418531 invalid read to gtkicontheme.c gtk_icon_theme_lookup_icon...
  - 423916 crash in color scheme code
  - 424042 Segmentation fault while quickly pressing Alt+arrows
  - 415260 Protect against negative indices when setting values in G...
  - 419171 XGetVisualInfo() may not set nxvisuals
  - 128852 Gdk cursors don't look good on win32
  - 344657 Ctrl-H doesn't toggle "Show Hidden Files" setting
  - 345345 PrintOperation::paginate is not emitted for class handler
  - 347567 GtkPrintOperation::end-print is not emitted if it's cance...
  - 369112 gtk_ui_manager_add_ui should accept unnamed separator
  - 392015 Selected menu item invisible on Windows Vista
  - 399253 MS-Windows Theme Bottom Tab placement rendering glitches
  - 399425 gtk_input_dialog_fill_axes() adds child to gtkscrolledwin...
  - 403251 [patch] little memory leak in GtkPrintJob
  - 403267 [patch] memory leak in GtkPageSetupUnixDialog
  - 403470 MS-Windows Theme tab placement other than on top leaks a ...
  - 404506 Windows system fonts that have multi-byte font names cann...
  - 405089 Incorrect window placement for GtkEventBox private window
  - 405515 Minor leak in gtkfilesystemmodel.c
  - 405539 gdk_pixbuf_save() for PNG saver can return FALSE without ...
  - 415681 gdk_window_clear_area includes an extra line and column o...
  - 418219 GtkRecentChooser should apply filter before sorting and c...
  - 418403 Scroll to printer after selecting it from settings
  - 421985 _gtk_print_operation_platform_backend_launch_preview
  - 421990 gtk_print_job_get_surface
  - 421993 gtk_print_operation_init
  - 423064 Conditional jump or move depends on uninitialised value(s...
  - 423722 Fix printing header in gtk-demo
  - 424168 gtk_print_operation_run on async preview
  - 425655 Don't install gtk+-unix-print-2.0.pc on non-UNIX platforms
  - 425786 GDK segfaults if XineramaQueryScreens fails
  - 428665 Lpr Backend gets stuck in infinite loop during gtk_enumer...
  - 429902 GtkPrintOperation leaks cairo contextes
  - 431997 First delay of GdkPixbufAnimationIter is wrong
  - 433242 Inconsistent scroll arrow position calculations
  - 433972 Placing gtk.Expander inside a gtk.TextView() changes gtk....
  - 434261 _gtk_toolbar_elide_underscores incorrectly handles some s...
  - 383354 ctrl-L should make 'Location' entry disappear
  - 418673 gtk_recent_manager_add_item
  - 429732 gtk_accel_group_finalize accesses invalid memory
  - 435028 WM_CLIENT_LEADER is wrong on the leader_window
  - 431067 Background of the header window is not updated
  - 338843 add recent files support inside the ui manager
  - 148535 add drop shadow to menus, tooltips, etc. under Windows XP
* debian/control.in:
  - Conflicts on ubuntulooks (<= 0.9.11-1)
* debian/patches/15_default-fallback-icon-theme.patch:
  - patch from Debian, fallback on gnome icon theme

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/loose.dtd">
 
2
<HTML
 
3
><HEAD
 
4
><TITLE
 
5
>Table Packing Example</TITLE
 
6
><META
 
7
NAME="GENERATOR"
 
8
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
 
9
REL="HOME"
 
10
TITLE="GTK+ 2.0 Tutorial"
 
11
HREF="book1.html"><LINK
 
12
REL="UP"
 
13
TITLE="Packing Widgets"
 
14
HREF="c355.html"><LINK
 
15
REL="PREVIOUS"
 
16
TITLE="Packing Using Tables"
 
17
HREF="x390.html"><LINK
 
18
REL="NEXT"
 
19
TITLE="Widget Overview"
 
20
HREF="c451.html"></HEAD
 
21
><BODY
 
22
CLASS="SECT1"
 
23
BGCOLOR="#FFFFFF"
 
24
TEXT="#000000"
 
25
LINK="#0000FF"
 
26
VLINK="#840084"
 
27
ALINK="#0000FF"
 
28
><DIV
 
29
CLASS="NAVHEADER"
 
30
><TABLE
 
31
SUMMARY="Header navigation table"
 
32
WIDTH="100%"
 
33
BORDER="0"
 
34
CELLPADDING="0"
 
35
CELLSPACING="0"
 
36
><TR
 
37
><TH
 
38
COLSPAN="3"
 
39
ALIGN="center"
 
40
>GTK+ 2.0 Tutorial</TH
 
41
></TR
 
42
><TR
 
43
><TD
 
44
WIDTH="10%"
 
45
ALIGN="left"
 
46
VALIGN="bottom"
 
47
><A
 
48
HREF="x390.html"
 
49
ACCESSKEY="P"
 
50
>&#60;&#60;&#60; Previous</A
 
51
></TD
 
52
><TD
 
53
WIDTH="80%"
 
54
ALIGN="center"
 
55
VALIGN="bottom"
 
56
>Packing Widgets</TD
 
57
><TD
 
58
WIDTH="10%"
 
59
ALIGN="right"
 
60
VALIGN="bottom"
 
61
><A
 
62
HREF="c451.html"
 
63
ACCESSKEY="N"
 
64
>Next &#62;&#62;&#62;</A
 
65
></TD
 
66
></TR
 
67
></TABLE
 
68
><HR
 
69
ALIGN="LEFT"
 
70
WIDTH="100%"></DIV
 
71
><DIV
 
72
CLASS="SECT1"
 
73
><H1
 
74
CLASS="SECT1"
 
75
><A
 
76
NAME="SEC-TABLEPACKINGEXAMPLES"
 
77
>Table Packing Example</A
 
78
></H1
 
79
><P
 
80
>Here we make a window with three buttons in a 2x2 table.
 
81
The first two buttons will be placed in the upper row.
 
82
A third, quit button, is placed in the lower row, spanning both columns.
 
83
Which means it should look something like this:</P
 
84
><P
 
85
><SPAN
 
86
CLASS="INLINEMEDIAOBJECT"
 
87
><IMG
 
88
SRC="images/table.png"></SPAN
 
89
></P
 
90
><P
 
91
>Here's the source code:</P
 
92
><TABLE
 
93
BORDER="0"
 
94
BGCOLOR="#E0E0E0"
 
95
WIDTH="100%"
 
96
><TR
 
97
><TD
 
98
><PRE
 
99
CLASS="PROGRAMLISTING"
 
100
>&#13;#include &#60;gtk/gtk.h&#62;
 
101
 
 
102
/* Our callback.
 
103
 * The data passed to this function is printed to stdout */
 
104
static void callback( GtkWidget *widget,
 
105
                      gpointer   data )
 
106
{
 
107
    g_print ("Hello again - %s was pressed\n", (char *) data);
 
108
}
 
109
 
 
110
/* This callback quits the program */
 
111
static gboolean delete_event( GtkWidget *widget,
 
112
                              GdkEvent  *event,
 
113
                              gpointer   data )
 
114
{
 
115
    gtk_main_quit ();
 
116
    return FALSE;
 
117
}
 
118
 
 
119
int main( int   argc,
 
120
          char *argv[] )
 
121
{
 
122
    GtkWidget *window;
 
123
    GtkWidget *button;
 
124
    GtkWidget *table;
 
125
 
 
126
    gtk_init (&#38;argc, &#38;argv);
 
127
 
 
128
    /* Create a new window */
 
129
    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
 
130
 
 
131
    /* Set the window title */
 
132
    gtk_window_set_title (GTK_WINDOW (window), "Table");
 
133
 
 
134
    /* Set a handler for delete_event that immediately
 
135
     * exits GTK. */
 
136
    g_signal_connect (G_OBJECT (window), "delete_event",
 
137
                      G_CALLBACK (delete_event), NULL);
 
138
 
 
139
    /* Sets the border width of the window. */
 
140
    gtk_container_set_border_width (GTK_CONTAINER (window), 20);
 
141
 
 
142
    /* Create a 2x2 table */
 
143
    table = gtk_table_new (2, 2, TRUE);
 
144
 
 
145
    /* Put the table in the main window */
 
146
    gtk_container_add (GTK_CONTAINER (window), table);
 
147
 
 
148
    /* Create first button */
 
149
    button = gtk_button_new_with_label ("button 1");
 
150
 
 
151
    /* When the button is clicked, we call the "callback" function
 
152
     * with a pointer to "button 1" as its argument */
 
153
    g_signal_connect (G_OBJECT (button), "clicked",
 
154
                      G_CALLBACK (callback), (gpointer) "button 1");
 
155
 
 
156
 
 
157
    /* Insert button 1 into the upper left quadrant of the table */
 
158
    gtk_table_attach_defaults (GTK_TABLE (table), button, 0, 1, 0, 1);
 
159
 
 
160
    gtk_widget_show (button);
 
161
 
 
162
    /* Create second button */
 
163
 
 
164
    button = gtk_button_new_with_label ("button 2");
 
165
 
 
166
    /* When the button is clicked, we call the "callback" function
 
167
     * with a pointer to "button 2" as its argument */
 
168
    g_signal_connect (G_OBJECT (button), "clicked",
 
169
                      G_CALLBACK (callback), (gpointer) "button 2");
 
170
    /* Insert button 2 into the upper right quadrant of the table */
 
171
    gtk_table_attach_defaults (GTK_TABLE (table), button, 1, 2, 0, 1);
 
172
 
 
173
    gtk_widget_show (button);
 
174
 
 
175
    /* Create "Quit" button */
 
176
    button = gtk_button_new_with_label ("Quit");
 
177
 
 
178
    /* When the button is clicked, we call the "delete_event" function
 
179
     * and the program exits */
 
180
    g_signal_connect (G_OBJECT (button), "clicked",
 
181
                      G_CALLBACK (delete_event), NULL);
 
182
 
 
183
    /* Insert the quit button into the both 
 
184
     * lower quadrants of the table */
 
185
    gtk_table_attach_defaults (GTK_TABLE (table), button, 0, 2, 1, 2);
 
186
 
 
187
    gtk_widget_show (button);
 
188
 
 
189
    gtk_widget_show (table);
 
190
    gtk_widget_show (window);
 
191
 
 
192
    gtk_main ();
 
193
 
 
194
    return 0;
 
195
}</PRE
 
196
></TD
 
197
></TR
 
198
></TABLE
 
199
></DIV
 
200
><DIV
 
201
CLASS="NAVFOOTER"
 
202
><HR
 
203
ALIGN="LEFT"
 
204
WIDTH="100%"><TABLE
 
205
SUMMARY="Footer navigation table"
 
206
WIDTH="100%"
 
207
BORDER="0"
 
208
CELLPADDING="0"
 
209
CELLSPACING="0"
 
210
><TR
 
211
><TD
 
212
WIDTH="33%"
 
213
ALIGN="left"
 
214
VALIGN="top"
 
215
><A
 
216
HREF="x390.html"
 
217
ACCESSKEY="P"
 
218
>&#60;&#60;&#60; Previous</A
 
219
></TD
 
220
><TD
 
221
WIDTH="34%"
 
222
ALIGN="center"
 
223
VALIGN="top"
 
224
><A
 
225
HREF="book1.html"
 
226
ACCESSKEY="H"
 
227
>Home</A
 
228
></TD
 
229
><TD
 
230
WIDTH="33%"
 
231
ALIGN="right"
 
232
VALIGN="top"
 
233
><A
 
234
HREF="c451.html"
 
235
ACCESSKEY="N"
 
236
>Next &#62;&#62;&#62;</A
 
237
></TD
 
238
></TR
 
239
><TR
 
240
><TD
 
241
WIDTH="33%"
 
242
ALIGN="left"
 
243
VALIGN="top"
 
244
>Packing Using Tables</TD
 
245
><TD
 
246
WIDTH="34%"
 
247
ALIGN="center"
 
248
VALIGN="top"
 
249
><A
 
250
HREF="c355.html"
 
251
ACCESSKEY="U"
 
252
>Up</A
 
253
></TD
 
254
><TD
 
255
WIDTH="33%"
 
256
ALIGN="right"
 
257
VALIGN="top"
 
258
>Widget Overview</TD
 
259
></TR
 
260
></TABLE
 
261
></DIV
 
262
></BODY
 
263
></HTML
 
264
>
 
 
b'\\ No newline at end of file'