File: gtk-notebook.adb

package info (click to toggle)
libgtkada2 2.8.1-5
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 13,488 kB
  • ctags: 3,888
  • sloc: ada: 103,189; ansic: 45,411; perl: 5,500; sh: 2,812; makefile: 1,146; xml: 19
file content (798 lines) | stat: -rw-r--r-- 23,838 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
-----------------------------------------------------------------------
--               GtkAda - Ada95 binding for Gtk+/Gnome               --
--                                                                   --
--   Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet   --
--                Copyright (C) 2000-2006 AdaCore                    --
--                                                                   --
-- This library is free software; you can redistribute it and/or     --
-- modify it under the terms of the GNU General Public               --
-- License as published by the Free Software Foundation; either      --
-- version 2 of the License, or (at your option) any later version.  --
--                                                                   --
-- This library is distributed in the hope that it will be useful,   --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of    --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU --
-- General Public License for more details.                          --
--                                                                   --
-- You should have received a copy of the GNU General Public         --
-- License along with this library; if not, write to the             --
-- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      --
-- Boston, MA 02111-1307, USA.                                       --
--                                                                   --
-----------------------------------------------------------------------

with Gtk.Container;        use Gtk.Container;
with Gtk.Widget;           use Gtk.Widget;
with Gtk.Enums;            use Gtk.Enums;
with Interfaces.C.Strings; use Interfaces.C.Strings;
with System;

