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

« back to all changes in this revision

Viewing changes to docs/tutorial/html/x1452.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
>Notebooks</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="Container Widgets"
 
14
HREF="c1228.html"><LINK
 
15
REL="PREVIOUS"
 
16
TITLE="Toolbar"
 
17
HREF="x1404.html"><LINK
 
18
REL="NEXT"
 
19
TITLE="Menu Widget"
 
20
HREF="c1501.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="x1404.html"
 
49
ACCESSKEY="P"
 
50
>&#60;&#60;&#60; Previous</A
 
51
></TD
 
52
><TD
 
53
WIDTH="80%"
 
54
ALIGN="center"
 
55
VALIGN="bottom"
 
56
>Container Widgets</TD
 
57
><TD
 
58
WIDTH="10%"
 
59
ALIGN="right"
 
60
VALIGN="bottom"
 
61
><A
 
62
HREF="c1501.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-NOTEBOOKS"
 
77
>Notebooks</A
 
78
></H1
 
79
><P
 
80
>The NoteBook Widget is a collection of "pages" that overlap each
 
81
other, each page contains different information with only one page
 
82
visible at a time. This widget has become more common lately in GUI
 
83
programming, and it is a good way to show blocks of similar
 
84
information that warrant separation in their display.</P
 
85
><P
 
86
>The first function call you will need to know, as you can probably
 
87
guess by now, is used to create a new notebook widget.</P
 
88
><TABLE
 
89
BORDER="0"
 
90
BGCOLOR="#E0E0E0"
 
91
WIDTH="100%"
 
92
><TR
 
93
><TD
 
94
><PRE
 
95
CLASS="PROGRAMLISTING"
 
96
>GtkWidget *gtk_notebook_new( void );</PRE
 
97
></TD
 
98
></TR
 
99
></TABLE
 
100
><P
 
101
>Once the notebook has been created, there are a number of functions
 
102
that operate on the notebook widget. Let's look at them individually.</P
 
103
><P
 
104
>The first one we will look at is how to position the page indicators.
 
105
These page indicators or "tabs" as they are referred to, can be
 
106
positioned in four ways: top, bottom, left, or right.</P
 
107
><TABLE
 
108
BORDER="0"
 
109
BGCOLOR="#E0E0E0"
 
110
WIDTH="100%"
 
111
><TR
 
112
><TD
 
113
><PRE
 
114
CLASS="PROGRAMLISTING"
 
115
>void gtk_notebook_set_tab_pos( GtkNotebook     *notebook,
 
116
                               GtkPositionType  pos );</PRE
 
117
></TD
 
118
></TR
 
119
></TABLE
 
120
><P
 
121
>GtkPositionType will be one of the following, which are pretty self
 
122
explanatory:</P
 
123
><TABLE
 
124
BORDER="0"
 
125
BGCOLOR="#E0E0E0"
 
126
WIDTH="100%"
 
127
><TR
 
128
><TD
 
129
><PRE
 
130
CLASS="PROGRAMLISTING"
 
131
>  GTK_POS_LEFT
 
132
  GTK_POS_RIGHT
 
133
  GTK_POS_TOP
 
134
  GTK_POS_BOTTOM</PRE
 
135
></TD
 
136
></TR
 
137
></TABLE
 
138
><P
 
139
><TT
 
140
CLASS="LITERAL"
 
141
>GTK_POS_TOP</TT
 
142
> is the default.</P
 
143
><P
 
144
>Next we will look at how to add pages to the notebook. There are three
 
145
ways to add pages to the NoteBook. Let's look at the first two
 
146
together as they are quite similar.</P
 
147
><TABLE
 
148
BORDER="0"
 
149
BGCOLOR="#E0E0E0"
 
150
WIDTH="100%"
 
151
><TR
 
152
><TD
 
153
><PRE
 
154
CLASS="PROGRAMLISTING"
 
155
>void gtk_notebook_append_page( GtkNotebook *notebook,
 
156
                               GtkWidget   *child,
 
157
                               GtkWidget   *tab_label );
 
158
 
 
159
void gtk_notebook_prepend_page( GtkNotebook *notebook,
 
160
                                GtkWidget   *child,
 
161
                                GtkWidget   *tab_label );</PRE
 
162
></TD
 
163
></TR
 
164
></TABLE
 
165
><P
 
166
>These functions add pages to the notebook by inserting them from the
 
167
back of the notebook (append), or the front of the notebook (prepend).
 
168
<TT
 
169
CLASS="LITERAL"
 