package body Gtk.Notebook is

   -----------------
   -- Append_Page --
   -----------------

   procedure Append_Page
     (Notebook  : access Gtk_Notebook_Record;
      Child     : access Gtk.Widget.Gtk_Widget_Record'Class;
      Tab_Label : access Gtk.Widget.Gtk_Widget_Record'Class)
   is
      procedure Internal
        (Notebook  : System.Address;
         Child     : System.Address;
         Tab_Label : System.Address);
      pragma Import (C, Internal, "gtk_notebook_append_page");

   begin
      Internal (Get_Object (Notebook),
                Get_Object (Child),
                Get_Object (Tab_Label));
   end Append_Page;

   -----------------
   -- Append_Page --
   -----------------

   procedure Append_Page
     (Notebook  : access Gtk_Notebook_Record;
      Child     : access Gtk.Widget.Gtk_Widget_Record'Class)
   is
      procedure Internal
        (Notebook  : System.Address;
         Child     : System.Address;
         Tab_Label : System.Address := System.Null_Address);
      pragma Import (C, Internal, "gtk_notebook_append_page");

   begin
      Internal (Get_Object (Notebook), Get_Object (Child));
   end Append_Page;

   ----------------------
   -- Append_Page_Menu --
   ----------------------

   procedure Append_Page_Menu
     (Notebook   : access Gtk_Notebook_Record;
      Child      : access Gtk.Widget.Gtk_Widget_Record'Class;
      Tab_Label  : access Gtk.Widget.Gtk_Widget_Record'Class;
      Menu_Label : access Gtk.Widget.Gtk_Widget_Record'Class)
   is
      procedure Internal
        (Notebook   : System.Address;
         Child      : System.Address;
         Tab_Label  : System.Address;
         Menu_Label : System.Address);
      pragma Import (C, Internal, "gtk_notebook_append_page_menu");

   begin
      Internal (Get_Object (Notebook),
                Get_Object (Child),
                Get_Object (Tab_Label),
                Get_Object (Menu_Label));
   end Append_Page_Menu;

   ----------------------
   -- Get_Current_Page --
   ----------------------

   function Get_Current_Page
     (Notebook : access Gtk_Notebook_Record) return Gint
   is
      function Internal (Notebook : System.Address) return Gint;
      pragma Import (C, Internal, "gtk_notebook_get_current_page");

   begin
      return Internal (Get_Object (Notebook));
   end Get_Current_Page;

   ------------------
   -- Get_Children --
   ------------------

   function Get_Children
     (Widget : access Gtk_Notebook_Record) return Page_List.Glist
   is
      function Internal (Widget : System.Address) return System.Address;
      pragma Import (C, Internal, "ada_notebook_get_children");

      use Page_List;
      List : Page_List.Glist;

   begin
      Set_Object (List, Internal (Get_Object (Widget)));
      return List;
   end Get_Children;

   --------------------
   -- Get_Menu_Label --
   --------------------

   function Get_Menu_Label
     (Notebook : access Gtk_Notebook_Record;
      Child    : access Gtk.Widget.Gtk_Widget_Record'Class)
      return Gtk.Widget.Gtk_Widget
   is
      function Internal
        (Notebook : System.Address;
         Child    : System.Address) return System.Address;
      pragma Import (C, Internal, "gtk_notebook_get_menu_label");

   begin
      return Convert (Internal (Get_Object (Notebook), Get_Object (Child)));
   end Get_Menu_Label;

   -------------------------
   -- Get_Menu_Label_Text --
   -------------------------

   function Get_Menu_Label_Text
     (Notebook : access Gtk_Notebook_Record;
      Child    : access Gtk.Widget.Gtk_Widget_Record'Class) return UTF8_String
   is
      function Internal
        (Widget : System.Address;
         Child  : System.Address) return chars_ptr;
      pragma Import (C, Internal, "gtk_notebook_get_menu_label_text");

   begin
      return Value (Internal (Get_Object (Notebook), Get_Object (Child)));
   end Get_Menu_Label_Text;

   ---------------------
   -- Get_Show_Border --
   ---------------------

   function Get_Show_Border
     (Notebook : access Gtk_Notebook_Record) return Boolean
   is
      function Internal
        (Notebook : System.Address) return Gboolean;
      pragma Import (C, Internal, "gtk_notebook_get_show_border");

   begin
      return Internal (Get_Object (Notebook)) /= 0;
   end Get_Show_Border;

   -------------------
   -- Get_Show_Tabs --
   -------------------

   function Get_Show_Tabs
     (Notebook : access Gtk_Notebook_Record) return Boolean
   is
      function Internal
        (Notebook : System.Address) return Gboolean;
      pragma Import (C, Internal, "gtk_notebook_get_show_tabs");

   begin
      return Internal (Get_Object (Notebook)) /= 0;
   end Get_Show_Tabs;

   --------------------
   -- Get_Scrollable --
   --------------------

   function Get_Scrollable
     (Notebook : access Gtk_Notebook_Record) return Boolean
   is
      function Internal
        (Notebook : System.Address) return Gboolean;
      pragma Import (C, Internal, "gtk_notebook_get_scrollable");

   begin
      return Internal (Get_Object (Notebook)) /= 0;
   end Get_Scrollable;

   -------------------
   -- Get_Tab_Label --
   -------------------

   function Get_Tab_Label
     (Notebook  : access Gtk_Notebook_Record;
      Child     : access Gtk.Widget.Gtk_Widget_Record'Class)
      return Gtk.Widget.Gtk_Widget
   is
      function Internal
        (Widget : System.Address;
         Child  : System.Address) return System.Address;
      pragma Import (C, Internal, "gtk_notebook_get_tab_label");

   begin
      return Convert (Internal (Get_Object (Notebook), Get_Object (Child)));
   end Get_Tab_Label;

   ------------------------
   -- Get_Tab_Label_Text --
   ------------------------

   function Get_Tab_Label_Text
     (Notebook : access Gtk_Notebook_Record;
      Child    : access Gtk.Widget.Gtk_Widget_Record'Class) return UTF8_String
   is
      function Internal
        (Widget : System.Address;
         Child  : System.Address) return chars_ptr;
      pragma Import (C, Internal, "gtk_notebook_get_tab_label_text");

   begin
      return Value (Internal (Get_Object (Notebook), Get_Object (Child)));
   end Get_Tab_Label_Text;

   -----------------
   -- Get_Tab_Pos --
   -----------------

   function Get_Tab_Pos
     (Widget : access Gtk_Notebook_Record) return Gtk_Position_Type
   is
      function Internal (Widget : System.Address) return Gtk_Position_Type;
      pragma Import (C, Internal, "gtk_notebook_get_tab_pos");

   begin
      return Internal (Get_Object (Widget));
   end Get_Tab_Pos;

   ------------------
   -- Get_Nth_Page --
   ------------------

   function Get_Nth_Page
     (Widget   : access Gtk_Notebook_Record'Class;
      Page_Num : Gint) return Gtk.Widget.Gtk_Widget
   is
      function Internal
        (Widget : System.Address; Page_Num : Gint) return System.Address;
      pragma Import (C, Internal, "gtk_notebook_get_nth_page");

   begin
      return Convert (Internal (Get_Object (Widget), Page_Num));
   end Get_Nth_Page;

   --------------
   -- Page_Num --
   --------------

   function Page_Num
     (Widget : access Gtk_Notebook_Record'Class;
      Child  : access Gtk_Widget_Record'Class) return Gint
   is
      function Internal
        (Widget : System.Address; Child : System.Address) return Gint;
      pragma Import (C, Internal, "gtk_notebook_page_num");

   begin
      return Internal (Get_Object (Widget), Get_Object (Child));
   end Page_Num;

   -------------
   -- Gtk_New --
   -------------

   procedure Gtk_New (Widget : out Gtk_Notebook) is
   begin
      Widget := new Gtk_Notebook_Record;
      Gtk.Notebook.Initialize (Widget);
   end Gtk_New;

   ----------------
   -- Initialize --
   ----------------

   procedure Initialize (Widget : access Gtk_Notebook_Record'Class) is
      function Internal return System.Address;
      pragma Import (C, Internal, "gtk_notebook_new");

   begin
      Set_Object (Widget, Internal);
   end Initialize;

   -----------------
   -- Insert_Page --
   -----------------

   procedure Insert_Page
     (Notebook  : access Gtk_Notebook_Record;
      Child     : access Gtk.Widget.Gtk_Widget_Record'Class;
      Tab_Label : access Gtk.Widget.Gtk_Widget_Record'Class;
      Position  : Gint)
   is
      procedure Internal
        (Notebook  : System.Address;
         Child     : System.Address;
         Tab_Label : System.Address;
         Position  : Gint);
      pragma Import (C, Internal, "gtk_notebook_insert_page");

   begin
      Internal (Get_Object (Notebook),
                Get_Object (Child),
                Get_Object (Tab_Label),
                Position);
   end Insert_Page;

   ----------------------
   -- Insert_Page_Menu --
   ----------------------

   procedure Insert_Page_Menu
     (Notebook   : access Gtk_Notebook_Record;
      Child      : access Gtk.Widget.Gtk_Widget_Record'Class;
      Tab_Label  : access Gtk.Widget.Gtk_Widget_Record'Class;
      Menu_Label : access Gtk.Widget.Gtk_Widget_Record'Class;
      Position   : Gint)
   is
      procedure Internal
        (Notebook   : System.Address;
         Child      : System.Address;
         Tab_Label  : System.Address;
         Menu_Label : System.Address;
         Position   : Gint);
      pragma Import (C, Internal, "gtk_notebook_insert_page_menu");

   begin
      Internal (Get_Object (Notebook),
                Get_Object (Child),
                Get_Object (Tab_Label),
                Get_Object (Menu_Label),
                Position);
   end Insert_Page_Menu;

   ---------------
   -- Next_Page --
   ---------------

   procedure Next_Page (Notebook : access Gtk_Notebook_Record) is
      procedure Internal (Notebook : System.Address);
      pragma Import (C, Internal, "gtk_notebook_next_page");

   begin
      Internal (Get_Object (Notebook));
   end Next_Page;

   -------------------
   -- Popup_Disable --
   -------------------

   procedure Popup_Disable (Notebook : access Gtk_Notebook_Record) is
      procedure Internal (Notebook : System.Address);
      pragma Import (C, Internal, "gtk_notebook_popup_disable");

   begin
      Internal (Get_Object (Notebook));
   end Popup_Disable;

   ------------------
   -- Popup_Enable --
   ------------------

   procedure Popup_Enable (Notebook : access Gtk_Notebook_Record) is
      procedure Internal (Notebook : System.Address);
      pragma Import (C, Internal, "gtk_notebook_popup_enable");

   begin
      Internal (Get_Object (Notebook));
   end Popup_Enable;

   ------------------
   -- Prepend_Page --
   ------------------

   procedure Prepend_Page
     (Notebook  : access Gtk_Notebook_Record;
      Child     : access Gtk.Widget.Gtk_Widget_Record'Class;
      Tab_Label : access Gtk.Widget.Gtk_Widget_Record'Class)
   is
      procedure Internal
        (Notebook  : System.Address;
         Child     : System.Address;
         Tab_Label : System.Address);
      pragma Import (C, Internal, "gtk_notebook_prepend_page");

   begin
      Internal (Get_Object (Notebook),
                Get_Object (Child),
                Get_Object (Tab_Label));
   end Prepend_Page;

   -----------------------
   -- Prepend_Page_Menu --
   -----------------------

   procedure Prepend_Page_Menu
     (Notebook   : access Gtk_Notebook_Record;
      Child      : access Gtk.Widget.Gtk_Widget_Record'Class;
      Tab_Label  : access Gtk.Widget.Gtk_Widget_Record'Class;
      Menu_Label : access Gtk.Widget.Gtk_Widget_Record'Class)
   is
      procedure Internal
        (Notebook   : System.Address;
         Child      : System.Address;
         Tab_Label  : System.Address;
         Menu_Label : System.Address);
      pragma Import (C, Internal, "gtk_notebook_prepend_page_menu");

   begin
      Internal (Get_Object (Notebook),
                Get_Object (Child),
                Get_Object (Tab_Label),
                Get_Object (Menu_Label));
   end Prepend_Page_Menu;

   ---------------
   -- Prev_Page --
   ---------------

   procedure Prev_Page (Notebook : access Gtk_Notebook_Record) is
      procedure Internal (Notebook : System.Address);
      pragma Import (C, Internal, "gtk_notebook_prev_page");

   begin
      Internal (Get_Object (Notebook));
   end Prev_Page;

   -----------------------------
   -- Query_Tab_Label_Packing --
   -----------------------------

   procedure Query_Tab_Label_Packing
     (Notebook   : access Gtk_Notebook_Record;
      Child      : access Gtk.Widget.Gtk_Widget_Record'Class;
      Expand     : out Boolean;
      Fill       : out Boolean;
      Pack_Type  : out Gtk_Pack_Type)
   is
      procedure Internal
        (Notebook  : System.Address;
         Child     : System.Address;
         Expand    : out Gint;
         Fill      : out Gint;
         Pack_Type : out Gint);
      pragma Import (C, Internal, "gtk_notebook_query_tab_label_packing");

      Expand_Ptr : Gint;
      Fill_Ptr   : Gint;
      Pack_Ptr   : Gint;

   begin
      Internal (Get_Object (Notebook), Get_Object (Child),
                Expand_Ptr, Fill_Ptr, Pack_Ptr);
      Expand := Expand_Ptr /= 0;
      Fill   := Fill_Ptr /= 0;
      Pack_Type := Gtk_Pack_Type'Val (Pack_Ptr);
   end Query_Tab_Label_Packing;

   -----------------
   -- Remove_Page --
   -----------------

   procedure Remove_Page
     (Notebook : access Gtk_Notebook_Record; Page_Num : Gint)
   is
      procedure Internal (Notebook : System.Address; Page_Num : Gint);
      pragma Import (C, Internal, "gtk_notebook_remove_page");

   begin
      Internal (Get_Object (Notebook), Page_Num);
   end Remove_Page;

   --------------------------
   -- Set_Homogeneous_Tabs --
   --------------------------

   procedure Set_Homogeneous_Tabs
     (Notebook    : access Gtk_Notebook_Record;
      Homogeneous : Boolean := True)
   is
      procedure Internal (Notebook : System.Address; Homogeneous : Gint);
      pragma Import (C, Internal, "gtk_notebook_set_homogeneous_tabs");

   begin
      Internal (Get_Object (Notebook), Boolean'Pos (Homogeneous));
   end Set_Homogeneous_Tabs;

   ----------------------
   -- Set_Current_Page --
   ----------------------

   procedure Set_Current_Page
     (Notebook : access Gtk_Notebook_Record; Page_Num : Gint := -1)
   is
      procedure Internal (Notebook : System.Address; Page_Num : Gint);
      pragma Import (C, Internal, "gtk_notebook_set_current_page");

   begin
      Internal (Get_Object (Notebook), Page_Num);
   end Set_Current_Page;

   --------------------
   -- Set_Scrollable --
   --------------------

   procedure Set_Scrollable
     (Notebook   : access Gtk_Notebook_Record;
      Scrollable : Boolean := True)
   is
      procedure Internal (Notebook : System.Address; Scrollable : Gint);
      pragma Import (C, Internal, "gtk_notebook_set_scrollable");

   begin
      Internal (Get_Object (Notebook), Boolean'Pos (Scrollable));
   end Set_Scrollable;

   ---------------------
   -- Set_Show_Border --
   ---------------------

   procedure Set_Show_Border
     (Notebook    : access Gtk_Notebook_Record;
      Show_Border : Boolean := True)
   is
      procedure Internal (Notebook : System.Address; Show_Border : Gint);
      pragma Import (C, Internal, "gtk_notebook_set_show_border");

   begin
      Internal (Get_Object (Notebook), Boolean'Pos (Show_Border));
   end Set_Show_Border;

   ---------------------------
   -- Set_Tab_Label_Packing --
   ---------------------------

   procedure Set_Tab_Label_Packing
     (Notebook  : access Gtk_Notebook_Record;
      Child     : access Gtk.Widget.Gtk_Widget_Record'Class;
      Expand    : Boolean;
      Fill      : Boolean;
      Pack_Type : Gtk_Pack_Type)
   is
      procedure Internal
        (Notebook  : System.Address;
         Child     : System.Address;
         Expand    : Gint;
         Fill      : Gint;
         Pack_Type : Gtk_Pack_Type);
      pragma Import (C, Internal, "gtk_notebook_set_tab_label_packing");

   begin
      Internal
        (Get_Object (Notebook),
         Get_Object (Child),
         Boolean'Pos (Expand),
         Boolean'Pos (Fill),
         Pack_Type);
   end Set_Tab_Label_Packing;

   -------------------
   -- Set_Show_Tabs --
   -------------------

   procedure Set_Show_Tabs
     (Notebook  : access Gtk_Notebook_Record;
      Show_Tabs : Boolean := True)
   is
      procedure Internal (Notebook : System.Address; Show_Tabs : Gint);
      pragma Import (C, Internal, "gtk_notebook_set_show_tabs");

   begin
      Internal (Get_Object (Notebook), Boolean'Pos (Show_Tabs));
   end Set_Show_Tabs;

   -------------
   -- Set_Tab --
   -------------

   procedure Set_Tab
     (Notebook  : access Gtk_Notebook_Record;
      Page_Num  : Gint;
      Tab_Label : access Gtk.Widget.Gtk_Widget_Record'Class)
   is
      Page : Gtk_Widget;
   begin
      Page := Get_Nth_Page (Notebook, Page_Num);

      if Page /= null then
         Set_Tab_Label (Notebook, Page, Tab_Label);
      end if;
   end Set_Tab;

   --------------------
   -- Set_Tab_Border --
   --------------------

   procedure Set_Tab_Border
     (Notebook : access Gtk_Notebook_Record; Border_Width : Gint)
   is
      procedure Internal (Notebook : System.Address; Border_Width : Gint);
      pragma Import (C, Internal, "gtk_notebook_set_tab_border");

   begin
      Internal (Get_Object (Notebook), Border_Width);
   end Set_Tab_Border;

   ---------------------
   -- Set_Tab_Hborder --
   ---------------------

   procedure Set_Tab_Hborder
     (Notebook : access Gtk_Notebook_Record; Border_Width : Gint)
   is
      procedure Internal (Notebook : System.Address; Border_Width : Gint);
      pragma Import (C, Internal, "gtk_notebook_set_tab_hborder");

   begin
      Internal (Get_Object (Notebook), Border_Width);
   end Set_Tab_Hborder;

   --------------------
   -- Set_Tab_Border --
   --------------------

   procedure Set_Tab_Vborder
     (Notebook : access Gtk_Notebook_Record; Border_Width : Gint)
   is
      procedure Internal (Notebook : System.Address; Border_Width : Gint);
      pragma Import (C, Internal, "gtk_notebook_set_tab_vborder");

   begin
      Internal (Get_Object (Notebook), Border_Width);
   end Set_Tab_Vborder;

   -----------------
   -- Set_Tab_Pos --
   -----------------

   procedure Set_Tab_Pos
     (Notebook : access Gtk_Notebook_Record; Pos : Gtk_Position_Type)
   is
      procedure Internal (Notebook : System.Address; Pos : Gtk_Position_Type);
      pragma Import (C, Internal, "gtk_notebook_set_tab_pos");

   begin
      Internal (Get_Object (Notebook), Pos);
   end Set_Tab_Pos;

   -------------------
   -- Set_Tab_Label --
   -------------------

   procedure Set_Tab_Label
     (Notebook  : access Gtk_Notebook_Record;
      Child     : access Gtk.Widget.Gtk_Widget_Record'Class;
      Tab_Label : access Gtk.Widget.Gtk_Widget_Record'Class)
   is
      procedure Internal
        (Notebook  : System.Address;
         Child     : System.Address;
         Tab_Label : System.Address);
      pragma Import (C, Internal, "gtk_notebook_set_tab_label");

   begin
      Internal (Get_Object (Notebook), Get_Object (Child),
                Get_Object (Tab_Label));
   end Set_Tab_Label;

   ------------------------
   -- Set_Tab_Label_Text --
   ------------------------

   procedure Set_Tab_Label_Text
     (Notebook : access Gtk_Notebook_Record;
      Child    : access Gtk.Widget.Gtk_Widget_Record'Class;
      Tab_Text : UTF8_String)
   is
      procedure Internal
        (Notebook : System.Address;
         Child    : System.Address;
         Tab_Text : UTF8_String);
      pragma Import (C, Internal, "gtk_notebook_set_tab_label_text");

   begin
      Internal (Get_Object (Notebook), Get_Object (Child),
                Tab_Text & ASCII.NUL);
   end Set_Tab_Label_Text;

   --------------------
   -- Set_Menu_Label --
   --------------------

   procedure Set_Menu_Label
     (Notebook   : access Gtk_Notebook_Record;
      Child      : access Gtk.Widget.Gtk_Widget_Record'Class;
      Menu_Label : access Gtk.Widget.Gtk_Widget_Record'Class)
   is
      procedure Internal
        (Notebook   : System.Address;
         Child      : System.Address;
         Menu_Label : System.Address);
      pragma Import (C, Internal, "gtk_notebook_set_menu_label");

   begin
      Internal (Get_Object (Notebook), Get_Object (Child),
                Get_Object (Menu_Label));
   end Set_Menu_Label;

   -------------------------
   -- Set_Menu_Label_Text --
   -------------------------

   procedure Set_Menu_Label_Text
     (Notebook  : access Gtk_Notebook_Record;
      Child     : access Gtk.Widget.Gtk_Widget_Record'Class;
      Menu_Text : UTF8_String)
   is
      procedure Internal
        (Notebook  : System.Address;
         Child     : System.Address;
         Menu_Text : UTF8_String);
      pragma Import (C, Internal, "gtk_notebook_set_menu_label_text");

   begin
      Internal (Get_Object (Notebook), Get_Object (Child),
                Menu_Text & ASCII.NUL);
   end Set_Menu_Label_Text;

   -------------------
   -- Reorder_Child --
   -------------------

   procedure Reorder_Child
     (Notebook : access Gtk_Notebook_Record;
      Child    : access Gtk.Widget.Gtk_Widget_Record'Class;
      Position : Gint)
   is
      procedure Internal
        (Notebook : System.Address;
         Child    : System.Address;
         Position : Gint);
      pragma Import (C, Internal, "gtk_notebook_reorder_child");

   begin
      Internal (Get_Object (Notebook), Get_Object (Child), Position);
   end Reorder_Child;

   -----------------------
   -- Get_Notebook_Page --
   -----------------------

   function Get_Notebook_Page
     (Value : Glib.Values.GValue) return Gtk_Notebook_Page is
   begin
      return Gtk_Notebook_Page (Glib.Values.Get_Proxy (Value));
   end Get_Notebook_Page;

   -----------------
   -- Get_N_Pages --
   -----------------

   function Get_N_Pages
     (Notebook : access Gtk_Notebook_Record)
      return Gint
   is
      function Internal  (Notebook : System.Address) return Gint;
      pragma Import (C, Internal, "gtk_notebook_get_n_pages");
   begin
      return Internal (Get_Object (Notebook));
   end Get_N_Pages;

end Gtk.Notebook;