170
>child</TT
 
171
> is the widget that is placed within the notebook page, and
 
172
<TT
 
173
CLASS="LITERAL"
 
174
>tab_label</TT
 
175
> is the label for the page being added. The <TT
 
176
CLASS="LITERAL"
 
177
>child</TT
 
178
>
 
179
widget must be created separately, and is typically a set of options
 
180
setup witin one of the other container widgets, such as a table.</P
 
181
><P
 
182
>The final function for adding a page to the notebook contains all of
 
183
the properties of the previous two, but it allows you to specify what
 
184
position you want the page to be in the notebook.</P
 
185
><TABLE
 
186
BORDER="0"
 
187
BGCOLOR="#E0E0E0"
 
188
WIDTH="100%"
 
189
><TR
 
190
><TD
 
191
><PRE
 
192
CLASS="PROGRAMLISTING"
 
193
>void gtk_notebook_insert_page( GtkNotebook *notebook,
 
194
                               GtkWidget   *child,
 
195
                               GtkWidget   *tab_label,
 
196
                               gint         position );</PRE
 
197
></TD
 
198
></TR
 
199
></TABLE
 
200
><P
 
201
>The parameters are the same as _append_ and _prepend_ except it
 
202
contains an extra parameter, <TT
 
203
CLASS="LITERAL"
 
204
>position</TT
 
205
>.  This parameter is used to
 
206
specify what place this page will be inserted into the first page
 
207
having position zero.</P
 
208
><P
 
209
>Now that we know how to add a page, lets see how we can remove a page
 
210
from the notebook.</P
 
211
><TABLE
 
212
BORDER="0"
 
213
BGCOLOR="#E0E0E0"
 
214
WIDTH="100%"
 
215
><TR
 
216
><TD
 
217
><PRE
 
218
CLASS="PROGRAMLISTING"
 
219
>void gtk_notebook_remove_page( GtkNotebook *notebook,
 
220
                               gint         page_num );</PRE
 
221
></TD
 
222
></TR
 
223
></TABLE
 
224
><P
 
225
>This function takes the page specified by <TT
 
226
CLASS="LITERAL"
 
227
>page_num</TT
 
228
> and removes it
 
229
from the widget pointed to by <TT
 
230
CLASS="LITERAL"
 
231
>notebook</TT
 
232
>.</P
 
233
><P
 
234
>To find out what the current page is in a notebook use the function:</P
 
235
><TABLE
 
236
BORDER="0"
 
237
BGCOLOR="#E0E0E0"
 
238
WIDTH="100%"
 
239
><TR
 
240
><TD
 
241
><PRE
 
242
CLASS="PROGRAMLISTING"
 
243
>gint gtk_notebook_get_current_page( GtkNotebook *notebook );</PRE
 
244
></TD
 
245
></TR
 
246
></TABLE
 
247
><P
 
248
>These next two functions are simple calls to move the notebook page
 
249
forward or backward. Simply provide the respective function call with
 
250
the notebook widget you wish to operate on. Note: When the NoteBook is
 
251
currently on the last page, and gtk_notebook_next_page() is called, the
 
252
notebook will wrap back to the first page. Likewise, if the NoteBook
 
253
is on the first page, and gtk_notebook_prev_page() is called, the
 
254
notebook will wrap to the last page.</P
 
255
><TABLE
 
256
BORDER="0"
 
257
BGCOLOR="#E0E0E0"
 
258
WIDTH="100%"
 
259
><TR
 
260
><TD
 
261
><PRE
 
262
CLASS="PROGRAMLISTING"
 
263
>void gtk_notebook_next_page( GtkNoteBook *notebook );
 
264
 
 
265
void gtk_notebook_prev_page( GtkNoteBook *notebook );</PRE
 
266
></TD
 
267
></TR
 
268
></TABLE
 
269
><P
 
270
>This next function sets the "active" page. If you wish the notebook to
 
271
be opened to page 5 for example, you would use this function.  Without
 
272
using this function, the notebook defaults to the first page.</P
 
273
><TABLE
 
274
BORDER="0"
 
275
BGCOLOR="#E0E0E0"
 
276
WIDTH="100%"
 
277
><TR
 
278
><TD
 
279
><PRE
 
280
CLASS="PROGRAMLISTING"
 
281
>void gtk_notebook_set_current_page( GtkNotebook *notebook,
 
282
                                    gint         page_num );</PRE
 
283
></TD
 
284
></TR
 
285
></TABLE
 
286
><P
 
287
>The next two functions add or remove the notebook page tabs and the
 
288
notebook border respectively.</P
 
289
><TABLE
 
290
BORDER="0"
 
291
BGCOLOR="#E0E0E0"
 
292
WIDTH="100%"
 
293
><TR
 
294
><TD
 
295
><PRE
 
296
CLASS="PROGRAMLISTING"
 
297
>void gtk_notebook_set_show_tabs( GtkNotebook *notebook,
 
298
                                 gboolean     show_tabs );
 
299
 
 
300
void gtk_notebook_set_show_border( GtkNotebook *notebook,
 
301
                                   gboolean     show_border );</PRE
 
302
></TD
 
303
></TR
 
304
></TABLE
 
305
><P
 
306
>The next function is useful when the you have a large number of pages,
 
307
and the tabs don't fit on the page. It allows the tabs to be scrolled
 
308
through using two arrow buttons.</P
 
309
><TABLE
 
310
BORDER="0"
 
311
BGCOLOR="#E0E0E0"
 
312
WIDTH="100%"
 
313
><TR
 
314
><TD
 
315
><PRE
 
316
CLASS="PROGRAMLISTING"
 
317
>void gtk_notebook_set_scrollable( GtkNotebook *notebook,
 
318
                                  gboolean     scrollable );</PRE
 
319
></TD
 
320
></TR
 
321
></TABLE
 
322
><P
 
323
><TT
 
324
CLASS="LITERAL"
 
325
>show_tabs</TT
 
326
>, <TT
 
327
CLASS="LITERAL"
 
328
>show_border</TT
 
329
> and <TT
 
330
CLASS="LITERAL"
 
331
>scrollable</TT
 
332
> can be either
 
333
TRUE or FALSE.</P
 
334
><P
 
335
>Now let's look at an example, it is expanded from the 
 
336
<TT
 
337
CLASS="FILENAME"
 
338
>testgtk.c</TT
 
339
> code
 
340
that comes with the GTK distribution. This small program creates a
 
341
window with a notebook and six buttons. The notebook contains 11
 
342
pages, added in three different ways, appended, inserted, and
 
343
prepended. The buttons allow you rotate the tab positions, add/remove
 
344
the tabs and border, remove a page, change pages in both a forward and
 
345
backward manner, and exit the program.</P
 
346
><P
 
347
><SPAN
 
348
CLASS="INLINEMEDIAOBJECT"
 
349
><IMG
 
350
SRC="images/notebook.png"></SPAN
 
351
></P
 
352
><TABLE
 
353
BORDER="0"
 
354
BGCOLOR="#E0E0E0"
 
355
WIDTH="100%"
 
356
><TR
 
357
><TD
 
358
><PRE
 
359
CLASS="PROGRAMLISTING"
 
360
>&#13;#include &#60;stdio.h&#62;
 
361
#include &#60;gtk/gtk.h&#62;
 
362
 
 
363
/* This function rotates the position of the tabs */
 
364
static void rotate_book( GtkButton   *button,
 
365
                         GtkNotebook *notebook )
 
366
{
 
367
    gtk_notebook_set_tab_pos (notebook, (notebook-&#62;tab_pos + 1) % 4);
 
368
}
 
369
 
 
370
/* Add/Remove the page tabs and the borders */
 
371
static void tabsborder_book( GtkButton   *button,
 
372
                             GtkNotebook *notebook )
 
373
{
 
374
    gint tval = FALSE;
 
375
    gint bval = FALSE;
 
376
    if (notebook-&#62;show_tabs == 0)
 
377
            tval = TRUE; 
 
378
    if (notebook-&#62;show_border == 0)
 
379
            bval = TRUE;
 
380
    
 
381
    gtk_notebook_set_show_tabs (notebook, tval);
 
382
    gtk_notebook_set_show_border (notebook, bval);
 
383
}
 
384
 
 
385
/* Remove a page from the notebook */
 
386
static void remove_book( GtkButton   *button,
 
387
                         GtkNotebook *notebook )
 
388
{
 
389
    gint page;
 
390
    
 
391
    page = gtk_notebook_get_current_page (notebook);
 
392
    gtk_notebook_remove_page (notebook, page);
 
393
    /* Need to refresh the widget -- 
 
394
     This forces the widget to redraw itself. */
 
395
    gtk_widget_queue_draw (GTK_WIDGET (notebook));
 
396
}
 
397
 
 
398
static gboolean delete( GtkWidget *widget,
 
399
                        GtkWidget *event,
 
400
                        gpointer   data )
 
401
{
 
402
    gtk_main_quit ();
 
403
    return FALSE;
 
404
}
 
405
 
 
406
int main( int argc,
 
407
          char *argv[] )
 
408
{
 
409
    GtkWidget *window;
 
410
    GtkWidget *button;
 
411
    GtkWidget *table;
 
412
    GtkWidget *notebook;
 
413
    GtkWidget *frame;
 
414
    GtkWidget *label;
 
415
    GtkWidget *checkbutton;
 
416
    int i;
 
417
    char bufferf[32];
 
418
    char bufferl[32];
 
419
    
 
420
    gtk_init (&#38;argc, &#38;argv);
 
421
    
 
422
    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
 
423
    
 
424
    g_signal_connect (G_OBJECT (window), "delete_event",
 
425
                      G_CALLBACK (delete), NULL);
 
426
    
 
427
    gtk_container_set_border_width (GTK_CONTAINER (window), 10);
 
428
 
 
429
    table = gtk_table_new (3, 6, FALSE);
 
430
    gtk_container_add (GTK_CONTAINER (window), table);
 
431
    
 
432
    /* Create a new notebook, place the position of the tabs */
 
433
    notebook = gtk_notebook_new ();
 
434
    gtk_notebook_set_tab_pos (GTK_NOTEBOOK (notebook), GTK_POS_TOP);
 
435
    gtk_table_attach_defaults (GTK_TABLE (table), notebook, 0, 6, 0, 1);
 
436
    gtk_widget_show (notebook);
 
437
    
 
438
    /* Let's append a bunch of pages to the notebook */
 
439
    for (i = 0; i &#60; 5; i++) {
 
440
        sprintf(bufferf, "Append Frame %d", i + 1);
 
441
        sprintf(bufferl, "Page %d", i + 1);
 
442
        
 
443
        frame = gtk_frame_new (bufferf);
 
444
        gtk_container_set_border_width (GTK_CONTAINER (frame), 10);
 
445
        gtk_widget_set_size_request (frame, 100, 75);
 
446
        gtk_widget_show (frame);
 
447
        
 
448
        label = gtk_label_new (bufferf);
 
449
        gtk_container_add (GTK_CONTAINER (frame), label);
 
450
        gtk_widget_show (label);
 
451
        
 
452
        label = gtk_label_new (bufferl);
 
453
        gtk_notebook_append_page (GTK_NOTEBOOK (notebook), frame, label);
 
454
    }
 
455
      
 
456
    /* Now let's add a page to a specific spot */
 
457
    checkbutton = gtk_check_button_new_with_label ("Check me please!");
 
458
    gtk_widget_set_size_request (checkbutton, 100, 75);
 
459
    gtk_widget_show (checkbutton);
 
460
   
 
461
    label = gtk_label_new ("Add page");
 
462
    gtk_notebook_insert_page (GTK_NOTEBOOK (notebook), checkbutton, label, 2);
 
463
    
 
464
    /* Now finally let's prepend pages to the notebook */
 
465
    for (i = 0; i &#60; 5; i++) {
 
466
        sprintf (bufferf, "Prepend Frame %d", i + 1);
 
467
        sprintf (bufferl, "PPage %d", i + 1);
 
468
        
 
469
        frame = gtk_frame_new (bufferf);
 
470
        gtk_container_set_border_width (GTK_CONTAINER (frame), 10);
 
471
        gtk_widget_set_size_request (frame, 100, 75);
 
472
        gtk_widget_show (frame);
 
473
        
 
474
        label = gtk_label_new (bufferf);
 
475
        gtk_container_add (GTK_CONTAINER (frame), label);
 
476
        gtk_widget_show (label);
 
477
        
 
478
        label = gtk_label_new (bufferl);
 
479
        gtk_notebook_prepend_page (GTK_NOTEBOOK (notebook), frame, label);
 
480
    }
 
481
    
 
482
    /* Set what page to start at (page 4) */
 
483
    gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 3);
 
484
 
 
485
    /* Create a bunch of buttons */
 
486
    button = gtk_button_new_with_label ("close");
 
487
    g_signal_connect_swapped (G_OBJECT (button), "clicked",
 
488
                              G_CALLBACK (delete), NULL);
 
489
    gtk_table_attach_defaults (GTK_TABLE (table), button, 0, 1, 1, 2);
 
490
    gtk_widget_show (button);
 
491
    
 
492
    button = gtk_button_new_with_label ("next page");
 
493
    g_signal_connect_swapped (G_OBJECT (button), "clicked",
 
494
                              G_CALLBACK (gtk_notebook_next_page),
 
495
                              G_OBJECT (notebook));
 
496
    gtk_table_attach_defaults (GTK_TABLE (table), button, 1, 2, 1, 2);
 
497
    gtk_widget_show (button);
 
498
    
 
499
    button = gtk_button_new_with_label ("prev page");
 
500
    g_signal_connect_swapped (G_OBJECT (button), "clicked",
 
501
                              G_CALLBACK (gtk_notebook_prev_page),
 
502
                              G_OBJECT (notebook));
 
503
    gtk_table_attach_defaults (GTK_TABLE (table), button, 2, 3, 1, 2);
 
504
    gtk_widget_show (button);
 
505
    
 
506
    button = gtk_button_new_with_label ("tab position");
 
507
    g_signal_connect (G_OBJECT (button), "clicked",
 
508
                      G_CALLBACK (rotate_book),
 
509
                      (gpointer) notebook);
 
510
    gtk_table_attach_defaults (GTK_TABLE (table), button, 3, 4, 1, 2);
 
511
    gtk_widget_show (button);
 
512
    
 
513
    button = gtk_button_new_with_label ("tabs/border on/off");
 
514
    g_signal_connect (G_OBJECT (button), "clicked",
 
515
                      G_CALLBACK (tabsborder_book),
 
516
                      (gpointer) notebook);
 
517
    gtk_table_attach_defaults (GTK_TABLE (table), button, 4, 5, 1, 2);
 
518
    gtk_widget_show (button);
 
519
    
 
520
    button = gtk_button_new_with_label ("remove page");
 
521
    g_signal_connect (G_OBJECT (button), "clicked",
 
522
                      G_CALLBACK (remove_book),
 
523
                      (gpointer) notebook);
 
524
    gtk_table_attach_defaults (GTK_TABLE (table), button, 5, 6, 1, 2);
 
525
    gtk_widget_show (button);
 
526
    
 
527
    gtk_widget_show (table);
 
528
    gtk_widget_show (window);
 
529
    
 
530
    gtk_main ();
 
531
    
 
532
    return 0;
 
533
}</PRE
 
534
></TD
 
535
></TR
 
536
></TABLE
 
537
><P
 
538
>I hope this helps you on your way with creating notebooks for your
 
539
GTK applications.</P
 
540
></DIV
 
541
><DIV
 
542
CLASS="NAVFOOTER"
 
543
><HR
 
544
ALIGN="LEFT"
 
545
WIDTH="100%"><TABLE
 
546
SUMMARY="Footer navigation table"
 
547
WIDTH="100%"
 
548
BORDER="0"
 
549
CELLPADDING="0"
 
550
CELLSPACING="0"
 
551
><TR
 
552
><TD
 
553
WIDTH="33%"
 
554
ALIGN="left"
 
555
VALIGN="top"
 
556
><A
 
557
HREF="x1404.html"
 
558
ACCESSKEY="P"
 
559
>&#60;&#60;&#60; Previous</A
 
560
></TD
 
561
><TD
 
562
WIDTH="34%"
 
563
ALIGN="center"
 
564
VALIGN="top"
 
565
><A
 
566
HREF="book1.html"
 
567
ACCESSKEY="H"
 
568
>Home</A
 
569
></TD
 
570
><TD
 
571
WIDTH="33%"
 
572
ALIGN="right"
 
573
VALIGN="top"
 
574
><A
 
575
HREF="c1501.html"
 
576
ACCESSKEY="N"
 
577
>Next &#62;&#62;&#62;</A
 
578
></TD
 
579
></TR
 
580
><TR
 
581
><TD
 
582
WIDTH="33%"
 
583
ALIGN="left"
 
584
VALIGN="top"
 
585
>Toolbar</TD
 
586
><TD
 
587
WIDTH="34%"
 
588
ALIGN="center"
 
589
VALIGN="top"
 
590
><A
 
591
HREF="c1228.html"
 
592
ACCESSKEY="U"
 
593
>Up</A
 
594
></TD
 
595
><TD
 
596
WIDTH="33%"
 
597
ALIGN="right"
 
598
VALIGN="top"
 
599
>Menu Widget</TD
 
600
></TR
 
601
></TABLE
 
602
></DIV
 
603
></BODY
 
604
></HTML
 
605
>
 
 
b'\\ No newline at end of file'