I've no idea here...
[gtkD.git] / gtkD / wrap / APILookupGtk.txt
blobf170c753d7fc793af00d1b8a65ae26911c881fbd
2 # This file is part of gtkD.
3
4 # gtkD is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU Lesser General Public License as published by
6 # the Free Software Foundation; either version 2.1 of the License, or
7 # (at your option) any later version.
8
9 # gtkD is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU Lesser General Public License for more details.
13
14 # You should have received a copy of the GNU Lesser General Public License
15 # along with gtkD; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21 ###
22 #####
23 # Definitions for wrapping Gtk
24 #####
25 ###
28 # must start with wrap
32 addTypedefs: start
33 public import gtkc.glibtypes;
34 public import gtkc.gobjecttypes;
35 public import gtkc.pangotypes;
36 public import gtkc.atktypes;
37 public import gtkc.gdkpixbuftypes;
38 public import gtkc.gdktypes;
39 alias void GtkAccelGroupEntry;
40 alias void GtkContainerClass;
42 //alias GTokenType.G_TOKEN_LAST G_TOKEN_LAST;";
43 //alias GtkSignalRunType.G_SIGNAL_RUN_FIRST G_SIGNAL_RUN_FIRST;
44 //alias GtkSignalRunType.G_SIGNAL_RUN_LAST G_SIGNAL_RUN_LAST;
45 //alias GtkSignalRunType.G_SIGNAL_NO_RECURSE G_SIGNAL_NO_RECURSE;
46 //alias GtkSignalRunType.G_SIGNAL_ACTION G_SIGNAL_ACTION;
47 //alias GtkSignalRunType.G_SIGNAL_NO_HOOKS G_SIGNAL_NO_HOOKS;
49 alias int GtkDragResult;
50 alias int GtkTooltip;
52 addTypedefs: end
54 addAliases: start
55 addAliases: end
57 addEnums: start
58 addEnums: end
60 addStructs: start
62         struct GtkTextIter {
63                 /* GtkTextIter is an opaque datatype; ignore all these fields.
64                 * Initialize the iter with gtk_text_buffer_get_iter_*
65                 * functions
66                 */
67                 /*< private >*/
68                 gpointer dummy1;
69                 gpointer dummy2;
70                 gint dummy3;
71                 gint dummy4;
72                 gint dummy5;
73                 gint dummy6;
74                 gint dummy7;
75                 gint dummy8;
76                 gpointer dummy9;
77                 gpointer dummy10;
78                 gint dummy11;
79                 gint dummy12;
80                 /* padding */
81                 gint dummy13;
82                 gpointer dummy14;
83         }
85 addStructs: end
87 addTypes: start
88 addTypes: end
90 addFuncts: start
91 addFuncts: end
93 addUnions: start
94 addUnions: end
96 addConstants: start
97 addConstants: end
101 wrap: gtk
103 ###########################################################
104 ### Core Reference ########################################
105 ###########################################################
108 file: gtk-General.html
110 #struct: 
111 class: GtkD
112 #prefix: 
113 prefix: gtk_
114 noprefix: gtk_true
115 noprefix: gtk_false
116 noprefix: gtk_timeout_
117 noprefix: gtk_idle_
118 #import: g.OptionEntry
119 #structWrap: GOptionEntry* OptionEntry
120 #import: g.Error*
121 #structWrap: GError** Error*
122 #import: g.OptionGroup
123 #structWrap: GOptionGroup* OptionGroup
124 import: gdk.Event
125 structWrap: GdkEvent* Event
126 import: gtk.Widget
127 structWrap: GtkWidget* Widget
128 import: gtk.ObjectGtk
129 structWrap: GtkObject* ObjectGtk
130 #import: gdk.ModifierType
131 #structWrap: GdkModifierType* ModifierType
132 import: glib.Str
133 import: gtkc.gtk
134 import: gthread.Thread
135 import: gdk.Threads
136 moduleAlias: GtkD Gtk
137 code: start
139         /**
140          * Call this function before using any other GTK+ functions in your GUI applications.
141          */
142         public static void init(char[][] args)
143         {
144                 char** argv = (new char*[args.length]).ptr;
145                 int argc = 0;
146                 foreach (char[] p; args)
147                 {
148                         argv[argc++] = cast(char*)p;
149                 }
150                 
151                 init(&argc,&argv);
152         }
153         
154         /**
155          * This initiates GtkD to supports multi threaded programs.
156          * read full documantation at http://gtk.org/faq/#AEN482
157          * from the FAQ:
158          * "There is a single global lock that you must acquire with 
159          * gdk_threads_enter() before making any GDK calls, 
160          * and release with gdk_threads_leave() afterwards throughout your code."
161          * This is to be used on any call to GDK not executed from the main thread.
162          */
163         public static void initMultiThread(char[][] args)
164         {
165                 Thread.init(null);
166                 gdkThreadsInit();
167                 init(args);
168         }
169         
170 code: end
171 outFile: GtkD
173 class: Timeout
174 prefix: gtk_timeout_
175 strictPrefix: Y
176 code: start
177         /** Holds all timeout delegates */
178         bool delegate()[] timeoutListeners;
179         /** our gtk timeout ID */
180         uint timeoutID;
182          
183         /**
184          * Creates a new timeout cycle.
185          * Params:
186          *      interval =      the timeout in milieconds
187          *      delegate() =    the delegate to be executed
188          *      fireNow =       When true the delegate will be executed emmidiatly
189          * Returns: 
190          */
191         this(uint interval, bool delegate() dlg, bool fireNow=false)
192         {
193                 timeoutListeners ~= dlg;
194                 timeoutID = gtk_timeout_add(interval, cast(GtkFunction)&timeoutCallback, cast(void*)this);
195                 if ( fireNow )
196                 {
197                         if ( !dlg() )
198                         {
199                                 timeoutListeners.length = 0;
200                         }
201                 }
202         }
204         public void stop()
205         {
206                 if ( timeoutID > 0 )
207                 {
208                         gtk_timeout_remove(timeoutID);
209                 }
210                 timeoutListeners.length = 0;
211         }
212         
213         /**
214          * Removes the timeout from gtk
215          * Returns: 
216          */
217         ~this()
218         {
219                 stop();
220         }
221         
222         /**
223          * Adds a new delegate to this timeout cycle
224          * Params:
225          *      delegate() =    
226          *      fireNow =       
227          */
228         public void addListener(bool delegate() dlg, bool fireNow=false)
229         {
230                 timeoutListeners ~= dlg;
231                 if ( fireNow )
232                 {
233                         if ( !dlg() )
234                         {
235                                 timeoutListeners.length = timeoutListeners.length - 1;
236                         }
237                 }
238         }
240         /**
241          * The callback execution from glib
242          * Params:
243          *      timeout =       
244          * Returns: 
245          */
246         extern(C) static bool timeoutCallback(Timeout timeout)
247         {
248                 return timeout.callAllListeners();
249         }
250         
251         /**
252          * Executes all delegates on the execution list
253          * Returns: 
254          */
255         private bool callAllListeners()
256         {
257                 bool runAgain = false;
258                 
259                 int i = 0;
260                 
261                 while ( i<timeoutListeners.length )
262                 {
263                         if ( !timeoutListeners[i]() )
264                         {
265                                 timeoutListeners = timeoutListeners[0..i] ~ timeoutListeners[i+1..timeoutListeners.length];
266                         }
267                         else
268                         {
269                                 runAgain = true;
270                                 ++i;
271                         }
272                 }
273                 return runAgain;
274         }
275 code: end
276 outFile: Timeout
278 class: Idle
279 prefix: gtk_idle_
280 strictPrefix: Y
281 code: start
282         /** Holds all idle delegates */
283         bool delegate()[] idleListeners;
284         /** our gtk idle ID */
285         uint idleID;
287         /**
288          * Creates a new idle cycle.
289          * Params:
290          *      interval =      the idle in milieconds
291          *      delegate() =    the delegate to be executed
292          *      fireNow =       When true the delegate will be executed emmidiatly
293          * Returns: 
294          */
295         this(bool delegate() dlg, bool fireNow=false)
296         {
297                 idleListeners ~= dlg;
298                 idleID = gtk_idle_add(cast(GtkFunction)&idleCallback, cast(void*)this);
299                 if ( fireNow )
300                 {
301                         if ( !dlg() )
302                         {
303                                 idleListeners.length = 0;
304                         }
305                 }
306         }
308         public void stop()
309         {
310                 if ( idleID > 0 )
311                 {
312                         gtk_idle_remove(idleID);
313                 }
314                 idleListeners.length = 0;
315         }
316         
317         /**
318          * Removes the idle from gtk
319          * Returns: 
320          */
321         ~this()
322         {
323                 stop();
324         }
325         
326         /**
327          * Adds a new delegate to this idle cycle
328          * Params:
329          *      delegate() =    
330          *      fireNow =       
331          */
332         public void addListener(bool delegate() dlg, bool fireNow=false)
333         {
334                 idleListeners ~= dlg;
335                 if ( fireNow )
336                 {
337                         if ( !dlg() )
338                         {
339                                 idleListeners.length = idleListeners.length - 1;
340                         }
341                 }
342         }
344         /**
345          * The callback execution from glib
346          * Params:
347          *      idle =  
348          * Returns: 
349          */
350         extern(C) static bool idleCallback(Idle idle)
351         {
352                 return idle.callAllListeners();
353         }
354         
355         /**
356          * Executes all delegates on the execution list
357          * Returns: 
358          */
359         private bool callAllListeners()
360         {
361                 bool runAgain = false;
362                 
363                 int i = 0;
364                 
365                 while ( i<idleListeners.length )
366                 {
367                         if ( !idleListeners[i]() )
368                         {
369                                 idleListeners = idleListeners[0..i] ~ idleListeners[i+1..idleListeners.length];
370                         }
371                         else
372                         {
373                                 runAgain = true;
374                                 ++i;
375                         }
376                 }
377                 return runAgain;
378         }
379 code: end
380 outFile: Idle
383 file: gtk-Keyboard-Accelerators.html
384 struct:  GtkAccelGroup
385 class: AccelGroup
386 prefix: gtk_accel_group_
387 prefix: gtk_
388 import: glib.Str
389 import: gobject.Closure
390 structWrap: GClosure* Closure
391 #import: gtk.AccelGroupEntry
392 #structWrap: GtkAccelGroupEntry* AccelGroupEntry
393 import: gobject.ObjectG
394 structWrap: GObject* ObjectG
395 import: gtk.AccelGroup
396 structWrap: GtkAccelGroup* AccelGroup
397 import: glib.ListSG
398 structWrap: GSList* ListSG
399 #import: gtk.AccelKey
400 #structWrap: GtkAccelKey* AccelKey
401 #import: gdk.ModifierType
402 #structWrap: GdkModifierType* ModifierType
403 outFile: AccelGroup
405 file: gtk-Accelerator-Maps.html
406 struct:  GtkAccelMap
407 class: AccelMap
408 prefix: gtk_accel_map_
409 prefix: gtk_
410 import: glib.Str
411 #import: gtk.AccelKey
412 #structWrap: GtkAccelKey* AccelKey
413 #import: g.Scanner
414 #structWrap: GScanner* Scanner
415 import: gtk.AccelMap
416 structWrap: GtkAccelMap* AccelMap
417 outFile: AccelMap
419 file: gtk-Clipboards.html
420 struct: GtkClipboard
421 class: Clipboard
422 prefix: gtk_clipboard_
423 prefix: gtk_
424 import: glib.Str
425 import: gtk.Clipboard
426 structWrap: GtkClipboard* Clipboard
427 import: gdk.Display
428 structWrap: GdkDisplay* Display
429 #import: gtk.TargetEntry
430 #structWrap: GtkTargetEntry* TargetEntry
431 import: gobject.ObjectG
432 structWrap: GObject* ObjectG
433 import: gdk.Pixbuf
434 structWrap: GdkPixbuf* Pixbuf
435 #import: gtk.SelectionData
436 #structWrap: GtkSelectionData* SelectionData
437 #import: gdk.Atom*
438 #structWrap: GdkAtom** Atom*
439 outFile: Clipboard
441 file: gtk-Drag-and-Drop.html
442 struct: GdkDragContext
443 class: DragAndDrop
444 prefix: gtk_drag_
445 prefix: gtk_
446 import: glib.Str
447 import: gtk.Widget
448 structWrap: GtkWidget* Widget
449 #import: gtk.TargetEntry
450 #structWrap: GtkTargetEntry* TargetEntry
451 import: gdk.Window
452 structWrap: GdkWindow* Window
453 import: gdk.DragContext
454 structWrap: GdkDragContext* DragContext
455 #import: gtk.TargetList
456 #structWrap: GtkTargetList* TargetList
457 import: gdk.Event
458 structWrap: GdkEvent* Event
459 import: gdk.Colormap
460 structWrap: GdkColormap* Colormap
461 import: gdk.Pixmap
462 structWrap: GdkPixmap* Pixmap
463 import: gdk.Bitmap
464 structWrap: GdkBitmap* Bitmap
465 import: gdk.Pixbuf
466 structWrap: GdkPixbuf* Pixbuf
467 import: glib.Str
468 outFile: DragAndDrop
470 file: GtkIconTheme.html
472 struct: GtkIconTheme
473 class: IconTheme
474 prefix: gtk_icon_theme_
475 noprefix: gtk_icon_info_
476 prefix: gtk_
477 import: glib.Str
478 import: gtk.IconTheme
479 structWrap: GtkIconTheme* IconTheme
480 import: gdk.Screen
481 structWrap: GdkScreen* Screen
482 import: gtk.IconInfo
483 structWrap: GtkIconInfo* IconInfo
484 import: gdk.Pixbuf
485 structWrap: GdkPixbuf* Pixbuf
486 #import: g.Error*
487 #structWrap: GError** Error*
488 import: glib.ListG
489 structWrap: GList* ListG
490 outFile: IconTheme
492 struct: GtkIconInfo
493 class: IconInfo
494 prefix: gtk_icon_info_
495 strictPrefix: Y
496 import: glib.Str
497 import: gtk.IconInfo
498 structWrap: GtkIconInfo* IconInfo
499 import: gdk.Pixbuf
500 structWrap: GdkPixbuf* Pixbuf
501 outFile: IconInfo
503 file: gtk-Stock-Items.html
504 struct: GtkStockItem
505 class: StockItem
506 prefix: gtk_stock_
507 prefix: gtk_
508 import: glib.Str
509 import: gtk.StockItem
510 structWrap: GtkStockItem* StockItem
511 import: glib.ListSG
512 structWrap: GSList* ListSG
513 outFile: StockItem
515 file: gtk-Themeable-Stock-Images.html
516 struct: GtkIconSource
517 class: IconSource
518 prefix: gtk_icon_
519 prefix: gtk_
520 import: glib.Str
521 #import: gtk.IconSource
522 #structWrap: GtkIconSource* IconSource
523 #import: gtk.IconFactory
524 #structWrap: GtkIconFactory* IconFactory
525 #import: gtk.IconSet
526 #structWrap: GtkIconSet* IconSet
527 import: gdk.Pixbuf
528 structWrap: GdkPixbuf* Pixbuf
529 import: gtk.Style
530 structWrap: GtkStyle* Style
531 import: gtk.Widget
532 structWrap: GtkWidget* Widget
533 import: gtk.Settings
534 structWrap: GtkSettings* Settings
535 outFile: IconSource
537 file: gtk-Resource-Files.html
538 struct: GtkRcStyle
539 class: RcStyle
540 prefix: gtk_rc_
541 prefix: gtk_
542 #import: g.Scanner
543 #structWrap: GScanner* Scanner
544 import: glib.Str
545 import: gtk.Style
546 structWrap: GtkStyle* Style
547 import: gtk.Widget
548 structWrap: GtkWidget* Widget
549 import: gtk.Settings
550 structWrap: GtkSettings* Settings
551 import: gdk.Color
552 structWrap: GdkColor* Color
553 #import: gtk.StateType
554 #structWrap: GtkStateType* StateType
555 #import: gtk.PathPriorityType
556 #structWrap: GtkPathPriorityType* PathPriorityType
557 import: gtk.RcStyle
558 structWrap: GtkRcStyle* RcStyle
559 outFile: RcStyle
561 file: GtkSettings.html
562 struct: GtkSettings
563 class: Settings
564 prefix: gtk_settings_
565 prefix: gtk_
566 import: glib.Str
567 import: gtk.Settings
568 structWrap: GtkSettings* Settings
569 import: gdk.Screen
570 structWrap: GdkScreen* Screen
571 #import: g.ParamSpec
572 #structWrap: GParamSpec* ParamSpec
573 import: glib.StringG
574 structWrap: GString* StringG
575 import: gobject.Value
576 structWrap: GValue* Value
577 #import: gtk.SettingsValue
578 #structWrap: GtkSettingsValue* SettingsValue
579 outFile: Settings
581 file: gtk-Bindings.html
582 struct: GtkBindingSet
583 class: BindingSet
584 prefix: gtk_binding_set_
585 prefix: gtk_bindings_
586 prefix: gtk_
587 import: glib.Str
588 import: gtk.BindingSet
589 structWrap: GtkBindingSet* BindingSet
590 import: gtk.ObjectGtk
591 structWrap: GtkObject* ObjectGtk
592 #import: gdk.EventKey
593 #structWrap: GdkEventKey* EventKey
594 import: glib.ListSG
595 structWrap: GSList* ListSG
596 import: glib.Str;
597 #import: g.Scanner
598 #structWrap: GScanner* Scanner
599 outFile: BindingSet
601 file: gtk-Standard-Enumerations.html
602 #struct: 
603 class: StandardEnumerations
604 #prefix: 
605 #prefix: gtk_
606 outFile: StandardEnumerations
608 file: gtk-Graphics-Contexts.html
609 #struct: 
610 class: GCs
611 prefix: gtk_gc_
612 prefix: gtk_
613 import: gdk.GC
614 structWrap: GdkGC* GC
615 import: gdk.Colormap
616 structWrap: GdkColormap* Colormap
617 #import: gdk.GCValues
618 #structWrap: GdkGCValues* GCValues
619 outFile: GCs
621 file: GtkStyle.html
622 struct: GtkStyle
623 class: Style
624 prefix: gtk_style_
625 prefix: gtk_
626 import: glib.Str
627 import: gtk.Style
628 structWrap: GtkStyle* Style
629 import: gdk.Window
630 structWrap: GdkWindow* Window
631 import: gdk.Rectangle
632 structWrap: GdkRectangle* Rectangle
633 #import: gtk.IconSet
634 #structWrap: GtkIconSet* IconSet
635 import: gdk.Pixbuf
636 structWrap: GdkPixbuf* Pixbuf
637 import: gtk.IconSource
638 structWrap: GtkIconSource* IconSource
639 import: gtk.Widget
640 structWrap: GtkWidget* Widget
641 import: gdk.Font
642 structWrap: GdkFont* Font
643 #import: gdk.Point
644 #structWrap: GdkPoint* Point
645 import: gdk.Drawable
646 structWrap: GdkDrawable* Drawable
647 #import: gtk.Border
648 #structWrap: GtkBorder* Border
649 outFile: Style
651 file: gtk-Selections.html
652 #struct: 
653 class: Selections
654 prefix: gtk_
655 import: glib.Str
656 #import: gtk.TargetList
657 #structWrap: GtkTargetList* TargetList
658 #import: gtk.TargetEntry
659 #structWrap: GtkTargetEntry* TargetEntry
660 import: gtk.Widget
661 structWrap: GtkWidget* Widget
662 import: gdk.Display
663 structWrap: GdkDisplay* Display
664 #import: gtk.SelectionData
665 #structWrap: GtkSelectionData* SelectionData
666 import: gdk.Pixbuf
667 structWrap: GdkPixbuf* Pixbuf
668 import: glib.Str
669 outFile: Selections
671 file: gtk-Feature-Test-Macros.html
672 #struct: 
673 class: Version
674 prefix: gtk_
675 import: glib.Str
676 outFile: Version
678 file: gtk-Signals.html
679 #struct: 
680 class: Signals
681 prefix: gtk_signal_
682 prefix: gtk_
683 import: glib.Str
684 #import: gtk.Type
685 #structWrap: GtkType* Type
686 import: gtk.ObjectGtk
687 structWrap: GtkObject* ObjectGtk
688 #import: gtk.Arg
689 #structWrap: GtkArg* Arg
690 import: glib.Str
691 outFile: Signals
693 file: gtk-Types.html
694 struct: GtkType
695 class: Types
696 prefix: gtk_type_
697 prefix: gtk_
698 import: glib.Str
699 #import: gtk.TypeInfo
700 #structWrap: GtkTypeInfo* TypeInfo
701 #import: gtk.EnumValue
702 #structWrap: GtkEnumValue* EnumValue
703 #import: gtk.FlagValue
704 #structWrap: GtkFlagValue* FlagValue
705 outFile: Types
707 ###########################################################
708 ### Windows ###############################################
709 ###########################################################
711 file: GtkDialog.html
712 struct: GtkDialog
713 class: Dialog
714 prefix: gtk_dialog_
715 prefix: gtk_
716 import: glib.Str
717 import: gtk.Window
718 structWrap: GtkWindow* Window
719 import: gtk.Widget
720 structWrap: GtkWidget* Widget
721 import: gdk.Screen
722 structWrap: GdkScreen* Screen
724 code: start
726         public Widget addButton(StockID stockID, int responseId)
727         {
728                 return addButton(StockDesc[stockID], responseId);
729         }
730         
732         public void addButtons(char[][] buttonsText, ResponseType[] responses)
733         {
734                 for ( int i=0 ; i<buttonsText.length && i<responses.length ; i++)
735                 {
736                         addButton(buttonsText[i], responses[i]);
737                 }
738         }
739         
740         public void addButtons(StockID[] stockIDs, ResponseType[] responses)
741         {
742                 for ( int i=0 ; i<stockIDs.length && i<responses.length ; i++)
743                 {
744                         addButton(stockIDs[i], responses[i]);
745                 }
746         }
747         
748 code: end
749 outFile: Dialog
751 file: GtkInvisible.html
752 struct: GtkInvisible
753 class: Invisible
754 prefix: gtk_invisible_
755 prefix: gtk_
756 import: gdk.Screen
757 structWrap: GdkScreen* Screen
758 outFile: Invisible
760 file: GtkMessageDialog.html
761 struct: GtkMessageDialog
762 class: MessageDialog
763 prefix: gtk_message_dialog_
764 prefix: gtk_
765 import: glib.Str
766 import: gtk.Window
767 structWrap: GtkWindow* Window
769 nocode: gtk_message_dialog_new
770 nocode: gtk_message_dialog_new_with_markup
772 code: start
773         /**
774          * Creates a new message dialog, which is a simple dialog with an icon
775          * indicating the dialog type (error, warning, etc.) and some text the
776          * user may want to see. When the user clicks a button a "response"
777          * signal is emitted with response IDs from GtkResponseType. See
778          * GtkDialog for more details.
779          * parent:
780          *  transient parent, or NULL for none
781          * flags:
782          *  flags
783          * type:
784          *  type of message
785          * buttons:
786          *  set of buttons to use
787          * message_format:
788          *  printf()-style format string, or NULL
789          * message:
790          *  the message - should be null, any formatting should be done prior to call this constructor
791          *  arguments for message_format
792          * Returns:
793          *  a new GtkMessageDialog
794          */
795         public this (Window parent, GtkDialogFlags flags, GtkMessageType type, GtkButtonsType buttons, char[] messageFormat, char[] message=null )
796         {
797                 this(parent, flags, type, buttons, false, messageFormat, message );
798         }
799         
800         /**
801          * Creates a new message dialog, which is a simple dialog with an icon
802          * indicating the dialog type (error, warning, etc.) and some text which
803          * is marked up with the Pango text markup language.
804          * When the user clicks a button a "response" signal is emitted with
805          * response IDs from GtkResponseType. See GtkDialog for more details.
806          * 
807          * If Markup is true special XML characters in the printf() arguments passed to this
808          * function will automatically be escaped as necessary.
809          * (See g_markup_printf_escaped() for how this is implemented.)
810          * Usually this is what you want, but if you have an existing
811          * Pango markup string that you want to use literally as the
812          * label, then you need to use gtk_message_dialog_set_markup()
813          * instead, since you can't pass the markup string either
814          * as the format (it might contain '%' characters) or as a string
815          * argument.
816          *  GtkWidget *dialog;
817          *  dialog = gtk_message_dialog_new (main_application_window,
818          *  GTK_DIALOG_DESTROY_WITH_PARENT,
819          *  GTK_MESSAGE_ERROR,
820          *  GTK_BUTTONS_CLOSE,
821          *  NULL);
822          *  gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG (dialog),
823          *  markup);
824          * parent:
825          *  transient parent, or NULL for none
826          * flags:
827          *  flags
828          * type:
829          *  type of message
830          * buttons:
831          *  set of buttons to use
832          * message_format:
833          *  printf()-style format string, or NULL
834          * message:
835          *  the message - should be null, any formatting should be done prior to call this constructor
836          * ...:
837          *  arguments for message_format
838          * Returns:
839          *  a new GtkMessageDialog
840          * Since 2.4
841          */
842         public this (Window parent, GtkDialogFlags flags, GtkMessageType type, GtkButtonsType buttons, bool markup, char[] messageFormat, char[] message=null )
843         {
844                 if ( markup )
845                 {
846                         // GtkWidget* gtk_message_dialog_new_with_markup  (GtkWindow *parent,  GtkDialogFlags flags,  GtkMessageType type,  GtkButtonsType buttons,  const gchar *message_format,  ...);
847                         this(
848                                 cast(GtkMessageDialog*)gtk_message_dialog_new_with_markup(
849                                                 parent is null ? null : parent.getWindowStruct(), 
850                                                 flags, 
851                                                 type, 
852                                                 buttons, 
853                                                 Str.toStringz(messageFormat),
854                                                 Str.toStringz(message), // this should be null
855                                                 null
856                                                 )
857                         );
858                 }
859                 else
860                 {
861                         // GtkWidget* gtk_message_dialog_new (GtkWindow *parent,  GtkDialogFlags flags,  GtkMessageType type,  GtkButtonsType buttons,  const gchar *message_format,  ...);
862                         this(
863                                 cast(GtkMessageDialog*)gtk_message_dialog_new(
864                                                 parent is null ? null : parent.getWindowStruct(), 
865                                                 flags, 
866                                                 type, 
867                                                 buttons, 
868                                                 Str.toStringz(messageFormat),
869                                                 Str.toStringz(message), // this should be null
870                                                 null
871                                                 )
872                         );
873                 }
874         }
875         
876 code: end
878 outFile: MessageDialog
880 file: 
881 class: PopupBox
882 import: gtk.MessageDialog;
883 import: gtk.Window;
885 code: start
886         /**
887          * Create an information popup dialog.
888          * @param message The message to show on the dialog
889          * @param title The title of the dialog
890          */
891         public static void information(char[] message, char[] title)
892         {
893                 information(null, message, title);
894         }
895         
896         /**
897          * Create an information popup dialog.
898          * @param parent The parent window of this popup dialog
899          * @param message The message to show on the dialog
900          * @param title The title of the dialog
901          */
902         public static void information(Window parent, char[] message, char[] title)
903         {
904                 MessageDialog d = new MessageDialog(parent, cast(GtkDialogFlags)0,
905                                                                                 MessageType.INFO,
906                                                                                 ButtonsType.OK ,
907                                                                                 message);
908                 d.setTitle(title);
909                 //d.addButton("gtk-dialog-info",GtkResponseType.GTK_RESPONSE_OK);
910                 d.run();
911                 d.destroy();
912         }
913         
914         
915         /**
916          * Create an error popup dialog.
917          * @param message The message to show on the dialog
918          * @param title The title of the dialog
919          */
920         public static void error(char[] message, char[] title)
921         {
922                 error(null, message, title);
923         }
924         
925         /**
926          * Create an error popup dialog.
927          * @param parent The parent window of this popup dialog
928          * @param message The message to show on the dialog
929          * @param title The title of the dialog
930          */
931         public static void error(Window parent, char[] message, char[] title)
932         {
933                 MessageDialog d = new MessageDialog(parent, cast(GtkDialogFlags)0,
934                                                                                 MessageType.ERROR,
935                                                                                 ButtonsType.CANCEL ,
936                                                                                 message);
937                 d.setTitle(title);
938                 //d.addButton("gtk-dialog-error",ResponseType.GTK_RESPONSE_CANCEL);
939                 d.run();
940                 d.destroy();
941         }
942         
943         
944         
945         /**
946          * Create an 'yes' or 'no' popup dialog.
947          * @param message The message to show on the dialog
948          * @param title The title of the dialog
949          */
950         public static bool yesNo(char[] message, char[] title)
951         {
952                 return yesNo(null, message, title);
953         }
954         
955         /**
956          * Create an 'yes' or 'no' popup dialog.
957          * @param parent The parent window of this popup dialog
958          * @param message The message to show on the dialog
959          * @param title The title of the dialog
960          */
961         public static bool yesNo(Window parent, char[] message, char[] title)
962         {
963                 MessageDialog d = new MessageDialog(
964                                 parent, cast(GtkDialogFlags)0,
965                                 MessageType.QUESTION,
966                                 ButtonsType.NONE ,
967                                 message);
968                 d.setTitle(title);
969                 d.addButton("gtk-no",ResponseType.GTK_RESPONSE_NO);
970                 d.addButton("gtk-yes",ResponseType.GTK_RESPONSE_YES);
971                 int responce = d.run();
972                 d.destroy();
973                 return responce == ResponseType.GTK_RESPONSE_YES;
974         }
976         
977         /**
978          * Create an 'yes', 'no' or 'cancel' popup dialog.
979          * @param message The message to show on the dialog
980          * @param title The title of the dialog
981          */
982         public static ResponseType yesNoCancel(char[] message, char[] title)
983         {
984                 return yesNoCancel(null, message, title);
985         }
986         
987         /**
988          * Create an 'yes', 'no' or 'cancel' popup dialog.
989          * @param parent The parent window of this popup dialog
990          * @param message The message to show on the dialog
991          * @param title The title of the dialog
992          */
993         public static ResponseType yesNoCancel(Window parent, char[] message, char[] title)
994         {
995                 MessageDialog d = new MessageDialog(
996                                 parent, cast(GtkDialogFlags)0,
997                                 MessageType.QUESTION,
998                                 ButtonsType.NONE ,
999                                 message);
1000                 d.setTitle(title);
1001                 d.addButton("gtk-no",ResponseType.GTK_RESPONSE_NO);
1002                 d.addButton("gtk-yes",ResponseType.GTK_RESPONSE_YES);
1003                 d.addButton("gtk-cancel",ResponseType.GTK_RESPONSE_CANCEL);
1004                 ResponseType responce = cast(ResponseType)d.run();
1005                 d.destroy();
1006                 return responce;
1007         }
1008 code: end
1009 outFile: PopupBox
1011 file: GtkWindow.html
1012 struct: GtkWindow
1013 class: Window
1014 prefix: gtk_window_
1015 prefix: gtk_
1016 import: glib.Str
1017 import: gtk.AccelGroup
1018 structWrap: GtkAccelGroup* AccelGroup
1019 import: gtk.Widget
1020 structWrap: GtkWidget* Widget
1021 #import: gdk.Geometry
1022 #structWrap: GdkGeometry* Geometry
1023 import: gtk.Window
1024 structWrap: GtkWindow* Window
1025 import: gdk.Screen
1026 structWrap: GdkScreen* Screen
1027 import: glib.ListG
1028 structWrap: GList* ListG
1029 #import: gdk.EventKey
1030 #structWrap: GdkEventKey* EventKey
1031 import: gdk.Pixbuf
1032 structWrap: GdkPixbuf* Pixbuf
1033 import: gtk.Window
1035 code: start
1036         /**
1037          * Creates a top level window with a title
1038          * Params:
1039          *              title:  The Window title
1040          */
1041         public this(char[] title)
1042         {
1043                 this(GtkWindowType.TOPLEVEL);
1044                 setTitle(title);
1045         }
1047         /**
1048          * Move the window to an absolute position.
1049          * just calls move(int, int).
1050          * convinience because GdkEvent structs return the position coords as doubles
1051          */
1052         public void move(double x, double y)
1053         {
1054                 move(cast(int)x, cast(int)y);
1055         }
1056         
1058 code: end
1060 outFile: Window
1062 file: 
1063 import: gtk.Widget
1064 import: gtk.Window
1065 import: gtk.GtkD
1066 import: gdk.Event
1067         
1069 code: start
1072  * A top Level window that will stop the main event cycle when it's closed.
1073  * Closing the last of the windows of class "MainWindow" will end the application.
1074  */
1075 public class MainWindow : Window
1078         private static int countTotalMainWindows = 0;
1080         /**
1081          * Creates a new MainWindow with a title
1082          */
1083         public this(char[] title)
1084         {
1085                 super(title);
1086                 countTotalMainWindows++;
1087                 //printf("MainWindows.this count = %d\n", countTotalMainWindows);
1088                 addOnDelete(&windowDelete);
1089         }
1090         
1091         /**
1092          * Executed when the user tries to close the window
1093          * @return true to refuse to close the window
1094          */
1095         protected int windowDelete(Event event, Widget widget)
1096         {
1097                 --countTotalMainWindows;
1098                 //printf("MainWindows.windowDelete count = %d\n", countTotalMainWindows);
1099                 if ( exit(0, false) || countTotalMainWindows==0 )
1100                 {
1101                         GtkD.mainQuit();
1102                         return false;
1103                 }
1104                 return false;
1105         }
1106         
1107         /**
1108          * Allows the application to close and decide if it can exit
1109          * @param code the code reason to exit
1110          * @param force if true the application must expect to be closed even against it's will
1111          * @return false to refuse to exit
1112          */
1113         protected bool exit(int code, bool force)
1114         {
1115                 return force;
1116         }
1119 code: end
1120 outFile: MainWindow
1122 file: GtkWindowGroup.html
1123 struct: GtkWindowGroup
1124 class: WindowGroup
1125 prefix: gtk_window_group_
1126 prefix: gtk_
1127 import: gtk.Window
1128 structWrap: GtkWindow* Window
1129 outFile: WindowGroup
1131 file: GtkAboutDialog.html
1132 struct: GtkAboutDialog
1133 class: AboutDialog
1134 prefix: gtk_about_dialog_
1135 prefix: gtk_
1136 import: glib.Str
1137 import: gdk.Pixbuf
1138 structWrap: GdkPixbuf* Pixbuf
1139 import: gtk.Window
1140 structWrap: GtkWindow* Window
1141 outFile: AboutDialog
1143 file: GtkAssistant.html
1144 struct: GtkAssistant
1145 class: Assistant
1146 prefix: gtk_assistant_
1147 prefix: gtk_
1148 import: glib.Str
1149 import: gdk.Pixbuf
1150 structWrap: GdkPixbuf* Pixbuf
1151 import: gtk.Widget
1152 structWrap: GtkWidget* Widget
1153 outFile: Assistant
1157 ###########################################################
1158 ### Display Widgets #######################################
1159 ###########################################################
1161 file: GtkAccelLabel.html
1162 struct: GtkAccelLabel
1163 class: AccelLabel
1164 prefix: gtk_accel_label_
1165 prefix: gtk_
1166 import: glib.Str
1167 import: gobject.Closure
1168 structWrap: GClosure* Closure
1169 import: gtk.Widget
1170 structWrap: GtkWidget* Widget
1171 outFile: AccelLabel
1173 file: GtkImage.html
1174 struct: GtkImage
1175 class: Image
1176 prefix: gtk_image_
1177 prefix: gtk_
1178 import: glib.Str
1179 #import: gtk.IconSet*
1180 #structWrap: GtkIconSet** IconSet*
1181 #import: gtk.IconSize
1182 #structWrap: GtkIconSize* IconSize
1183 #import: gdk.ImageGdk*
1184 #structWrap: GdkImage** ImageGdk*
1185 #import: gdk.Bitmap*
1186 #structWrap: GdkBitmap** Bitmap*
1187 import: gdk.Pixbuf
1188 structWrap: GdkPixbuf* Pixbuf
1189 #import: gdk.Pixmap*
1190 #structWrap: GdkPixmap** Pixmap*
1191 #import: gdk.PixbufAnimation
1192 #structWrap: GdkPixbufAnimation* PixbufAnimation
1193 #import: gtk.IconSet
1194 #structWrap: GtkIconSet* IconSet
1195 import: gdk.ImageGdk
1196 structWrap: GdkImage* ImageGdk
1197 import: gdk.Bitmap
1198 structWrap: GdkBitmap* Bitmap
1199 import: gdk.Pixmap
1200 structWrap: GdkPixmap* Pixmap
1202 nocode: gtk_image_new_from_stock
1203 nocode: gtk_image_new_from_icon_name
1205 code: start
1206 // this will be an enum 
1207         /**
1208          * Creates a GtkImage displaying a stock icon. Sample stock icon
1209          * names are GTK_STOCK_OPEN, GTK_STOCK_EXIT. Sample stock sizes
1210          * are GTK_ICON_SIZE_MENU, GTK_ICON_SIZE_SMALL_TOOLBAR. If the stock
1211          * icon name isn't known, the image will be empty.
1212          * You can register your own stock icon names, see
1213          * gtk_icon_factory_add_default() and gtk_icon_factory_add().
1214          * stock_id:
1215          *  a stock icon name
1216          * size:
1217          *  a stock icon size
1218          * Returns:
1219          *  a new GtkImage displaying the stock icon
1220          */
1221         public this (StockID stockID, GtkIconSize size)
1222         {
1223                 // GtkWidget* gtk_image_new_from_stock (const gchar *stock_id,  GtkIconSize size);
1224                 this(cast(GtkImage*)gtk_image_new_from_stock(StockDesc[stockID].ptr, size) );
1225         }
1226         
1227         /**
1228          * Creates a GtkImage displaying an icon from the current icon theme.
1229          * If the icon name isn't known, a "broken image" icon will be
1230          * displayed instead. If the current icon theme is changed, the icon
1231          * will be updated appropriately.
1232          * icon_name:
1233          *  an icon name
1234          * size:
1235          *  a stock icon size
1236          * Returns:
1237          *  a new GtkImage displaying the themed icon
1238          * Since 2.6
1239          */
1240         public this (char[] iconName, GtkIconSize size)
1241         {
1242                 // GtkWidget* gtk_image_new_from_icon_name (const gchar *icon_name,  GtkIconSize size);
1243                 this(cast(GtkImage*)gtk_image_new_from_icon_name(Str.toStringz(iconName), size) );
1244         }
1245         
1246 code: end
1248 outFile: Image
1250 file: GtkLabel.html
1251 struct: GtkLabel
1252 class: Label
1253 prefix: gtk_label_
1254 prefix: gtk_
1255 import: glib.Str
1256 import: gtk.Widget
1257 structWrap: GtkWidget* Widget
1258 nocode: gtk_label_new
1259 nocode: gtk_label_new_with_mnemonic
1260 code: start
1261         /**
1262          * Creates a new GtkLabel, containing the text in str.
1263          * If characters in str are preceded by an underscore, they are
1264          * underlined. If you need a literal underscore character in a label, use
1265          * '__' (two underscores). The first underlined character represents a 
1266          * keyboard accelerator called a mnemonic. The mnemonic key can be used 
1267          * to activate another widget, chosen automatically, or explicitly using
1268          * gtk_label_set_mnemonic_widget().
1269          * If gtk_label_set_mnemonic_widget()
1270          * is not called, then the first activatable ancestor of the GtkLabel
1271          * will be chosen as the mnemonic widget. For instance, if the
1272          * label is inside a button or menu item, the button or menu item will
1273          * automatically become the mnemonic widget and be activated by
1274          * the mnemonic.
1275          * str:
1276          *  The text of the label, with an underscore in front of the
1277          *  mnemonic character
1278          * mnemonic: when false uses the literal text passed in without mnemonic
1279          * Returns:
1280          *  the new GtkLabel
1281          */
1282         public this (char[] str, bool mnemonic=true)
1283         {
1284                 if ( mnemonic )
1285                 {
1286                         // GtkWidget* gtk_label_new_with_mnemonic (const gchar *str);
1287                         this(cast(GtkLabel*)gtk_label_new_with_mnemonic(Str.toStringz(str)) );
1288                 }
1289                 else
1290                 {
1291                         // GtkWidget* gtk_label_new (const gchar *str);
1292                         this(cast(GtkLabel*)gtk_label_new(Str.toStringz(str)) );
1293                 }
1294         }
1295 code: end
1296 outFile: Label
1298 file: GtkProgressBar.html
1299 struct: GtkProgressBar
1300 class: ProgressBar
1301 prefix: gtk_progress_bar_
1302 prefix: gtk_
1303 import: glib.Str
1304 import: gtk.Adjustment
1305 structWrap: GtkAdjustment* Adjustment
1306 outFile: ProgressBar
1308 file: GtkStatusbar.html
1309 struct: GtkStatusbar
1310 class: Statusbar
1311 import: glib.Str
1312 prefix: gtk_statusbar_
1313 prefix: gtk_
1314 outFile: Statusbar
1316 ###########################################################
1317 ### Buttons and Toggles ###################################
1318 ###########################################################
1320 file: GtkButton.html
1321 struct: GtkButton
1322 class: Button
1323 prefix: gtk_button_
1324 prefix: gtk_
1325 import: glib.Str
1326 import: gtk.Widget
1327 structWrap: GtkWidget* Widget
1328 import: gtk.Image
1329 import: gtk.Button
1331 nocode: gtk_button_new_with_mnemonic
1332 nocode: gtk_button_new_with_label
1333 nocode: gtk_button_new_from_stock
1335 code: start
1338         private static IconSize currentIconSize = IconSize.BUTTON;
1340         /** An arbitrary string to be used by the application */
1341         private char[] action;
1343         public static void setIconSize(IconSize iconSize)
1344         {
1345                 currentIconSize = iconSize;
1346         }
1347         public static IconSize getIconSize()
1348         {
1349                 return currentIconSize;
1350         }
1352         public void setActionName(char[] action)
1353         {
1354                 this.action = action.dup;
1355         }
1356         
1357         public char[] getActionName()
1358         {
1359                 return action;
1360         }
1362         /**
1363          * Creates a new GtkButton containing a label.
1364          * If characters in label are preceded by an underscore, they are underlined.
1365          * If you need a literal underscore character in a label, use '__' (two
1366          * underscores). The first underlined character represents a keyboard
1367          * accelerator called a mnemonic.
1368          * Pressing Alt and that key activates the button.
1369          * label:
1370          *  The text of the button, with an underscore in front of the
1371          *  mnemonic character
1372          * Returns:
1373          *  a new GtkButton
1374          */
1375         public this (char[] label, bool mnemonic=true)
1376         {
1377                 if ( mnemonic )
1378                 {
1379                         // GtkWidget* gtk_button_new_with_mnemonic (const gchar *label);
1380                         this(cast(GtkButton*)gtk_button_new_with_mnemonic(Str.toStringz(label)) );
1381                 }
1382                 else
1383                 {
1384                         // GtkWidget* gtk_button_new_with_label (const gchar *label);
1385                         this(cast(GtkButton*)gtk_button_new_with_label(Str.toStringz(label)) );
1386                 }
1387         }
1388         
1389         /**
1390          * Creates a new GtkButton containing the image and text from a stock item.
1391          * Some stock ids have preprocessor macros like GTK_STOCK_OK and
1392          * GTK_STOCK_APPLY.
1393          * If stock_id is unknown, then it will be treated as a mnemonic
1394          * label (as for gtk_button_new_with_mnemonic()).
1395          * stock_id:
1396          *  the name of the stock item
1397          * Returns:
1398          *  a new GtkButton
1399          */
1400         public this (StockID stockID, bool hideLabel=false)
1401         {
1402                 // GtkWidget* gtk_button_new_from_stock (const gchar *stock_id);
1403                 if ( hideLabel )
1404                 {
1405                         this();
1406                         Image image = new Image(stockID,currentIconSize);
1407                         add(image);
1408                 }
1409                 else
1410                 {
1411                         this(cast(GtkButton*)gtk_button_new_from_stock(StockDesc[stockID].ptr) );
1412                 }
1413                 
1414         }
1415         
1416         public this(StockID stockID, void delegate(Button) dlg, bool hideLabel=false)
1417         {
1418                 this(stockID, hideLabel);
1419                 addOnClicked(dlg);
1420         }
1421         
1423         public this(char[] label, void delegate(Button) dlg, bool mnemonic=true)
1424         {
1425                 this(label, mnemonic);
1426                 addOnClicked(dlg);
1427         }
1429         public this(char[] label, void delegate(Button) dlg, char[] action)
1430         {
1431                 this(label);
1432                 setActionName(action);
1433                 addOnClicked(dlg);
1434         }
1435         
1437 code: end
1438 outFile: Button
1440 file: GtkCheckButton.html
1441 struct: GtkCheckButton
1442 class: CheckButton
1443 import: glib.Str
1444 import: gtk.Button
1445 import: glib.Str
1446 prefix: gtk_check_button_
1447 prefix: gtk_
1449 nocode: gtk_check_button_new_with_label
1450 nocode: gtk_check_button_new_with_mnemonic
1452 code: start
1453         /**
1454          * Creates a new GtkCheckButton with a GtkLabel to the right of it.
1455          * If mnemonic is true the label
1456          * will be created using gtk_label_new_with_mnemonic(), so underscores
1457          * in label indicate the mnemonic for the check button.
1458          * label:
1459          *  The text of the button, with an underscore in front of the
1460          *  mnemonic character
1461          * label:
1462          * the text for the check button.
1463          * Returns:
1464          * a GtkWidget.
1465          */
1466         public this (char[] label, bool mnemonic=true)
1467         {
1468                 if ( mnemonic )
1469                 {
1470                         // GtkWidget* gtk_check_button_new_with_mnemonic  (const gchar *label);
1471                         this(cast(GtkCheckButton*)gtk_check_button_new_with_mnemonic(Str.toStringz(label)) );
1472                 }
1473                 else
1474                 {
1475                         // GtkWidget* gtk_check_button_new_with_label (const gchar *label);
1476                         this(cast(GtkCheckButton*)gtk_check_button_new_with_label(Str.toStringz(label)) );
1477                 }
1478         }
1479         
1480         public this(char[] label, void delegate(CheckButton) onClicked, bool mnemonic=true)
1481         {
1482                 this(label, mnemonic);
1483                 addOnClicked(cast(void delegate(Button))onClicked);
1484         }
1485         
1486 code: end
1488 outFile: CheckButton
1490 file: GtkRadioButton.html
1491 struct: GtkRadioButton
1492 class: RadioButton
1493 prefix: gtk_radio_button_
1494 prefix: gtk_
1495 import: glib.Str
1496 import: glib.ListSG
1497 structWrap: GSList* ListSG
1499 nocode: gtk_radio_button_new_with_label
1500 nocode: gtk_radio_button_new_with_mnemonic
1501 nocode: gtk_radio_button_new_with_label_from_widget
1502 nocode: gtk_radio_button_new_with_mnemonic_from_widget
1504 code: start
1505         /**
1506          * Creates a new GtkRadioButton with a text label.
1507          * If mnemonic if true the label will be created using
1508          * gtk_label_new_with_mnemonic(), so underscores in label indicate the
1509          * mnemonic for the button.
1510          * an existing radio button group, or NULL if you are creating a new
1511          * group.
1512          * label:
1513          * the text label to display next to the radio button.
1514          * Returns:
1515          * a new radio button.
1516          */
1517         public this (ListSG group, char[] label, bool mnemonic=true)
1518         {
1519                 if ( mnemonic )
1520                 {
1521                         // GtkWidget* gtk_radio_button_new_with_mnemonic  (GSList *group,  const gchar *label);
1522                         this(cast(GtkRadioButton*)gtk_radio_button_new_with_mnemonic(
1523                                                 group is null ? null : group.getListSGStruct(), 
1524                                                 Str.toStringz(label)) 
1525                                                 );
1526                 }
1527                 else
1528                 {
1529                         // GtkWidget* gtk_radio_button_new_with_label (GSList *group,  const gchar *label);
1530                         this(cast(GtkRadioButton*)gtk_radio_button_new_with_label(
1531                                                 group is null ? null : group.getListSGStruct(), 
1532                                                 Str.toStringz(label)) 
1533                                                 );
1534                 }
1535         }
1536         
1537         /**
1538          * Creates a new GtkRadioButton with a text label, adding it to the same group
1539          * as group.
1540          * It mnemonic it true the label
1541          * will be created using gtk_label_new_with_mnemonic(), so underscores
1542          * in label indicate the mnemonic for the button.
1543          * group:
1544          * an existing GtkRadioButton.
1545          * label:
1546          * a text string to display next to the radio button.
1547          * Returns:
1548          * a new radio button.
1549          */
1550         public this (RadioButton radioButton, char[] label, bool mnemonic=true)
1551         {
1552                 if ( mnemonic )
1553                 {
1554                         // GtkWidget* gtk_radio_button_new_with_mnemonic_from_widget  (GtkRadioButton *group,  const gchar *label);
1555                         this(cast(GtkRadioButton*)gtk_radio_button_new_with_mnemonic_from_widget(
1556                                                 radioButton.getRadioButtonStruct(),
1557                                                 Str.toStringz(label))
1558                                                 );
1559                 }
1560                 else
1561                 {
1562                         // GtkWidget* gtk_radio_button_new_with_label_from_widget  (GtkRadioButton *group,  const gchar *label);
1563                         this(cast(GtkRadioButton*)gtk_radio_button_new_with_label_from_widget(
1564                                                 radioButton.getRadioButtonStruct(), 
1565                                                 Str.toStringz(label))
1566                                                 );
1567                 }
1568         }
1569 code: end
1570 outFile: RadioButton
1572 file: GtkToggleButton.html
1573 struct: GtkToggleButton
1574 class: ToggleButton
1575 prefix: gtk_toggle_button_
1576 prefix: gtk_
1577 import: glib.Str
1579 nocode: gtk_toggle_button_new_with_label
1580 nocode: gtk_toggle_button_new_with_mnemonic
1582 code: start
1583         /**
1584          * Creates a new toggle button with a text label.
1585          * If mnemonic is true the label
1586          * will be created using gtk_label_new_with_mnemonic(), so underscores
1587          * in label indicate the mnemonic for the button.
1588          * label:
1589          * a string containing the message to be placed in the toggle button.
1590          * Returns:
1591          * a new toggle button.
1592          */
1593         public this (char[] label, bool mnemonic=true)
1594         {
1595                 if ( mnemonic )
1596                 {
1597                         // GtkWidget* gtk_toggle_button_new_with_mnemonic  (const gchar *label);
1598                         this(cast(GtkToggleButton*)gtk_toggle_button_new_with_mnemonic(Str.toStringz(label)) );
1599                 }
1600                 else
1601                 {
1602                         // GtkWidget* gtk_toggle_button_new_with_label  (const gchar *label);
1603                         this(cast(GtkToggleButton*)gtk_toggle_button_new_with_label(Str.toStringz(label)) );
1604                 }
1605         }
1606 code: end
1608 outFile: ToggleButton
1610 ###########################################################
1611 ### numeric/text Data Entry ###############################
1612 ###########################################################
1614 file: GtkEntry.html
1615 struct: GtkEntry
1616 class: Entry
1617 prefix: gtk_entry_
1618 prefix: gtk_
1619 import: glib.Str
1620 import: gtk.EntryCompletion
1621 structWrap: GtkEntryCompletion* EntryCompletion
1623 code: start
1624         public this (char[] text)
1625         {
1626                 this();
1627                 setText(text);
1628         }
1629         
1630         public this (char[] text, int max)
1631         {
1632                 this(max);
1633                 setText(text);
1634         }
1635 code: end
1637 outFile: Entry
1639 file: GtkEntryCompletion.html
1640 struct: GtkEntryCompletion
1641 class: EntryCompletion
1642 prefix: gtk_entry_completion_
1643 prefix: gtk_
1644 import: glib.Str
1645 import: gtk.Widget
1646 structWrap: GtkWidget* Widget
1647 import: gtk.TreeModel
1648 structWrap: GtkTreeModel* TreeModel
1649 outFile: EntryCompletion
1651 file: GtkHScale.html
1652 struct: GtkHScale
1653 class: HScale
1654 prefix: gtk_hscale_
1655 prefix: gtk_
1656 import: gtk.Adjustment
1657 structWrap: GtkAdjustment* Adjustment
1658 outFile: HScale
1660 file: GtkVScale.html
1661 struct: GtkVScale
1662 class: VScale
1663 prefix: gtk_vscale_
1664 prefix: gtk_
1665 import: gtk.Adjustment
1666 structWrap: GtkAdjustment* Adjustment
1667 outFile: VScale
1669 file: GtkSpinButton.html
1670 struct: GtkSpinButton
1671 class: SpinButton
1672 prefix: gtk_spin_button_
1673 prefix: gtk_
1674 import: gtk.Widget
1675 structWrap: GtkWidget* Widget
1676 import: gtk.Adjustment
1677 structWrap: GtkAdjustment* Adjustment
1678 outFile: SpinButton
1680 file: GtkEditable.html
1681 struct: GtkEditable
1682 class: Editable
1683 prefix: gtk_editable_
1684 prefix: gtk_
1685 import: glib.Str
1686 outFile: Editable
1688 ###########################################################
1689 ### Multiline Text Editor #################################
1690 ###########################################################
1692 file: gtk-GtkTextIter.html
1693 struct: GtkTextIter
1694 class: TextIter
1695 nostruct: GtkTextIter
1696 prefix: gtk_text_iter_
1697 prefix: gtk_
1698 import: glib.Str
1699 import: gtk.TextBuffer
1700 structWrap: GtkTextBuffer* TextBuffer
1701 import: gtk.TextIter
1702 structWrap: GtkTextIter* TextIter
1703 import: gdk.Pixbuf
1704 structWrap: GdkPixbuf* Pixbuf
1705 import: glib.ListSG
1706 structWrap: GSList* ListSG
1707 #import: gtk.TextChildAnchor
1708 #structWrap: GtkTextChildAnchor* TextChildAnchor
1709 import: gtk.TextTag
1710 structWrap: GtkTextTag* TextTag
1711 import: gtk.TextAttributes
1712 structWrap: GtkTextAttributes* TextAttributes
1713 import: gtk.TextChildAnchor
1714 structWrap: GtkTextChildAnchor* TextChildAnchor
1716 code: start
1717         public this()
1718         {
1719                 this(new GtkTextIter);
1720         }
1721         
1722 code: end
1723 outFile: TextIter
1725 file: GtkTextMark.html
1726 struct: GtkTextMark
1727 class: TextMark
1728 prefix: gtk_text_mark_
1729 prefix: gtk_
1730 import: glib.Str
1731 import: gtk.TextBuffer
1732 structWrap: GtkTextBuffer* TextBuffer
1733 outFile: TextMark
1735 file: GtkTextBuffer.html
1736 struct: GtkTextBuffer
1737 class: TextBuffer
1738 prefix: gtk_text_buffer_
1739 prefix: gtk_
1740 import: glib.Str
1741 import: gtk.TextBuffer
1742 structWrap: GtkTextBuffer* TextBuffer
1743 #import: gtk.TextMark
1744 #structWrap: GtkTextMark* TextMark
1745 #import: gtk.TextIter
1746 #structWrap: GtkTextIter* TextIter
1747 import: gdk.Rectangle
1748 structWrap: GdkRectangle* Rectangle
1749 import: gtk.Widget
1750 structWrap: GtkWidget* Widget
1751 import: pango.PgTabArray
1752 structWrap: PangoTabArray* PgTabArray
1753 import: gtk.TextAttributes
1754 structWrap: GtkTextAttributes* TextAttributes
1755 import: gtk.TextTagTable
1756 structWrap: GtkTextTagTable* TextTagTable
1757 import: gtk.TextIter
1758 structWrap: GtkTextIter* TextIter
1759 import: gtk.TextTag
1760 structWrap: GtkTextTag* TextTag
1761 import: gdk.Pixbuf
1762 structWrap: GdkPixbuf* Pixbuf
1763 import: gtk.TextChildAnchor
1764 structWrap: GtkTextChildAnchor* TextChildAnchor
1765 import: gtk.TextMark
1766 structWrap: GtkTextMark* TextMark
1767 import: gtk.Clipboard
1768 structWrap: GtkClipboard* Clipboard
1769 import: gdk.Bitmap
1770 structWrap: GdkBitmap* Bitmap
1771 import: std.stdarg
1775 nocode: gtk_text_buffer_set_text
1776 nocode: gtk_text_buffer_insert_with_tags
1777 nocode: gtk_text_buffer_insert_with_tags_by_name
1778 nocode: gtk_text_buffer_create_tag
1780 code: start
1782         /**
1783          * Deletes current contents of buffer, and inserts text instead. If
1784          * len is -1, text must be nul-terminated. text must be valid UTF-8.
1785          * buffer:
1786          *  a GtkTextBuffer
1787          * text:
1788          *  UTF-8 text to insert
1789          * len:
1790          *  length of text in bytes
1791          */
1792         public void setText(char[] text)
1793         {
1794                 // void gtk_text_buffer_set_text (GtkTextBuffer *buffer,  const gchar *text,  gint len);
1795                 gtk_text_buffer_set_text(gtkTextBuffer, Str.toStringz(text), text.length);
1796         }
1797         
1798                 /**
1799          * Inserts len bytes of text at position iter. If len is -1,
1800          * text must be nul-terminated and will be inserted in its
1801          * entirety. Emits the "insert_text" signal; insertion actually occurs
1802          * in the default handler for the signal. iter is invalidated when
1803          * insertion occurs (because the buffer contents change), but the
1804          * default signal handler revalidates it to point to the end of the
1805          * inserted text.
1806          * buffer:
1807          *  a GtkTextBuffer
1808          * iter:
1809          *  a position in the buffer
1810          * text:
1811          *  UTF-8 format text to insert
1812          * len:
1813          *  length of text in bytes, or -1
1814          */
1815         public void insert(TextIter iter, char[] text)
1816         {
1817                 // void gtk_text_buffer_insert (GtkTextBuffer *buffer,  GtkTextIter *iter,  const gchar *text,  gint len);
1818                 gtk_text_buffer_insert(gtkTextBuffer, (iter is null) ? null : iter.getTextIterStruct(), Str.toStringz(text), text.length);
1819         }
1820         
1821         /**
1822          * Simply calls gtk_text_buffer_insert(), using the current
1823          * cursor position as the insertion point.
1824          * buffer:
1825          *  a GtkTextBuffer
1826          * text:
1827          *  some text in UTF-8 format
1828          * len:
1829          *  length of text, in bytes
1830          */
1831         public void insertAtCursor(char[] text)
1832         {
1833                 // void gtk_text_buffer_insert_at_cursor  (GtkTextBuffer *buffer,  const gchar *text,  gint len);
1834                 gtk_text_buffer_insert_at_cursor(gtkTextBuffer, Str.toStringz(text), text.length);
1835         }
1836         
1837         /**
1838          * Like gtk_text_buffer_insert(), but the insertion will not occur if
1839          * iter is at a non-editable location in the buffer. Usually you
1840          * want to prevent insertions at ineditable locations if the insertion
1841          * results from a user action (is interactive).
1842          * default_editable indicates the editability of text that doesn't
1843          * have a tag affecting editability applied to it. Typically the
1844          * result of gtk_text_view_get_editable() is appropriate here.
1845          * buffer:
1846          *  a GtkTextBuffer
1847          * iter:
1848          *  a position in buffer
1849          * text:
1850          *  some UTF-8 text
1851          * len:
1852          *  length of text in bytes, or -1
1853          * default_editable:
1854          *  default editability of buffer
1855          * Returns:
1856          *  whether text was actually inserted
1857          */
1858         public int insertInteractive(TextIter iter, char[] text, int defaultEditable)
1859         {
1860                 // gboolean gtk_text_buffer_insert_interactive  (GtkTextBuffer *buffer,  GtkTextIter *iter,  const gchar *text,  gint len,  gboolean default_editable);
1861                 return gtk_text_buffer_insert_interactive(gtkTextBuffer, (iter is null) ? null : iter.getTextIterStruct(), Str.toStringz(text), text.length, defaultEditable);
1862         }
1863         
1864         /**
1865          * Calls gtk_text_buffer_insert_interactive() at the cursor
1866          * position.
1867          * default_editable indicates the editability of text that doesn't
1868          * have a tag affecting editability applied to it. Typically the
1869          * result of gtk_text_view_get_editable() is appropriate here.
1870          * buffer:
1871          *  a GtkTextBuffer
1872          * text:
1873          *  text in UTF-8 format
1874          * len:
1875          *  length of text in bytes, or -1
1876          * default_editable:
1877          *  default editability of buffer
1878          * Returns:
1879          *  whether text was actually inserted
1880          */
1881         public int insertInteractiveAtCursor(char[] text, int defaultEditable)
1882         {
1883                 // gboolean gtk_text_buffer_insert_interactive_at_cursor  (GtkTextBuffer *buffer,  const gchar *text,  gint len,  gboolean default_editable);
1884                 return gtk_text_buffer_insert_interactive_at_cursor(gtkTextBuffer, Str.toStringz(text), text.length, defaultEditable);
1885         }
1887         /**
1888          * Inserts text into buffer at iter, applying the list of tags to
1889          * the newly-inserted text. The last tag specified must be NULL to
1890          * terminate the list. Equivalent to calling gtk_text_buffer_insert(),
1891          * then gtk_text_buffer_apply_tag() on the inserted text;
1892          * gtk_text_buffer_insert_with_tags() is just a convenience function.
1893          * buffer:
1894          *  a GtkTextBuffer
1895          * iter:
1896          *  an iterator in buffer
1897          * text:
1898          *  UTF-8 text
1899          * len:
1900          *  length of text, or -1
1901          * first_tag:
1902          *  first tag to apply to text
1903          * ...:
1904          *  NULL-terminated list of tags to apply
1905          */
1906         //version(Tango){} else -- still doesn't work on tango, but it compiles now
1907         public void insertWithTags(TextIter iter, char[] text, ... )
1908         {
1909                 for (int i = 0; (i<_arguments.length) && (_arguments[i] == typeid(TextTag)); i++)
1910                 {
1911                         TextTag tag = va_arg!(TextTag)(_argptr);
1912                         // void gtk_text_buffer_insert_with_tags  (GtkTextBuffer *buffer,  GtkTextIter *iter,  const gchar *text,  gint len,  GtkTextTag *first_tag,  ...);
1913                         gtk_text_buffer_insert_with_tags(gtkTextBuffer, (iter is null) ? null : iter.getTextIterStruct(), Str.toStringz(text), text.length, (tag is null) ? null : tag.getTextTagStruct(), null);
1914                 }
1915         }
1916         
1917         /**
1918          * Same as gtk_text_buffer_insert_with_tags(), but allows you
1919          * to pass in tag names instead of tag objects.
1920          * buffer:
1921          *  a GtkTextBuffer
1922          * iter:
1923          *  position in buffer
1924          * text:
1925          *  UTF-8 text
1926          * len:
1927          *  length of text, or -1
1928          * first_tag_name:
1929          *  name of a tag to apply to text
1930          * ...:
1931          *  more tag names
1932          */
1933         // version(Tango){} else  -- still doesn't work on tango, but it compiles now 
1934         public void insertWithTagsByName(TextIter iter, char[] text, ... )
1935         {
1936                 for (int i = 0; (i<_arguments.length) && (_arguments[i] == typeid(char[])); i++)
1937                 {
1938                         char[] tagName = va_arg!(char[])(_argptr);
1939                         // void gtk_text_buffer_insert_with_tags_by_name  (GtkTextBuffer *buffer,  GtkTextIter *iter,  const gchar *text,  gint len,  const gchar *first_tag_name,  ...);
1940                         gtk_text_buffer_insert_with_tags_by_name(gtkTextBuffer, (iter is null) ? null : iter.getTextIterStruct(), Str.toStringz(text), text.length, Str.toStringz(tagName), null);
1941                 }
1942         }
1943         
1944         /**
1945          * Create a new tag for this buffer
1946          * @param tagName can be null for no name
1947          * @param propertyName
1948          * @param propertyValue
1949          */
1950         TextTag createTag(char[] tagName, char[] propertyName, int propertyValue, 
1951                                                                            char[] propertyName1, char[] propertyValue1)
1952         {
1953                 return new TextTag(
1954                         gtk_text_buffer_create_tag(gtkTextBuffer,
1955                                 Str.toStringz(tagName), 
1956                                 Str.toStringz(propertyName),propertyValue,
1957                                 Str.toStringz(propertyName1),
1958                                 Str.toStringz(propertyValue1),
1959                                         null)
1960                 );
1961                         
1962         }
1963         /**
1964          * Create a new tag for this buffer
1965          * @param tagName can be null for no name
1966          * @param propertyName
1967          * @param propertyValue
1968          */
1969         TextTag createTag(char[] tagName, char[] propertyName, int propertyValue)
1970         {
1971                 return new TextTag(
1972                         gtk_text_buffer_create_tag(gtkTextBuffer, 
1973                                 Str.toStringz(tagName),
1974                                 Str.toStringz(propertyName),propertyValue,null)
1975                 );
1976                         
1977         }
1979         /**
1980          * Create a new tag for this buffer
1981          * @param tagName can be null for no name
1982          * @param propertyName
1983          * @param propertyValue
1984          */
1985         TextTag createTag(char[] tagName, char[] propertyName, double propertyValue)
1986         {
1987                 return new TextTag(
1988                         gtk_text_buffer_create_tag(gtkTextBuffer, Str.toStringz(tagName), Str.toStringz(propertyName),propertyValue,null)
1989                 );
1990                         
1991         }
1992         
1993         /**
1994          * Create a new tag for this buffer
1995          * @param tagName can be null for no name
1996          * @param propertyName
1997          * @param propertyValue
1998          * @param propertyName2
1999          * @param propertyValue2
2000          */
2001         TextTag createTag(char[] tagName, char[] propertyName, int propertyValue, char[] propertyName2, int propertyValue2)
2002         {
2003                 return new TextTag(
2004                         gtk_text_buffer_create_tag(gtkTextBuffer, Str.toStringz(tagName), Str.toStringz(propertyName), propertyValue, Str.toStringz(propertyName2), propertyValue2, null)
2005                 );
2006         }
2008         TextTag createTag(char[] tagName, char[] propertyName, int propertyValue, char[] propertyName2, int propertyValue2, char[] propertyName3, int propertyValue3, char[] propertyName4, int propertyValue4, char[] propertyName5, int propertyValue5)
2009         {
2010                 return new TextTag(
2011                         gtk_text_buffer_create_tag(gtkTextBuffer, Str.toStringz(tagName), Str.toStringz(propertyName), propertyValue, Str.toStringz(propertyName2), propertyValue2, Str.toStringz(propertyName3), propertyValue3, Str.toStringz(propertyName4), propertyValue4, Str.toStringz(propertyName5), propertyValue5, null)
2012                 );
2013         }
2014         /**
2015          * Create a new tag for this buffer
2016          * @param tagName can be null for no name
2017          * @param propertyName
2018          * @param propertyValue
2019          */
2020         TextTag createTag(char[] tagName, char[] propertyName, char[] propertyValue)
2021         {
2022                 return new TextTag(
2023                         gtk_text_buffer_create_tag(gtkTextBuffer, Str.toStringz(tagName), Str.toStringz(propertyName),Str.toStringz(propertyValue),null)
2024                 );
2025                         
2026         }
2028         /**
2029          * Create a new tag for this buffer
2030          * @param tagName can be null for no name
2031          * @param propertyName
2032          * @param propertyValue
2033          * @return 
2034          */
2035         TextTag createTag(char[] tagName, char[] propertyName, Bitmap propertyValue)
2036         {
2037                 return new TextTag(
2038                         gtk_text_buffer_create_tag(gtkTextBuffer, Str.toStringz(tagName), Str.toStringz(propertyName),propertyValue.getBitmapStruct(),null)
2039                 );
2040                         
2041         }
2043         /**
2044          * Obtain the entire text 
2045          * @return The text char[]
2046          */
2047         char[] getText()
2048         {
2049                 TextIter start = new TextIter();
2050                 TextIter end = new TextIter();
2051                 getBounds(start,end);
2052                 return Str.toString(gtk_text_buffer_get_slice(gtkTextBuffer, start.getTextIterStruct(), end.getTextIterStruct(), true));
2053         }
2055         /**
2056          * Create a new tag for this buffer
2057          * @param tagName can be null for no name
2058          * @param propertyName
2059          * @param propertyValue
2060          * @param propertyName2
2061          * @param propertyValue2
2062          */
2063         TextTag createTag(char[] tagName, 
2064                         char[] propertyName, char[] propertyValue, 
2065                         char[] propertyName2, int propertyValue2)
2066         {
2067                 return new TextTag(
2068                 gtk_text_buffer_create_tag(gtkTextBuffer, Str.toStringz(tagName), 
2069                         Str.toStringz(propertyName), Str.toStringz(propertyValue), 
2070                         Str.toStringz(propertyName2), propertyValue2, null)
2071                 );
2072         }
2073         
2075 code: end
2077 outFile: TextBuffer
2079 file: GtkTextTag.html
2081 struct: GtkTextTag
2082 class: TextTag
2083 prefix: gtk_text_tag_
2084 noprefix: gtk_text_attributes_
2085 prefix: gtk_
2086 import: glib.Str
2087 import: gobject.ObjectG
2088 structWrap: GObject* ObjectG
2089 import: gdk.Event
2090 structWrap: GdkEvent* Event
2091 import: gtk.TextIter
2092 structWrap: GtkTextIter* TextIter
2093 outFile: TextTag
2095 struct: GtkTextAttributes
2096 class: TextAttributes
2097 prefix: gtk_text_attributes_
2098 strictPrefix: Y
2099 import: gtk.TextAttributes
2100 structWrap: GtkTextAttributes* TextAttributes
2101 outFile: TextAttributes
2103 file: GtkTextTagTable.html
2104 struct: GtkTextTagTable
2105 class: TextTagTable
2106 prefix: gtk_text_tag_
2107 prefix: gtk_
2108 import: glib.Str
2109 import: gtk.TextTagTable
2110 structWrap: GtkTextTagTable* TextTagTable
2111 import: gtk.TextTag
2112 structWrap: GtkTextTag* TextTag
2113 outFile: TextTagTable
2115 file: GtkTextView.html
2117 struct: GtkTextView
2118 class: TextView
2119 prefix: gtk_text_view_
2120 prefix: gtk_
2121 noprefix: gtk_text_child_anchor_
2122 import: glib.Str
2123 import: gtk.TextBuffer
2124 structWrap: GtkTextBuffer* TextBuffer
2125 import: gtk.TextMark
2126 structWrap: GtkTextMark* TextMark
2127 import: gtk.TextIter
2128 structWrap: GtkTextIter* TextIter
2129 import: gdk.Rectangle
2130 structWrap: GdkRectangle* Rectangle
2131 import: gtk.Widget
2132 structWrap: GtkWidget* Widget
2133 import: pango.PgTabArray
2134 structWrap: PangoTabArray* PgTabArray
2135 import: gtk.TextAttributes
2136 structWrap: GtkTextAttributes* TextAttributes
2137 import: gdk.Window
2138 structWrap: GdkWindow* Window
2139 import: gtk.TextChildAnchor
2140 structWrap: GtkTextChildAnchor* TextChildAnchor
2141 import: glib.ListG
2142 structWrap: GList* ListG
2144 #text: start
2145 #gtk_text_view_get_type ()
2147 #GType         gtk_text_view_get_type           ();
2148 #<hr>
2149 #text: end
2152 code: start
2154         /**
2155          * Get the text line at the pixel y
2156          */
2157         char[] getLineTextAt(gint y)
2158         {
2159                 
2160                 TextIter iter = new TextIter();
2161                 int windowX;
2162                 int windowY;
2163                 bufferToWindowCoords(TextWindowType.TEXT, 0, y, &windowX, &windowY);
2165                 gtk_text_view_get_line_at_y(gtkTextView, iter.getTextIterStruct(), y+y-windowY, null);
2166                 
2167                 TextIter iterEnd = new TextIter();
2168                 TextBuffer buffer = getBuffer();
2169                 buffer.getIterAtOffset(iterEnd, iter.getOffset()+iter.getCharsInLine());
2170                 return buffer.getText(iter, iterEnd, false);
2171         }
2173         /**
2174          * Simply appends some on the cursor position
2175          * @param text the text to append
2176          */
2177         void insertText(char[] text)
2178         {
2179                 TextBuffer buf = getBuffer();
2180                 buf.insertAtCursor(text);
2181         }
2183         /**
2184          * Simply appends some text to this view
2185          * @param text the text to append
2186          */
2187         void appendText(char[] text, bool ensureVisible=true)
2188         body
2189         {
2190                 TextBuffer buf = getBuffer();
2191                 TextIter iter = new TextIter();
2192                 buf.getEndIter(iter);
2193                 buf.insert(iter, text);
2194                 if ( ensureVisible )
2195                 {
2196                         gdouble within_margin = 0.0;
2197                         bool use_align = false;
2198                         gdouble xalign = 0.0;
2199                         gdouble yalign = 0.0;
2200                         scrollToMark(buf.createMark("",iter,true), within_margin, use_align, xalign, yalign);
2201                 }
2202         }
2205 code: end
2207 outFile: TextView
2209 struct: GtkTextChildAnchor
2210 class: TextChildAnchor
2211 import: glib.Str
2212 prefix: gtk_text_child_anchor_
2213 strictPrefix: Y
2214 outFile: TextChildAnchor
2216 ###########################################################
2217 ### Tree, List and Icon Grid Widgets ######################
2218 ###########################################################
2220 file: GtkTreeModel.html
2222 struct: GtkTreeModel
2223 class: TreeModel
2224 prefix: gtk_tree_model_
2225 noprefix: gtk_tree_row_reference_
2226 noprefix: gtk_tree_path_
2227 noprefix: gtk_tree_iter_
2228 import: glib.Str
2229 #noprefix: gtk_
2230 import: gtk.TreeIter
2231 structWrap: GtkTreeIter* TreeIter
2232 import: gtk.TreePath
2233 structWrap: GtkTreePath* TreePath
2234 import: gobject.Value
2235 structWrap: GValue* Value
2237 interfaceCode: start
2238         /**
2239          * Get the value of a column as a char array.
2240          * this is the same calling getValue and get the string from the value object
2241          */
2242         char[] getValueString(TreeIter iter, int column);
2244         /**
2245          * Get the value of a column as a char array.
2246          * this is the same calling getValue and get the int from the value object
2247          */
2248         int getValueInt(TreeIter iter, int column);
2250         void setValue(TreeIter iter, int column, char[] value);
2252         void setValue(TreeIter iter, int column, int value);
2254 interfaceCode: end
2256 nocode: gtk_tree_model_get_iter
2258 code: start
2259         /**
2260          * Get the value of a column as a char array.
2261          * this is the same calling getValue and get the string from the value object
2262          */
2263         char[] getValueString(TreeIter iter, int column)
2264         {
2265                 Value value = new Value();
2266                 getValue(iter, column, value);
2267                 return value.getString();
2268         }
2270         /**
2271          * Get the value of a column as a char array.
2272          * this is the same calling getValue and get the int from the value object
2273          */
2274         int getValueInt(TreeIter iter, int column)
2275         {
2276                 Value value = new Value();
2277                 getValue(iter, column, value);
2278                 return value.getInt();
2279         }
2281                 /**
2282          * Sets iter to a valid iterator pointing to path.
2283          * tree_model:
2284          *  A GtkTreeModel.
2285          * iter:
2286          *  The uninitialized GtkTreeIter.
2287          * path:
2288          *  The GtkTreePath.
2289          * Returns:
2290          *  TRUE, if iter was set.
2291          */
2292         public int getIter(TreeIter iter, TreePath path)
2293         {
2294                 // gboolean gtk_tree_model_get_iter (GtkTreeModel *tree_model,  GtkTreeIter *iter,  GtkTreePath *path);
2295                 iter.setModel(this);
2296                 return gtk_tree_model_get_iter(gtkTreeModel, (iter is null) ? null : iter.getTreeIterStruct(), (path is null) ? null : path.getTreePathStruct());
2297         }
2299 code: end
2301 #interface: TreeModelIF
2302 outFile: TreeModel
2304 struct: GtkTreeIter
2305 class: TreeIter
2306 strictPrefix: Y
2307 prefix: gtk_tree_iter_
2308 #prefix: gtk_
2309 import: glib.Str
2310 import: gtk.TreeIter
2311 structWrap: GtkTreeIter* TreeIter
2312 import: gtk.TreeModel
2313 import: gtk.TreePath
2314 import: gtk.TreeIterError
2315 import: gobject.Value;
2317 code: start
2319         /**
2320          * this will be set only when the iter
2321          * is created from the model.
2322          */
2323         GtkTreeModel *gtkTreeModel; 
2325         public void setModel(GtkTreeModel *gtkTreeModel)
2326         {
2327                 this.gtkTreeModel = gtkTreeModel;
2328         }
2329        
2330         public void setModel(TreeModel treeModel)
2331         {
2332                 this.gtkTreeModel = treeModel.getTreeModelStruct();
2333         }
2334            
2335         public this(TreeModel treeModel, TreePath treePath)
2336         {
2337                 this();
2338                 setModel(treeModel);
2339                 if ( gtk_tree_model_get_iter_from_string(
2340                                 treeModel.getTreeModelStruct(),
2341                                 getTreeIterStruct(), Str.toStringz(treePath.toString())) )
2342                 {
2343                         // ???
2344                 }
2345         }
2346         
2347         /**
2348         * creates a new tree iteractor.
2349         * used TreeView.createIter and TreeView.append() to create iteractor for a tree or list
2350         */
2351         this()
2352         {
2353                 this(new GtkTreeIter);
2354         }
2356         
2357         /**
2358          * Get Value
2359          * @param iter
2360          * @param column
2361          * @param value
2362          */
2363         void getValue(int column, Value value)
2364         {
2365                 if ( gtkTreeModel  is  null )
2366                 {
2367                         throw new TreeIterError("getValue","Tree model not set");
2368                 }
2369                 gtk_tree_model_get_value(gtkTreeModel, gtkTreeIter, column, value.getValueStruct());
2370         }
2372         /**
2373          * Get the value of a column as a string
2374          * @para column the column number
2375          * @return a string representing the value of the column
2376          */
2377         char[] getValueString(int column)
2378         {
2379                 if ( gtkTreeModel  is  null )
2380                 {
2381                         throw new TreeIterError("getValueString","Tree model not set");
2382                 }
2383                 Value value = new Value();
2384                 gtk_tree_model_get_value(gtkTreeModel, gtkTreeIter, column, value.getValueStruct());
2385                 //printf("TreeIter.getValuaString = %.*s\n", value.getString().toString());
2386                 return value.getString();
2387         }
2389         /**
2390          * Get the value of a column as an int
2391          * @para column the column number
2392          * @return a string representing the value of the column
2393          */
2394         int getValueInt(int column)
2395         {
2396                 if ( gtkTreeModel  is  null )
2397                 {
2398                         throw new TreeIterError("getValueInt", "Tree model not set");
2399                 }
2400                 Value value = new Value();
2401                 gtk_tree_model_get_value(gtkTreeModel, gtkTreeIter, column, value.getValueStruct());
2402                 return value.getInt();
2403         }
2405         TreePath getTreePath()
2406         {
2407                 if ( gtkTreeModel  is  null )
2408                 {
2409                         throw new TreeIterError("getTreePath","Tree model not set");
2410                 }
2411                 return new TreePath(gtk_tree_model_get_path(gtkTreeModel, gtkTreeIter));
2412         }
2414                 /**
2415          * This return the path visible to the user.
2416          */
2417         char[] getVisiblePath(char[] separator)
2418         {
2419                 char[] vPath;
2420                 if ( gtkTreeModel  is  null )
2421                 {
2422                         throw new TreeIterError("getVisiblePath", "Tree model not set");
2423                 }
2425                 vPath = getValueString(0);
2426                 TreeIter parent = getParent();
2427                 while ( parent !is  null )
2428                 {
2429                         //printf("TreeIter.getVisiblePath parent = %.*s\n",parent.getValueString(0).toString());
2430                         vPath = parent.getValueString(0) ~ separator ~ vPath;
2431                         parent = parent.getParent();
2432                 }
2433                 
2434                 //printf("TreeIter.getVisiblePath = %.*s\n", vPath.toString());
2435                 
2436                 return vPath;
2437         }
2438         
2439         /**
2440          * Gets the parent of this iter
2441          * @param child
2442          * @return the parent iter or null if can't get parent or an error occured
2443          */
2444         TreeIter getParent()
2445         {
2446                 if ( gtkTreeModel  is  null )
2447                 {
2448                         throw new TreeIterError("getParent", "Tree model not set");
2449                 }
2450                 TreeIter parent = new TreeIter();
2451                 bool gotParent = gtk_tree_model_iter_parent(gtkTreeModel, parent.getTreeIterStruct(), gtkTreeIter) == 0 ? false : true;
2452                 if ( !gotParent )
2453                 {
2454                         return null;
2455                 }
2456                 parent.setModel(gtkTreeModel);
2457                 return parent;
2458         }
2461         TreeIter getGrandParent()
2462         {
2463                 if ( gtkTreeModel  is  null )
2464                 {
2465                         throw new TreeIterError("getGrandParent", "Tree model not set");
2466                 }
2467                 TreeIter grandParent = this;
2468                 TreeIter parent = grandParent.getParent();
2469                 while ( parent !is null )
2470                 {
2471                         grandParent = parent;
2472                         parent = grandParent.getParent();
2473                 }
2474                 
2475                 return grandParent;
2476         }
2480         
2482 code: end
2484 outFile: TreeIter
2488 struct: GtkTreePath
2489 class: TreePath
2490 strictPrefix: Y
2491 prefix: gtk_tree_path_
2492 #prefix: gtk_
2493 import: glib.Str
2494 import: gtk.TreePath
2495 structWrap: GtkTreePath* TreePath
2496 import: glib.Str
2498 nocode: gtk_tree_path_new
2499 nocode: gtk_tree_path_new_first
2501 code: start
2502         /**
2503          * Creates a new GtkTreePath. This structure refers to a row.
2504          * if firstRow is true this is the string representation of this path is "0"
2505          * Returns:
2506          *  A newly created GtkTreePath.
2507          */
2508         public this (bool firstRow=false)
2509         {
2510                 if ( firstRow )
2511                 {
2512                         // GtkTreePath* gtk_tree_path_new_first (void);
2513                         this(cast(GtkTreePath*)gtk_tree_path_new_first() );
2514                 }
2515                 else
2516                 {
2517                         // GtkTreePath* gtk_tree_path_new (void);
2518                         this(cast(GtkTreePath*)gtk_tree_path_new() );
2519                 }
2520         }
2521 code: end
2522 outFile: TreePath
2524 struct: GtkTreeRowReference
2525 class: TreeRowReference
2526 strictPrefix: Y
2527 prefix: gtk_tree_row_reference_
2528 #prefix: gtk_
2529 import: gtk.TreeModel
2530 structWrap: GtkTreeModel* TreeModel
2531 import: gtk.TreePath
2532 structWrap: GtkTreePath* TreePath
2533 import: gobject.ObjectG
2534 structWrap: GObject* ObjectG
2535 #import: gtk.TreeRowReference
2536 #structWrap: GtkTreeRowReference* TreeRowReference
2537 import: gtk.TreeIter
2538 structWrap: GtkTreeIter* TreeIter
2539 outFile: TreeRowReference
2541 file:
2542 class: TreeIterError
2543 extend: Exception
2544 import(tango): tango.core.Exception
2546 code: start
2548  * A TreeIter error.
2549  * thrown<br>
2550  * - trying to access a method that requires a tree model and the tree model was never set
2551  */
2552         public this(char[] method, char[] message)
2553         {
2554                 super("TreeIter."~method~" : "~message);
2555         }
2557 code: end
2558 outFile: TreeIterError
2561 file: GtkTreeSelection.html
2562 struct: GtkTreeSelection
2563 class: TreeSelection
2564 prefix: gtk_tree_selection_
2565 prefix: gtk_
2566 import: gtk.TreeView
2567 structWrap: GtkTreeView* TreeView
2568 #import: gtk.TreeModel*
2569 #structWrap: GtkTreeModel** TreeModel*
2570 import: gtk.TreeIter
2571 structWrap: GtkTreeIter* TreeIter
2572 import: glib.ListG
2573 structWrap: GList* ListG
2574 import: gtk.TreePath
2575 structWrap: GtkTreePath* TreePath
2576 import: gtk.TreeModel
2577 import: gtk.TreeIter
2579 nocode: gtk_tree_selection_get_selected
2580 nocode: gtk_tree_selection_get_selected_rows
2582 code: start
2583         /**
2584          * Sets iter to the currently selected node if selection is set to
2585          * GTK_SELECTION_SINGLE or GTK_SELECTION_BROWSE. iter may be NULL if you
2586          * just want to test if selection has any selected nodes. model is filled
2587          * with the current model as a convenience. This function will not work if you
2588          * use selection is GTK_SELECTION_MULTIPLE.
2589          * selection:
2590          *  A GtkTreeSelection.
2591          * model:
2592          *  A pointer to set to the GtkTreeModel, or NULL.
2593          * iter:
2594          *  The GtkTreeIter, or NULL.
2595          * Returns:
2596          *  TRUE, if there is a selected node.
2597          */
2598         int getSelected(TreeModel model, TreeIter iter)
2599         {
2600                 GtkTreeModel* m = model.getTreeModelStruct();
2601                 return gtk_tree_selection_get_selected(gtkTreeSelection, &m, iter.getTreeIterStruct())==0 ? false : true;
2602         }
2603         
2604         /**
2605          * Creates a list of path of all selected rows. Additionally, if you are
2606          * planning on modifying the model after calling this function, you may
2607          * want to convert the returned list into a list of GtkTreeRowReferences.
2608          * To do this, you can use gtk_tree_row_reference_new().
2609          * To free the return value, use:
2610          * g_list_foreach (list, gtk_tree_path_free, NULL);
2611          * g_list_free (list);
2612          * selection:
2613          *  A GtkTreeSelection.
2614          * model:
2615          *  A pointer to set to the GtkTreeModel, or NULL.
2616          * Returns:
2617          *  A GList containing a GtkTreePath for each selected row.
2618          * Since 2.2
2619          */
2620         TreePath[] getSelectedRows(TreeModel model)
2621         {
2622                 TreePath[] paths;
2623                 GtkTreeModel* m = model.getTreeModelStruct();
2624                 GList* gList = gtk_tree_selection_get_selected_rows(gtkTreeSelection, &m);
2625                 if ( gList !is null )
2626                 {  
2627                         ListG list = new ListG(gList);
2628                         for ( int i=0 ; i<list.length() ; i++ )
2629                         {
2630                                 paths ~= new TreePath(cast(GtkTreePath*)list.nthData(i));
2631                         }
2632                 }
2633                 return paths;
2634         }
2636 code: end
2639 outFile: TreeSelection
2641 file: GtkTreeViewColumn.html
2642 struct: GtkTreeViewColumn
2643 class: TreeViewColumn
2644 prefix: gtk_tree_view_column_
2645 prefix: gtk_
2646 import: glib.Str
2647 import: gtk.CellRenderer
2648 structWrap: GtkCellRenderer* CellRenderer
2649 import: glib.ListG
2650 structWrap: GList* ListG
2651 import: gtk.Widget
2652 structWrap: GtkWidget* Widget
2653 import: gtk.TreeModel
2654 structWrap: GtkTreeModel* TreeModel
2655 import: gtk.TreeIter
2656 structWrap: GtkTreeIter* TreeIter
2657 import: gdk.Rectangle
2658 structWrap: GdkRectangle* Rectangle
2659 import: glib.Str
2660 nocode: gtk_tree_view_column_new_with_attributes
2662 code: start
2663         /**
2664          * Creates a new Tree view column
2665          * @param header th column header text
2666          * @param renderer the rederer for the column cells
2667          * @param type the type of data to be displayed (shouldn't this be on the renderer?)
2668          * @param column the column number
2669          */
2670         this(char [] header, CellRenderer renderer, char [] type, int column)
2671         {
2672                 this(gtk_tree_view_column_new_with_attributes(
2673                                 Str.toStringz(header), 
2674                                 renderer.getCellRendererStruct(), 
2675                                 Str.toStringz(type),
2676                                 column,
2677                                 null)
2678                         );
2679         }
2682 code: end
2684 outFile: TreeViewColumn
2686 file: GtkTreeView.html
2687 struct: GtkTreeView
2688 class: TreeView
2689 prefix: gtk_tree_view_
2690 prefix: gtk_
2691 import: glib.Str
2692 import: gtk.TreeModel
2693 structWrap: GtkTreeModel* TreeModel
2694 import: gtk.TreeSelection
2695 structWrap: GtkTreeSelection* TreeSelection
2696 import: gtk.Adjustment
2697 structWrap: GtkAdjustment* Adjustment
2698 import: gtk.TreeViewColumn
2699 structWrap: GtkTreeViewColumn* TreeViewColumn
2700 import: gtk.CellRenderer
2701 structWrap: GtkCellRenderer* CellRenderer
2702 import: glib.ListG
2703 structWrap: GList* ListG
2704 import: gtk.TreePath
2705 structWrap: GtkTreePath* TreePath
2706 #import: gtk.TreePath*
2707 #structWrap: GtkTreePath** TreePath*
2708 #import: gtk.TreeViewColumn*
2709 #structWrap: GtkTreeViewColumn** TreeViewColumn*
2710 import: gdk.Rectangle
2711 structWrap: GdkRectangle* Rectangle
2712 import: gdk.Window
2713 structWrap: GdkWindow* Window
2714 #import: gtk.TargetEntry
2715 #structWrap: GtkTargetEntry* TargetEntry
2716 #import: gtk.TreeViewDropPosition
2717 #structWrap: GtkTreeViewDropPosition* TreeViewDropPosition
2718 import: gdk.Pixmap
2719 structWrap: GdkPixmap* Pixmap
2720 import: gtk.TreeIter
2722 code: start
2723         /**
2724          * Expands the row of the iter.
2725          * @param iter
2726          * @param openAll
2727          * @return
2728          */
2729         int expandRow(TreeIter iter, TreeModel model, int openAll)
2730         {
2731                 return expandRow(model.getPath(iter), openAll);
2732         }
2734                 /**
2735          * Finds the path at the point (x, y), relative to widget coordinates. That
2736          * is, x and y are relative to an events coordinates. x and y must come
2737          * from an event on the tree_view only where event->window ==
2738          * gtk_tree_view_get_bin (). It is primarily for things
2739          * like popup menus. If path is non-NULL, then it will be filled with the
2740          * GtkTreePath at that point. This path should be freed with gtk_tree_path_free().
2741          * If column is non-NULL, then it will be filled with the column at that point.
2742          * cell_x and cell_y return the coordinates relative to the cell background
2743          * (i.e. the background_area passed to gtk_cell_renderer_render()). This
2744          * function is only meaningful if tree_view is realized.
2745          * tree_view:
2746          *  A GtkTreeView.
2747          * x:
2748          *  The x position to be identified.
2749          * y:
2750          *  The y position to be identified.
2751          * path:
2752          *  A pointer to a GtkTreePath pointer to be filled in, or NULL
2753          * column:
2754          *  A pointer to a GtkTreeViewColumn pointer to be filled in, or NULL
2755          * cell_x:
2756          *  A pointer where the X coordinate relative to the cell can be placed, or NULL
2757          * cell_y:
2758          *  A pointer where the Y coordinate relative to the cell can be placed, or NULL
2759          * Returns:
2760          *  TRUE if a row exists at that coordinate.
2761          */
2762         int getPathAtPos(gint x, gint y, inout TreePath path, inout TreeViewColumn column, out gint cellX, out gint cellY)
2763         {
2764                 GtkTreePath* p = path.getTreePathStruct();
2765                 GtkTreeViewColumn* c = column.getTreeViewColumnStruct();
2767                 int result = gtk_tree_view_get_path_at_pos(gtkTreeView, x, y, &p, &c, &cellX, &cellY)
2768                         == 0 ? false : true;
2770                 path = new TreePath(p);
2771                 column = new TreeViewColumn(c);
2773                 return result;
2774         }
2775         
2777         
2778         /**
2779          * gets the first selected iter or null if no rows are selected
2780          */
2781         TreeIter getSelectedIter()
2782         {
2783                 TreeIter iter = new TreeIter();
2784                 TreeSelection selection = getSelection();
2785                 TreeModel model = getModel();
2786                 TreePath[] paths = selection.getSelectedRows(model);
2787                 if ( paths.length > 0 )
2788                 {
2789                         model.getIter(iter,paths[0]);
2790                 }
2791                 return iter;
2792         }
2793         
2794         TreeIter[] getSelectedIters()
2795         {
2796                 TreeIter[] iters;
2797                 
2798                 TreeIter iter = new TreeIter();
2799                 TreeSelection selection = getSelection();
2800                 TreeModel model = getModel();
2801                 TreePath[] paths = selection.getSelectedRows(model);
2802                 foreach ( TreePath p; selection.getSelectedRows(model) )
2803                 {
2804                         //iters.length = iters.length+1;
2805                         //iters[iters.length-1] = model.getIter(iter,p);
2806                         // iters ~= model.getIter(iter,p); >>> compile error can only concatenate arrays ???
2807                         if ( model.getIter(iter,p) )
2808                         {
2809                                 iters ~= iter;
2810                                 iter = new TreeIter();
2811                         }
2812                 }
2813                 
2814                 //printf("TreeView.getSelectedIters iters.lenght = %d\n", iters.length);
2815                 return iters;
2816         }
2818         /**
2819          * Inserts a column and sets it's attributes
2820          * @param position
2821          * @param title
2822          * @param renderer
2823          * @param editable
2824          * @return number of columns including the new one
2825          */
2826         gint insertEditableColumn(int position, char[] title, CellRenderer renderer, bool editable)
2827         {
2828                 // OK, this is a trick because of my ignorance on how to pass variable argument lists
2829                 if ( position < 0 )
2830                 {
2831                         position = getColumns().length();
2832                 }
2833                 int tot = gtk_tree_view_insert_column_with_attributes(
2834                         gtkTreeView, 
2835                         position, 
2836                         Str.toStringz(title),
2837                         renderer.getCellRendererStruct(),
2838                         Str.toStringz("text"),position,//v1.getV(),
2839                         Str.toStringz("editable"),2,0);//v.getV(),0);
2840                 return tot;
2841         }
2844         
2845 code: end
2847 outFile: TreeView
2849 file: gtk-GtkTreeView-drag-and-drop.html
2850 struct: GtkTreeDragSource
2851 class: TreeDragSource
2852 prefix: gtk_tree_drag_
2853 prefix: gtk_
2854 import: gtk.TreePath
2855 structWrap: GtkTreePath* TreePath
2856 #import: gtk.SelectionData
2857 #structWrap: GtkSelectionData* SelectionData
2858 #import: gtk.TreeDragDest
2859 #structWrap: GtkTreeDragDest* TreeDragDest
2860 import: gtk.TreeModel
2861 structWrap: GtkTreeModel* TreeModel
2862 outFile: TreeDragSource
2864 file: GtkCellView.html
2865 struct: GtkCellView
2866 class: CellView
2867 prefix: gtk_cell_view_
2868 prefix: gtk_
2869 import: glib.Str
2870 import: gdk.Pixbuf
2871 structWrap: GdkPixbuf* Pixbuf
2872 import: gtk.TreeModel
2873 structWrap: GtkTreeModel* TreeModel
2874 import: gtk.TreePath
2875 structWrap: GtkTreePath* TreePath
2876 #import: gtk.Requisition
2877 #structWrap: GtkRequisition* Requisition
2878 import: gdk.Color
2879 structWrap: GdkColor* Color
2880 import: glib.ListG
2881 structWrap: GList* ListG
2883 nocode: gtk_cell_view_new_with_text
2884 nocode: gtk_cell_view_new_with_markup
2886 code: start
2887         /**
2888          * Creates a new GtkCellView widget, adds a GtkCellRendererText
2889          * to it, and makes its show text.
2890          * If markup is true the text can be marked up with the Pango text
2891          * markup language.
2892          * text:
2893          *  the text to display in the cell view
2894          * Returns:
2895          *  A newly created GtkCellView widget.
2896          * Since 2.6
2897          */
2898         public this (char[] text, bool markup=true)
2899         {
2900                 if ( markup )
2901                 {
2902                         // GtkWidget* gtk_cell_view_new_with_markup (const gchar *markup);
2903                         this(cast(GtkCellView*)gtk_cell_view_new_with_markup(Str.toStringz(text)) );
2904                 }
2905                 else
2906                 {
2907                         // GtkWidget* gtk_cell_view_new_with_text (const gchar *text);
2908                         this(cast(GtkCellView*)gtk_cell_view_new_with_text(Str.toStringz(text)) );
2909                 }
2910         }
2911 code: end
2913 outFile: CellView
2915 file: GtkIconView.html
2916 struct: GtkIconView
2917 class: IconView
2918 prefix: gtk_icon_view_
2919 prefix: gtk_
2920 import: gtk.TreeModel
2921 structWrap: GtkTreeModel* TreeModel
2922 import: gtk.TreePath
2923 structWrap: GtkTreePath* TreePath
2924 #import: gtk.TreePath*
2925 #structWrap: GtkTreePath** TreePath*
2926 #import: gtk.CellRenderer*
2927 #structWrap: GtkCellRenderer** CellRenderer*
2928 import: gtk.CellRenderer
2929 structWrap: GtkCellRenderer* CellRenderer
2930 import: glib.ListG
2931 structWrap: GList* ListG
2932 #import: gtk.TargetEntry
2933 #structWrap: GtkTargetEntry* TargetEntry
2934 #import: gtk.IconViewDropPosition
2935 #structWrap: GtkIconViewDropPosition* IconViewDropPosition
2936 import: gdk.Pixmap
2937 structWrap: GdkPixmap* Pixmap
2938 outFile: IconView
2940 file: GtkTreeSortable.html
2941 struct: GtkTreeSortable
2942 class: TreeSortable
2943 prefix: gtk_tree_sortable_
2944 prefix: gtk_
2945 #import: gtk.SortType
2946 #structWrap: GtkSortType* SortType
2947 outFile: TreeSortable
2949 file: GtkTreeModelSort.html
2950 struct: GtkTreeModelSort
2951 class: TreeModelSort
2952 import: glib.Str
2953 prefix: gtk_tree_model_sort_
2954 prefix: gtk_
2955 import: gtk.TreeModel
2956 structWrap: GtkTreeModel* TreeModel
2957 import: gtk.TreePath
2958 structWrap: GtkTreePath* TreePath
2959 import: gtk.TreeIter
2960 structWrap: GtkTreeIter* TreeIter
2961 outFile: TreeModelSort
2963 file: GtkTreeModelFilter.html
2964 struct: GtkTreeModelFilter
2965 class: TreeModelFilter
2966 prefix: gtk_tree_model_filter_
2967 prefix: gtk_
2968 import: gtk.TreeModel
2969 structWrap: GtkTreeModel* TreeModel
2970 import: gtk.TreePath
2971 structWrap: GtkTreePath* TreePath
2972 #import: gobject.Type
2973 #structWrap: GType* Type
2974 import: gtk.TreeIter
2975 structWrap: GtkTreeIter* TreeIter
2976 outFile: TreeModelFilter
2978 file: GtkCellLayout.html
2979 struct: GtkCellLayout
2980 class: CellLayoutT
2981 template: TStruct
2982 prefix: gtk_cell_layout_
2983 prefix: gtk_
2984 import: glib.Str
2985 import: gtk.CellRenderer
2986 structWrap: GtkCellRenderer* CellRenderer
2987 import: glib.Str
2988 interface: CellLayoutIF
2989 outFile: CellLayoutT
2991 file: GtkCellRenderer.html
2992 struct: GtkCellRenderer
2993 class: CellRenderer
2994 prefix: gtk_cell_renderer_
2995 prefix: gtk_
2996 import: glib.Str
2997 import: gtk.Widget
2998 structWrap: GtkWidget* Widget
2999 import: gdk.Rectangle
3000 structWrap: GdkRectangle* Rectangle
3001 import: gdk.Window
3002 structWrap: GdkWindow* Window
3003 import: gdk.Event
3004 structWrap: GdkEvent* Event
3005 import: gtk.CellEditable
3006 structWrap: GtkCellEditable* CellEditable
3007 outFile: CellRenderer
3009 file: GtkCellEditable.html
3010 struct: GtkCellEditable
3011 class: CellEditable
3012 prefix: gtk_cell_editable_
3013 prefix: gtk_
3014 import: gdk.Event
3015 structWrap: GdkEvent* Event
3016 outFile: CellEditable
3018 file: GtkCellRendererCombo.html
3019 struct: GtkCellRenderer
3020 realStruct: GtkCellRendererCombo
3021 class: CellRendererCombo
3022 prefix: gtk_cell_renderer_combo_
3023 prefix: gtk_
3024 import: gtk.CellRenderer
3025 structWrap: GtkCellRenderer* CellRenderer
3026 outFile: CellRendererCombo
3028 file: GtkCellRendererPixbuf.html
3029 struct: GtkCellRenderer
3030 realStruct: GtkCellRendererPixbuf
3031 class: CellRendererPixbuf
3032 prefix: gtk_cell_renderer_pixbuf_
3033 prefix: gtk_
3034 import: gtk.CellRenderer
3035 structWrap: GtkCellRenderer* CellRenderer
3036 outFile: CellRendererPixbuf
3038 file: GtkCellRendererProgress.html
3039 struct: GtkCellRenderer
3040 realStruct: GtkCellRendererProgress
3041 class: CellRendererProgress
3042 prefix: gtk_cell_renderer_progress_
3043 prefix: gtk_
3044 import: gtk.CellRenderer
3045 structWrap: GtkCellRenderer* CellRenderer
3046 outFile: CellRendererProgress
3048 file: GtkCellRendererText.html
3049 struct: GtkCellRenderer
3050 realStruct: GtkCellRendererText
3051 class: CellRendererText
3052 prefix: gtk_cell_renderer_text_
3053 prefix: gtk_
3054 import: glib.Str
3055 import: gtk.CellRenderer
3056 structWrap: GtkCellRenderer* CellRenderer
3057 outFile: CellRendererText
3059 file: GtkCellRendererToggle.html
3060 struct: GtkCellRenderer
3061 realStruct: GtkCellRendererToggle
3062 class: CellRendererToggle
3063 prefix: gtk_cell_renderer_toggle_
3064 prefix: gtk_
3065 import: glib.Str
3066 import: gtk.CellRenderer
3067 structWrap: GtkCellRenderer* CellRenderer
3068 outFile: CellRendererToggle
3071 file:
3072 code: start
3073         /**
3074          * TreeNode interface
3075          */
3076         public interface TreeNode
3077         {
3078                 char[] getNodeValue(int column);
3079                 int columnCount();
3080         }
3081 code: end
3082 outFile: TreeNode
3084 file: GtkListStore.html
3085 struct: GtkListStore
3086 class: ListStore
3087 extend: GtkTreeModel
3088 prefix: gtk_list_store_
3089 prefix: gtk_
3090 import: gtk.TreeModel
3091 import: glib.Str
3092 #import: gobject.Type
3093 #structWrap: GType* Type
3094 import: gtk.TreeIter
3095 structWrap: GtkTreeIter* TreeIter
3096 import: gobject.Value
3097 structWrap: GValue* Value
3098 import: glib.Str
3100 nocode: gtk_list_store_set
3102 code: start
3104         /**
3105          * Non-vararg creation function. Used primarily by language bindings.
3106          * n_columns:
3107          *  number of columns in the list store
3108          * types:
3109          *  an array of GType types for the columns, from first to last
3110          * Returns:
3111          *  a new GtkListStore
3112          */
3113         public this (GType[] types)
3114         {
3115                 // GtkListStore* gtk_list_store_newv (gint n_columns,  GType *types);
3116                 this(cast(GtkListStore*)gtk_list_store_newv(types.length, cast(GType*)(types.ptr)) );
3117         }
3118         
3119         /**
3120          * Creates a top level iteractor.
3121          * I don't think lists have but the top level iteractor
3122          */
3123         TreeIter createIter()
3124         {
3125                 GtkTreeIter* iter = new GtkTreeIter;
3126                 gtk_list_store_append(getListStoreStruct(), iter);
3127                 return new TreeIter(iter);
3128         }
3129         
3130         /**
3131          * sets the values for one row
3132          * @param iter the row iteractor
3133          * @param columns an arrays with the columns to set
3134          * @param values an arrays with the values
3135          */
3136         void set(TreeIter iter, int [] columns, char*[] values)
3137         {
3138                 for ( int i=0 ; i<columns.length && i<values.length; i++ )
3139                 {
3140                         //Value v = new Value(values[i]);
3141                         //gtk_list_store_set(obj(), iter.getIter(), columns[i], v.getV(),-1);
3142                         gtk_list_store_set(
3143                                         gtkListStore, 
3144                                         iter.getTreeIterStruct(), 
3145                                         columns[i], 
3146                                         values[i],-1);
3147                 }
3148         }
3150         void set(TreeIter iter, int [] columns, char[][] values)
3151         {
3152                 for ( int i=0 ; i<columns.length && i<values.length; i++ )
3153                 {
3154                         //Value v = new Value(values[i]);
3155                         //gtk_list_store_set(obj(), iter.getIter(), columns[i], v.getV(),-1);
3156                         gtk_list_store_set(
3157                                         gtkListStore, 
3158                                         iter.getTreeIterStruct(), 
3159                                         columns[i], 
3160                                         Str.toStringz(values[i]),-1);
3161                 }
3162         }
3164         void setValue(TreeIter iter, int column, char[] value)
3165         {
3166                 Value v = new Value(value);
3167                 gtk_list_store_set_value(gtkListStore, iter.getTreeIterStruct(), column, v.getValueStruct());
3168                 //gtk_list_store_set_value(obj(), iter.getIter(), column, (GValue*)cChar(value));
3169         }
3170         
3171         void setValue(TreeIter iter, int column, int value)
3172         {
3173                 Value v = new Value(value);
3174                 gtk_list_store_set_value(gtkListStore, iter.getTreeIterStruct(), column, v.getValueStruct());
3175         }
3177 code: end
3178 outFile: ListStore
3180 file: GtkTreeStore.html
3181 struct: GtkTreeStore
3182 class: TreeStore
3183 extend: GtkTreeModel
3184 prefix: gtk_tree_store_
3185 prefix: gtk_
3186 import: glib.Str
3187 #import: gobject.Type
3188 #structWrap: GType* Type
3189 import: gtk.TreeIter
3190 structWrap: GtkTreeIter* TreeIter
3191 import: gobject.Value
3192 structWrap: GValue* Value
3193 import: gtk.TreeNode
3194 import: gdk.Pixbuf;
3195 import: gobject.Value;
3196 import: glib.Str
3197 import: gtk.TreeModel
3199 nocode: gtk_tree_store_set
3201 code: start
3203         /**
3204          * Non-vararg creation function. Used primarily by language bindings.
3205          * n_columns:
3206          *  number of columns in the list store
3207          * types:
3208          *  an array of GType types for the columns, from first to last
3209          * Returns:
3210          *  a new GtkListStore
3211          */
3212         public this (GType[] types)
3213         {
3214                 // GtkListStore* gtk_list_store_newv (gint n_columns,  GType *types);
3215                 this(cast(GtkTreeStore*)gtk_tree_store_newv(
3216                                 types.length, cast(GType*)(types.ptr)) 
3217                         );
3218         }
3219         
3220         
3222         /**
3223          * Creates a top level iteractor.
3224          * I don't think lists have but the top level iteractor
3225          */
3226         TreeIter createIter(TreeIter parent=null)
3227         {
3228                 GtkTreeIter* iter = new GtkTreeIter;
3229                 gtk_tree_store_append(getTreeStoreStruct(), iter, (parent is null) ? null : parent.getTreeIterStruct());
3230                 return new TreeIter(iter);
3231         }
3232         
3233         /**
3234          * Sets one value into one cells.
3235          * @param iter the tree iteractor, effectivly the row
3236          * @param column to column number to set
3237          * @param value the value
3238          * \todo confirm we need to destroy the Value instance
3239          */
3240         void setValue(TreeIter iter, int column, char[] value)
3241         {
3242                 gtk_tree_store_set(gtkTreeStore, iter.getTreeIterStruct(), column, Str.toStringz(value) , -1);
3243         }
3245         void setValue(TreeIter iter, int column, int value)
3246         {
3247                 gtk_tree_store_set(gtkTreeStore, iter.getTreeIterStruct(), column, (new Value(value)).getValueStruct() , -1);
3248         }
3251         
3252         /**
3253          * \todo confirm we need to destroy the Value instance
3254          */
3255         void setValue(TreeIter iter, int column, Pixbuf pixbuf)
3256         {
3257                 Value v = new Value(pixbuf);
3258                 gtk_tree_store_set_value(gtkTreeStore, iter.getTreeIterStruct(), column, v.getValueStruct());
3259         }
3262         /**
3263          * sets the values for one row
3264          * @param iter the row iteractor
3265          * @param columns an arrays with the columns to set
3266          * @param values an arrays with the values
3267          */
3268         void set(TreeIter iter, int [] columns, char*[] values)
3269         {
3270                 for ( int i=0 ; i<columns.length && i<values.length; i++ )
3271                 {
3272                         //Value v = new Value(values[i]);
3273                         //gtk_list_store_set(obj(), iter.getIter(), columns[i], v.getV(),-1);
3274                         gtk_tree_store_set(
3275                                         gtkTreeStore, 
3276                                         iter.getTreeIterStruct(), 
3277                                         columns[i], 
3278                                         values[i],-1);
3279                 }
3280         }
3282         void set(TreeIter iter, int [] columns, char[][] values)
3283         {
3284                 for ( int i=0 ; i<columns.length && i<values.length; i++ )
3285                 {
3286                         //Value v = new Value(values[i]);
3287                         //gtk_list_store_set(obj(), iter.getIter(), columns[i], v.getV(),-1);
3288                         gtk_tree_store_set(
3289                                         gtkTreeStore, 
3290                                         iter.getTreeIterStruct(), 
3291                                         columns[i], 
3292                                         Str.toStringz(values[i]),-1);
3293                 }
3294         }
3296         /**
3297          * Sets an iteractor values from a tree node.
3298          * This is the way to add a new row to the tree,
3299          * the iteractor is either a top level iteractor created from createIter()
3300          * or a nested iteractor created from append()
3301          * @param iter the iteractor to set
3302          * @param treeNode the tree node
3303          * @see createIter()
3304          * @see append()
3305          */
3306         void set(TreeIter iter, TreeNode treeNode)
3307         {
3308                 int[] cols;
3309                 char[][] vals;
3310                 for ( int i=0 ; i<treeNode.columnCount() ; i++ )
3311                 {
3312                         //printf(">>>>>>>>>>>>> requesting value for %d\n",i);
3313                         cols ~= i;
3314                         char[] value = treeNode.getNodeValue(i);
3315                         if ( value  is  null )
3316                         {
3317                                 vals ~= "";
3318                         }
3319                         else
3320                         {
3321                                 vals ~= value;
3322                         }
3323                 }
3324                 set(iter, cols, vals);                          
3325         }
3328         /**
3329          * Creates and prepends a new row to tree_store. If parent is non-NULL, then it will prepend
3330          * the new row before the first child of parent, otherwise it will prepend a row
3331          * to the top level. iter will be changed to point to this new row. The row
3332          * will be empty after this function is called. To fill in values, you need to
3333          * call gtk_tree_store_set() or gtk_tree_store_set_value().
3334          * parent:
3335          *  A valid GtkTreeIter, or NULL
3336          */
3337         public TreeIter prepend(TreeIter parent)
3338         {
3339                 TreeIter iter = new TreeIter();
3340                 // void gtk_tree_store_prepend (GtkTreeStore *tree_store,  GtkTreeIter *iter,  GtkTreeIter *parent);
3341                 gtk_tree_store_prepend(gtkTreeStore, iter.getTreeIterStruct(), (parent is null) ? null : parent.getTreeIterStruct());
3342                 return iter;
3343         }
3344         
3345         /**
3346          * Creates and appends a new row to tree_store. If parent is non-NULL, then it will append the
3347          * new row after the last child of parent, otherwise it will append a row to
3348          * the top level. iter will be changed to point to this new row. The row will
3349          * be empty after this function is called. To fill in values, you need to call
3350          * gtk_tree_store_set() or gtk_tree_store_set_value().
3351          * parent:
3352          *  A valid GtkTreeIter, or NULL
3353          */
3354         public TreeIter append(TreeIter parent)
3355         {
3356                 TreeIter iter = new TreeIter();
3357                 // void gtk_tree_store_append (GtkTreeStore *tree_store,  GtkTreeIter *iter,  GtkTreeIter *parent);
3358                 gtk_tree_store_append(gtkTreeStore, 
3359                         iter.getTreeIterStruct(), 
3360                         (parent is null) ? null : parent.getTreeIterStruct());
3361                 return iter;
3362         }
3363 code: end
3365 outFile: TreeStore
3368 ###########################################################
3369 ### Menus, Combo Box, Toolbar #############################
3370 ###########################################################
3372 file: GtkComboBox.html
3374 struct: GtkComboBox
3375 class: ComboBox
3376 implements: CellLayoutIF
3377 import: atk.ObjectAtk
3378 structWrap: AtkObject* ObjectAtk
3379 prefix: gtk_combo_box_
3380 prefix: gtk_
3381 #noprefix: gtk_combo_box_new_text
3382 #noprefix: gtk_combo_box_append_text
3383 #noprefix: gtk_combo_box_insert_text
3384 #noprefix: gtk_combo_box_prepend_text
3385 #noprefix: gtk_combo_box_remove_text
3386 import: glib.Str
3387 import: gtk.TreeModel
3388 structWrap: GtkTreeModel* TreeModel
3389 import: gtk.TreeIter
3390 structWrap: GtkTreeIter* TreeIter
3391 import: gtk.CellRenderer
3392 import: gtk.CellLayoutIF
3393 import: gtk.CellLayoutT
3395 nocode: gtk_combo_box_new
3396 nocode:gtk_combo_box_new_text
3398 code: start
3400         private int count = 0;
3401         public int maxCount = 0;
3402         
3404         // add the CellLayout capabilities
3405         mixin CellLayoutT!(GtkComboBox);
3407         /**
3408          * Creates a new empty GtkComboBox.
3409          * If text is true then
3410          * constructs a new text combo box, which is a
3411          * GtkComboBox just displaying strings. If you use this function to create
3412          * a text combo box, you should only manipulate its data source with the
3413          * following convenience functions: gtk_combo_box_append_text(),
3414          * gtk_combo_box_insert_text(), gtk_combo_box_prepend_text() and
3415          * gtk_combo_box_remove_text().
3416          * Returns:
3417          *  A new GtkComboBox.
3418          * Since 2.4
3419          */
3420         public this (bool text=true)
3421         {
3422                 if ( text )
3423                 {
3424                         // GtkWidget* gtk_combo_box_new_text (void);
3425                         this(cast(GtkComboBox*)gtk_combo_box_new_text() );
3426                 }
3427                 else
3428                 {
3429                         // GtkWidget* gtk_combo_box_new (void);
3430                         this(cast(GtkComboBox*)gtk_combo_box_new() );
3431                 }
3432         }
3434         public void setActiveText(char[] text, bool insert=false)
3435         {
3436                 int currActive = getActive();
3437                 int active = 0;
3438                 setActive(active);
3439                 bool found = false;
3440                 while ( !found && active==getActive)
3441                 {
3442                         found = text==getActiveText();
3443                         ++active;
3444                 }
3445                 if ( !found )
3446                 {
3447                         if ( insert )
3448                         {
3449                                 appendText(text);
3450                                 setActive(active);
3451                         }
3452                         else
3453                         {
3454                                 //setActive(currActive);
3455                                 setActive(-1);
3456                         }
3457                 }
3458         }
3461         int getIndex(char[] text)
3462         {
3463                 TreeIter iter = new TreeIter();
3464                 TreeModel model = getModel();
3465                 iter.setModel(model);
3466                 int index = 0;
3467                 bool found = false;
3468                 bool end = false;
3469                 if ( model.getIterFirst(iter) )
3470                 {
3471                         while ( !end && iter !is  null && !found )
3472                         {
3473                                 found = iter.getValueString(0) == text;
3474                                 if ( !found )
3475                                 {
3476                                         end = !model.iterNext(iter);
3477                                         ++index;
3478                                 }
3479                         }
3480                 }
3481                 else
3482                 {
3483                         end = true;
3484                 }
3485                 return end ? -1 : index;
3486         }
3488         void prependOrReplaceText(char[] text)
3489         {
3490                 int index = getIndex(text);
3491                 if ( index > 0 )
3492                 {
3493                         removeText(index);
3494                         prependText(text);
3495                 }
3496                 else if ( index == -1 )
3497                 {
3498                         prependText(text);
3499                 }
3500         }
3503 code: end
3504 outFile: ComboBox
3506 #struct: GtkComboBox
3507 #class: ComboBoxText
3508 #import: atk.ObjectAtk
3509 #structWrap: AtkObject* ObjectAtk
3510 #filterIn: gtk_combo_box_new_text
3511 #filterIn: gtk_combo_box_append_text
3512 #filterIn: gtk_combo_box_insert_text
3513 #filterIn: gtk_combo_box_prepend_text
3514 #filterIn: gtk_combo_box_remove_text
3515 #strictPrefix: Y
3516 #outFile: ComboBoxText
3518 file: GtkComboBoxEntry.html
3520 struct: GtkComboBoxEntry
3521 class: ComboBoxEntry
3522 implements: CellLayoutIF
3523 prefix: gtk_combo_box_entry_
3524 #noprefix: gtk_combo_box_entry_new_text
3525 #noprefix: gtk_combo_box_append_text
3526 #noprefix: gtk_combo_box_insert_text
3527 #noprefix: gtk_combo_box_prepend_text
3528 #noprefix: gtk_combo_box_remove_text
3529 import: gtk.TreeModel
3530 structWrap: GtkTreeModel* TreeModel
3531 import: glib.Str
3532 import: gtk.CellRenderer
3533 import: gtk.CellLayoutIF
3534 import: gtk.CellLayoutT
3536 nocode: gtk_combo_box_entry_new
3537 nocode: gtk_combo_box_entry_new_text
3539 code: start
3541         mixin CellLayoutT!(GtkComboBoxEntry);
3542         /**
3543          * Creates a new GtkComboBoxEntry which has a GtkEntry as child. After
3544          * construction, you should set a model using gtk_combo_box_set_model() and a
3545          * text_column * using gtk_combo_box_entry_set_text_column().
3546          * Returns:
3547          *  A new GtkComboBoxEntry.
3548          * Since 2.4
3549          */
3550         public this (bool text=true)
3551         {
3552                 if ( text )
3553                 {
3554                         // GtkWidget* gtk_combo_box_entry_new_text (void);
3555                         this(cast(GtkComboBoxEntry*)gtk_combo_box_entry_new_text() );
3556                 }
3557                 else
3558                 {
3559                         // GtkWidget* gtk_combo_box_entry_new (void);
3560                         this(cast(GtkComboBoxEntry*)gtk_combo_box_entry_new() );
3561                 }
3562                 
3563         }
3564 code: end
3565 outFile: ComboBoxEntry
3568 #struct: GtkComboBoxEntry
3569 #class: ComboBoxEntryText
3570 #filterIn: gtk_combo_box_entry_new_text
3571 #filterIn: gtk_combo_box_append_text
3572 #filterIn: gtk_combo_box_insert_text
3573 #filterIn: gtk_combo_box_prepend_text
3574 #filterIn: gtk_combo_box_remove_text
3575 #strictPrefix: Y
3576 #outFile: ComboBoxEntryText
3578 file: GtkMenu.html
3579 struct: GtkMenu
3580 class: Menu
3581 prefix: gtk_menu_
3582 prefix: gtk_
3583 import: glib.Str
3584 import: gtk.Widget
3585 structWrap: GtkWidget* Widget
3586 import: gdk.Screen
3587 structWrap: GdkScreen* Screen
3588 import: gtk.AccelGroup
3589 structWrap: GtkAccelGroup* AccelGroup
3590 import: glib.ListG
3591 structWrap: GList* ListG
3592 import: gtk.MenuItem
3594 code: start
3595         public void append(Widget widget)
3596         {
3597                 super.append(widget);
3598         }
3600         /**
3601          * Popups up this menu
3602          * @param button ??? you can pass a button number here
3603          * @param activateTime ??? you can pass the time from an event here
3604          */
3605         void popup(guint button, guint32 activateTime)
3606         {
3607                 popup(null, null, null, null, button, activateTime);
3608         }
3609         
3610         /**
3611          * Creates and append a submenu to this menu.
3612          * This menu item that actualy has the sub menu is also created.
3613          * @param label the sub menu item label
3614          * @return the new menu
3615          */
3616         Menu appendSubmenu(char[] label)
3617         {
3618                 MenuItem item = new MenuItem(label);
3619                 append(item);
3620                 Menu submenu = new Menu();
3621                 item.setSubmenu(submenu);
3622                 return submenu;
3623         }
3625         void appendSubmenu(char[] label, Menu submenu)
3626         {
3627                 MenuItem item = new MenuItem(label);
3628                 append(item);
3629                 item.setSubmenu(submenu);
3630         }
3632         Menu prependSubmenu(char[] label)
3633         {
3634                 MenuItem item = new MenuItem(label);
3635                 prepend(item);
3636                 Menu submenu = new Menu();
3637                 item.setSubmenu(submenu);
3638                 return submenu;
3639         }
3642 code: end
3643 outFile: Menu
3645 file: GtkMenuBar.html
3646 struct: GtkMenuBar
3647 class: MenuBar
3648 prefix: gtk_menu_bar_
3649 prefix: gtk_
3650 import: gtk.Widget
3651 structWrap: GtkWidget* Widget
3652 import: gtk.Menu;
3653 import: gtk.MenuItem;
3654 structWrap: GtkMenu* Menu
3655 structWrap: GtkMenuItem* MenuItem
3656 code: start
3657         Menu append(char[] label, bool rightJustify=false)
3658         {
3659                 MenuItem item = new MenuItem(label);
3660                 super.append(item);
3661                 item.setRightJustified(rightJustify);
3662                 Menu menu= new Menu();
3663                 item.setSubmenu(menu);
3664                 return menu;
3665         }
3667         public void append(Widget widget)
3668         {
3669                 super.append(widget);
3670         }
3671 code: end
3672 outFile: MenuBar
3674 file: GtkMenuItem.html
3675 struct: GtkMenuItem
3676 class: MenuItem
3677 prefix: gtk_menu_item_
3678 prefix: gtk_
3679 import: glib.Str
3680 import: gtk.Widget
3681 import: gtk.AccelGroup
3682 structWrap: GtkWidget* Widget
3683 # method conflict with parent method
3684 nocode: gtk_menu_item_activate
3685 nocode: gtk_menu_item_new_with_label
3686 nocode: gtk_menu_item_new_with_mnemonic
3687 # replace the method
3688 # TODO create a method rename instead of replacing the entire code
3689 code: start
3690         
3691         /** store the action code passed in by the applcation */
3692         private char[] actionLabel;
3693         
3694         /** Gets the application set action code */
3695         public char[] getActionName()
3696         {
3697                 if ( actionLabel is null )
3698                 {
3699                         actionLabel = "";
3700                 }
3701                 return actionLabel;
3702         }
3703         
3704         /**
3705          * Creates a new menu item with a label and a listener and a action.
3706          * used for backward compatibily with DUI.
3707          */
3708         this(char[] label, void delegate(MenuItem)dlg, char[] action)
3709         {
3710                 this(label);
3711                 this.actionLabel = action;
3712                 addOnActivate(dlg);
3713         }
3714         
3716         
3717         /**
3718          * Creates a new Item associated with a "activate" delegate and with a action code
3719          * and optionally accelGroup
3720          */
3721         public this(void delegate(MenuItem) dlg, char[] label, char[] action, 
3722                                 bool mnemonic=true,
3723                                 AccelGroup accelGroup=null,
3724                                 char accelKey='\0',
3725                                 GdkModifierType modifierType=GdkModifierType.CONTROL_MASK,
3726                                 GtkAccelFlags accelFlags=GtkAccelFlags.VISIBLE
3727                                 )
3728         {
3729                 this(label, mnemonic);
3730                 this.actionLabel = action;
3731                 addOnActivate(dlg);
3732                 if ( accelGroup !is null && accelKey != '\0' )
3733                 {
3734                         addAccelerator("activate",accelGroup,accelKey,modifierType,accelFlags); 
3735                 }
3736         }
3737         
3738         
3740         /**
3741          * Creates a new Item associated with a "activate" delegate
3742          */
3743         public this(void delegate(MenuItem) dlg, char[] label, bool mnemonic=true)
3744         {
3745                 this(label, mnemonic);
3746                 addOnActivate(dlg);
3747         }
3749         /**
3750          * Creates a new GtkMenuItem whose child is a GtkLabel.
3751          * If mnemonic is true the label
3752          * will be created using gtk_label_new_with_mnemonic(), so underscores
3753          * in label indicate the mnemonic for the menu item.
3754          * label:
3755          * the text for the label
3756          * Returns:
3757          * the newly created GtkMenuItem
3758          */
3759         public this (char[] label, bool mnemonic=true)
3760         {
3761                 if ( mnemonic )
3762                 {
3763                         // GtkWidget* gtk_menu_item_new_with_mnemonic (const gchar *label);
3764                         this(cast(GtkMenuItem*)gtk_menu_item_new_with_mnemonic(Str.toStringz(label)) );
3765                 }
3766                 else
3767                 {
3768                         // GtkWidget* gtk_menu_item_new_with_label (const gchar *label);
3769                         this(cast(GtkMenuItem*)gtk_menu_item_new_with_label(Str.toStringz(label)) );
3770                 }
3771                 setName(label);
3772         }
3774         /**
3775          * Emits the "activate" signal on the given item
3776          * menu_item:
3777          * the menu item
3778          */
3779         public void itemActivate()
3780         {
3781                 // void gtk_menu_item_activate (GtkMenuItem *menu_item);
3782                 gtk_menu_item_activate(gtkMenuItem);
3783         }
3784         
3785 code: end
3786 outFile: MenuItem
3788 file: GtkMenuShell.html
3789 struct: GtkMenuShell
3790 class: MenuShell
3791 prefix: gtk_menu_shell_
3792 prefix: gtk_
3793 import: gtk.Widget
3794 structWrap: GtkWidget* Widget
3795 outFile: MenuShell
3797 file: GtkImageMenuItem.html
3798 struct: GtkImageMenuItem
3799 class: ImageMenuItem
3800 prefix: gtk_image_menu_item_
3801 prefix: gtk_
3802 import: glib.Str
3803 import: gtk.Widget
3804 structWrap: GtkWidget* Widget
3805 import: gtk.AccelGroup
3806 structWrap: GtkAccelGroup* AccelGroup
3808 nocode: gtk_image_menu_item_new_with_label
3809 nocode: gtk_image_menu_item_new_with_mnemonic
3811 code: start
3812         /**
3813          * Creates a new GtkImageMenuItem containing a label.
3814          * If mnemonic it true the label
3815          * will be created using gtk_label_new_with_mnemonic(), so underscores
3816          * in label indicate the mnemonic for the menu item.
3817          * label:
3818          *  the text of the menu item.
3819          * Returns:
3820          *  a new GtkImageMenuItem.
3821          */
3822         public this (char[] label, bool mnemonic=true)
3823         {
3824                 if ( mnemonic )
3825                 {
3826                         // GtkWidget* gtk_image_menu_item_new_with_mnemonic  (const gchar *label);
3827                         this(cast(GtkImageMenuItem*)gtk_image_menu_item_new_with_mnemonic(Str.toStringz(label)) );
3828                 }
3829                 else
3830                 {
3831                         // GtkWidget* gtk_image_menu_item_new_with_label  (const gchar *label);
3832                         this(cast(GtkImageMenuItem*)gtk_image_menu_item_new_with_label(Str.toStringz(label)) );
3833                 }
3834         }
3835 code: end
3837 outFile: ImageMenuItem
3839 file: GtkRadioMenuItem.html
3840 struct: GtkRadioMenuItem
3841 class: RadioMenuItem
3842 prefix: gtk_radio_menu_item_
3843 prefix: gtk_
3844 import: glib.Str
3845 import: glib.ListSG
3846 structWrap: GSList* ListSG
3848 nocode: gtk_radio_menu_item_new_with_label
3849 nocode: gtk_radio_menu_item_new_with_mnemonic
3850 nocode: gtk_radio_menu_item_new_with_mnemonic_from_widget
3851 nocode: gtk_radio_menu_item_new_with_label_from_widget
3853 code: start
3854         /**
3855          * Creates a new GtkRadioMenuItem whose child is a simple GtkLabel.
3856          * The new GtkRadioMenuItem is added to the same group as group.
3857          * If mnemonic is true the label will be
3858          * created using gtk_label_new_with_mnemonic(), so underscores in label
3859          * indicate the mnemonic for the menu item.
3860          * group:
3861          *  an existing GtkRadioMenuItem
3862          * label:
3863          *  the text for the label
3864          * Returns:
3865          *  The new GtkRadioMenuItem
3866          * Since 2.4
3867          */
3868         public this (RadioMenuItem radioMenuItem, char[] label, bool mnemonic=true)
3869         {
3870                 if ( mnemonic )
3871                 {
3872                         // GtkWidget* gtk_radio_menu_item_new_with_mnemonic_from_widget  (GtkRadioMenuItem *group,  const gchar *label);
3873                         this(cast(GtkRadioMenuItem*)gtk_radio_menu_item_new_with_mnemonic_from_widget(
3874                                 radioMenuItem.getRadioMenuItemStruct(), Str.toStringz(label)) );
3875                 }
3876                 else
3877                 {
3878                         // GtkWidget* gtk_radio_menu_item_new_with_label_from_widget  (GtkRadioMenuItem *group,  const gchar *label);
3879                         this(cast(GtkRadioMenuItem*)gtk_radio_menu_item_new_with_label_from_widget(
3880                                 radioMenuItem.getRadioMenuItemStruct(), Str.toStringz(label)) );
3881                 }
3882         }
3883         
3884         /**
3885          * Creates a new GtkRadioMenuItem containing a label. T
3886          * The new GtkRadioMenuItem is added to the same group as group.
3887          * group:
3888          *  An existing GtkRadioMenuItem
3889          * label:
3890          *  the text of the button, with an underscore in front of the
3891          *  mnemonic character
3892          * Returns:
3893          *  The new GtkRadioMenuItem
3894          * Since 2.4
3895          */
3896         public this (char[] label)
3897         {
3898         }
3899         
3900         /**
3901          * Creates a new GtkRadioMenuItem whose child is a simple GtkLabel.
3902          * If mnemonic is true the label
3903          * will be created using gtk_label_new_with_mnemonic(), so underscores
3904          * in label indicate the mnemonic for the menu item.
3905          * group:
3906          * the group to which the radio menu item is to be attached
3907          * label:
3908          * the text for the label
3909          * Returns:
3910          * a new GtkRadioMenuItem
3911          */
3912         public this (ListSG group, char[] label, bool mnemonic=true)
3913         {
3914                 if ( mnemonic )
3915                 {
3916                         // GtkWidget* gtk_radio_menu_item_new_with_mnemonic  (GSList *group,  const gchar *label);
3917                         this(cast(GtkRadioMenuItem*)gtk_radio_menu_item_new_with_mnemonic(
3918                                 group is null ? null : group.getListSGStruct(), Str.toStringz(label)) );
3919                 }
3920                 else
3921                 {
3922                         // GtkWidget* gtk_radio_menu_item_new_with_label  (GSList *group,  const gchar *label);
3923                         this(cast(GtkRadioMenuItem*)gtk_radio_menu_item_new_with_label(
3924                                 group is null ? null : group.getListSGStruct(), Str.toStringz(label)) );
3925                 }
3926         }
3927 code: end
3928 outFile: RadioMenuItem
3930 file: GtkCheckMenuItem.html
3931 struct: GtkCheckMenuItem
3932 class: CheckMenuItem
3933 prefix: gtk_check_menu_item_
3934 prefix: gtk_
3935 import: glib.Str
3937 nocode: gtk_check_menu_item_new_with_label
3938 nocode: gtk_check_menu_item_new_with_mnemonic
3940 code: start
3941         /**
3942          * Creates a new GtkCheckMenuItem with a label.
3943          * If mnemonic it true the label
3944          * will be created using gtk_label_new_with_mnemonic(), so underscores
3945          * in label indicate the mnemonic for the menu item.
3946          * label:
3947          * the string to use for the label.
3948          * Returns:
3949          * a new GtkCheckMenuItem.
3950          */
3951         public this (char[] label, bool mnemonic=true)
3952         {
3953                 if ( mnemonic )
3954                 {
3955                         // GtkWidget* gtk_check_menu_item_new_with_mnemonic  (const gchar *label);
3956                         this(cast(GtkCheckMenuItem*)gtk_check_menu_item_new_with_mnemonic(Str.toStringz(label)) );
3957                 }
3958                 else
3959                 {
3960                         // GtkWidget* gtk_check_menu_item_new_with_label  (const gchar *label);
3961                         this(cast(GtkCheckMenuItem*)gtk_check_menu_item_new_with_label(Str.toStringz(label)) );
3962                 }
3963         }
3964 code: end
3966 outFile: CheckMenuItem
3968 file: GtkSeparatorMenuItem.html
3969 struct: GtkSeparatorMenuItem
3970 class: SeparatorMenuItem
3971 prefix: gtk_separator_menu_item_
3972 prefix: gtk_
3973 outFile: SeparatorMenuItem
3975 file: GtkTearoffMenuItem.html
3976 struct: GtkTearoffMenuItem
3977 class: TearoffMenuItem
3978 prefix: gtk_tearoff_menu_item_
3979 prefix: gtk_
3980 outFile: TearoffMenuItem
3982 file: GtkToolbar.html
3983 struct: GtkToolbar
3984 class: Toolbar
3985 prefix: gtk_toolbar_
3986 prefix: gtk_
3987 import: glib.Str
3988 import: gtk.Widget
3989 import: gtk.Button
3990 import: gtk.ToolItem
3991 structWrap: GtkWidget* Widget
3992 nocode: gtk_toolbar_get_style
3994 code: start
3995         /**
3996          * Retrieves whether the toolbar has text, icons, or both . See
3997          * gtk_toolbar_set_style().
3998          * toolbar:
3999          *  a GtkToolbar
4000          * Returns:
4001          *  the current style of toolbar
4002          */
4003         public GtkToolbarStyle toolbarGetStyle()
4004         {
4005                 // GtkToolbarStyle gtk_toolbar_get_style (GtkToolbar *toolbar);
4006                 return gtk_toolbar_get_style(gtkToolbar);
4007         }
4009         public void insert (ToolItem toolItem, int pos=-1)
4010         {
4011                 gtk_toolbar_insert(gtkToolbar, toolItem.getToolItemStruct(), pos);
4012         }
4013         
4014         public Widget insertStock(StockID stockId, char[] tooltipText, char[] tooltipPrivateText, GtkSignalFunc callback, void* userData, int position)
4015         {
4016                 return insertStock(getId(stockId), tooltipText, tooltipPrivateText, callback, userData, position);
4017         }
4019         public Widget insertStock(char[] stockId, char[] tooltipText, char[] tooltipPrivateText, int position)
4020         {
4021                 return insertStock(stockId, tooltipText, tooltipPrivateText, null, null, position);
4022         }
4023         
4024         public Widget insertStock(StockID stockId, char[] tooltipText, char[] tooltipPrivateText, int position)
4025         {
4026                 return insertStock(getId(stockId), tooltipText, tooltipPrivateText, null, null, position);
4027         }
4029         Button insertButton(StockID stockID,
4030                         char[] tooltipText, char[] tooltipPrivateText,
4031                         gint position)
4032         {
4033                 Button button = new Button(
4034                                 cast(GtkButton*)gtk_toolbar_insert_stock(
4035                                         gtkToolbar,
4036                                         Str.toStringz(StockDesc[stockID]),
4037                                         Str.toStringz(tooltipText), 
4038                                         Str.toStringz(tooltipPrivateText), 
4039                                         null, null, 
4040                                         position)
4041                         );
4042                 return button;
4043         }
4045 code: end
4046 outFile: Toolbar
4048 file: GtkToolItem.html
4049 struct: GtkToolItem
4050 class: ToolItem
4051 prefix: gtk_tool_item_
4052 prefix: gtk_
4053 import: glib.Str
4054 import: gtk.Tooltips
4055 structWrap: GtkTooltips* Tooltips
4056 import: gtk.Widget
4057 structWrap: GtkWidget* Widget
4059 code: start
4060         /**
4061          * Sets this widget tooltip
4062          * @param tipText the tooltip
4063          * @param tipPrivate a private text
4064          */
4065         void setTooltip(char[] tipText, char[] tipPrivate)
4066         {
4067                 Tooltips tt = new Tooltips();
4068                 tt.setTip(this, tipText, tipPrivate);
4069         }
4071 code: end
4073 outFile: ToolItem
4075 file: GtkSeparatorToolItem.html
4076 struct: GtkSeparatorToolItem
4077 ctorStruct: GtkToolItem
4078 class: SeparatorToolItem
4079 prefix: gtk_separator_tool_item_
4080 prefix: gtk_
4081 import: gtk.ToolItem
4082 structWrap: GtkToolItem* ToolItem
4083 outFile: SeparatorToolItem
4085 file: GtkToolButton.html
4086 struct: GtkToolButton
4087 ctorStruct: GtkToolItem
4088 class: ToolButton
4089 prefix: gtk_tool_button_
4090 prefix: gtk_
4091 import: glib.Str
4092 import: gtk.ToolItem
4093 #structWrap: GtkToolItem* ToolItem
4094 import: gtk.Widget
4095 structWrap: GtkWidget* Widget
4097 code: start
4098         /** An arbitrary string to be used by the application */
4099         private char[] action;
4101         public void setActionName(char[] action)
4102         {
4103                 this.action = action.dup;
4104         }
4105         
4106         public char[] getActionName()
4107         {
4108                 return action;
4109         }
4111         public this (StockID stockID)
4112         {
4113                 this(StockDesc[stockID]);
4114         }
4115         
4117 code: end
4119 outFile: ToolButton
4121 file: GtkMenuToolButton.html
4122 struct: GtkMenuToolButton
4123 ctorStruct: GtkToolItem
4124 class: MenuToolButton
4125 prefix: gtk_menu_tool_button_
4126 prefix: gtk_
4127 import: glib.Str
4128 import: gtk.ToolItem
4129 structWrap: GtkToolItem* ToolItem
4130 import: gtk.Widget
4131 structWrap: GtkWidget* Widget
4132 import: gtk.Tooltips
4133 structWrap: GtkTooltips* Tooltips
4134 import: gtk.Menu
4137 nocode: gtk_menu_tool_button_new
4138 nocode: gtk_menu_tool_button_new_from_stock
4139 nocode: gtk_menu_tool_button_get_menu
4141 code: start
4142         /**
4143          * Creates a new GtkMenuToolButton using icon_widget as icon and
4144          * label as label.
4145          * icon_widget:
4146          *  a widget that will be used as icon widget, or NULL
4147          * label:
4148          *  a string that will be used as label, or NULL
4149          * Returns:
4150          *  the new GtkMenuToolButton
4151          * Since 2.6
4152          */
4153         public this(Widget iconWidget, char[] label)
4154         {
4155                 // GtkToolItem* gtk_menu_tool_button_new (GtkWidget *icon_widget,  const gchar *label);
4156                 this( cast(GtkMenuToolButton*)gtk_menu_tool_button_new(
4157                         (iconWidget is null) ? null : iconWidget.getWidgetStruct(), 
4158                         Str.toStringz(label))
4159                 );
4160         }
4161         
4162         /**
4163          * Creates a new GtkMenuToolButton.
4164          * The new GtkMenuToolButton will contain an icon and label from
4165          * the stock item indicated by stock_id.
4166          * stock_id:
4167          *  the name of a stock item
4168          * Returns:
4169          *  the new GtkMenuToolButton
4170          * Since 2.6
4171          */
4172         public this(StockID stockId)
4173         {
4174                 // GtkToolItem* gtk_menu_tool_button_new_from_stock  (const gchar *stock_id);
4175                 this( 
4176                         cast(GtkMenuToolButton*)gtk_menu_tool_button_new_from_stock(
4177                         Str.toStringz(StockDesc[stockId]))
4178                 );
4179         }
4181         /**
4182          * Gets the GtkMenu associated with GtkMenuToolButton.
4183          * button:
4184          *  a GtkMenuToolButton
4185          * Returns:
4186          *  the GtkMenu associated with GtkMenuToolButton
4187          * Since 2.6
4188          */
4189         public Menu getMenu()
4190         {
4191                 // GtkWidget* gtk_menu_tool_button_get_menu (GtkMenuToolButton *button);
4192                 return new Menu( cast(GtkMenu*)gtk_menu_tool_button_get_menu(gtkMenuToolButton) );
4193         }
4194         
4195         /**
4196          * Sets the toolTip for the arrow
4197          * Params:
4198          *      tipText =       
4199          *      tipPrivate =    
4200          */
4201         public void setArrowTooltip(char[] tipText, char[] tipPrivate)
4202         {
4203                 Tooltips tooltips = new Tooltips();
4204                 gtk_menu_tool_button_set_arrow_tooltip(
4205                         gtkMenuToolButton, 
4206                         (tooltips is null) ? null : tooltips.getTooltipsStruct(), 
4207                         Str.toStringz(tipText), 
4208                         Str.toStringz(tipPrivate)
4209                         );
4210         }
4212 code: end
4214 outFile: MenuToolButton
4216 file: GtkToggleToolButton.html
4217 struct: GtkToggleToolButton
4218 ctorStruct: GtkToolItem
4219 class: ToggleToolButton
4220 prefix: gtk_toggle_tool_button_
4221 prefix: gtk_
4222 import: glib.Str
4223 import: gtk.ToolItem
4224 structWrap: GtkToolItem* ToolItem
4225 outFile: ToggleToolButton
4227 file: GtkRadioToolButton.html
4228 struct: GtkRadioToolButton
4229 ctorStruct: GtkToolItem
4230 class: RadioToolButton
4231 prefix: gtk_radio_tool_button_
4232 prefix: gtk_
4233 import: glib.Str
4234 import: gtk.ToolItem
4235 structWrap: GtkToolItem* ToolItem
4236 import: glib.ListSG
4237 structWrap: GSList* ListSG
4238 outFile: RadioToolButton
4240 ###########################################################
4241 ### Action-based menus and toolbars #######################
4242 ###########################################################
4244 file: GtkUIManager.html
4245 struct: GtkUIManager
4246 class: UIManager
4247 prefix: gtk_ui_manager_
4248 prefix: gtk_
4249 import: glib.Str
4250 import: gtk.ActionGroup
4251 structWrap: GtkActionGroup* ActionGroup
4252 import: glib.ListG
4253 structWrap: GList* ListG
4254 import: gtk.AccelGroup
4255 structWrap: GtkAccelGroup* AccelGroup
4256 import: gtk.Widget
4257 structWrap: GtkWidget* Widget
4258 import: glib.ListSG
4259 structWrap: GSList* ListSG
4260 import: gtk.Action
4261 structWrap: GtkAction* Action
4262 outFile: UIManager
4264 file: GtkActionGroup.html
4265 struct: GtkActionGroup
4266 class: ActionGroup
4267 prefix: gtk_action_group_
4268 prefix: gtk_
4269 import: glib.Str
4270 import: gtk.Action
4271 structWrap: GtkAction* Action
4272 import: glib.ListG
4273 structWrap: GList* ListG
4274 #import: gtk.ActionEntry
4275 #structWrap: GtkActionEntry* ActionEntry
4276 #import: gtk.ToggleActionEntry
4277 #structWrap: GtkToggleActionEntry* ToggleActionEntry
4278 #import: gtk.RadioActionEntry
4279 #structWrap: GtkRadioActionEntry* RadioActionEntry
4280 outFile: ActionGroup
4282 file: GtkAction.html
4283 struct: GtkAction
4284 class: Action
4285 prefix: gtk_action_
4286 prefix: gtk_
4287 import: glib.Str
4288 import: gtk.Widget
4289 structWrap: GtkWidget* Widget
4290 import: glib.ListSG
4291 structWrap: GSList* ListSG
4292 import: gobject.Closure
4293 structWrap: GClosure* Closure
4294 import: gtk.AccelGroup
4295 structWrap: GtkAccelGroup* AccelGroup
4296 outFile: Action
4298 file: GtkToggleAction.html
4299 struct: GtkToggleAction
4300 class: ToggleAction
4301 prefix: gtk_toggle_action_
4302 prefix: gtk_
4303 import: glib.Str
4304 outFile: ToggleAction
4306 file: GtkRadioAction.html
4307 struct: GtkRadioAction
4308 class: RadioAction
4309 prefix: gtk_radio_action_
4310 prefix: gtk_
4311 import: glib.Str
4312 import: glib.ListSG
4313 structWrap: GSList* ListSG
4314 outFile: RadioAction
4316 ###########################################################
4317 ###  Selectors (File/Font/Color/Input Devices) ############
4318 ###########################################################
4320 file: GtkColorButton.html
4321 struct: GtkColorButton
4322 class: ColorButton
4323 prefix: gtk_color_button_
4324 prefix: gtk_
4325 import: glib.Str
4326 import: gdk.Color
4327 structWrap: GdkColor* Color
4328 outFile: ColorButton
4330 file: GtkColorSelection.html
4331 struct: GtkColorSelection
4332 class: ColorSelection
4333 prefix: gtk_color_selection_
4334 prefix: gtk_
4335 import: glib.Str
4336 import: gdk.Color
4337 structWrap: GdkColor* Color
4338 outFile: ColorSelection
4340 file: GtkColorSelectionDialog.html
4341 struct: GtkColorSelectionDialog
4342 class: ColorSelectionDialog
4343 prefix: gtk_color_selection_dialog_
4344 prefix: gtk_
4345 import: glib.Str
4346 outFile: ColorSelectionDialog
4348 file: GtkFileSelection.html
4349 struct: GtkFileSelection
4350 class: FileSelection
4351 prefix: gtk_file_selection_
4352 prefix: gtk_
4353 import: glib.Str
4354 outFile: FileSelection
4356 file: GtkFileChooser.html
4357 struct: GtkFileChooser
4358 class: FileChooser
4359 prefix: gtk_file_chooser_
4360 prefix: gtk_
4361 import: glib.Str
4362 import: gtk.Window
4363 structWrap: GtkWindow* Window
4364 import: glib.ListSG
4365 structWrap: GSList* ListSG
4366 import: gtk.Widget
4367 structWrap: GtkWidget* Widget
4368 import: gtk.FileFilter
4369 structWrap: GtkFileFilter* FileFilter
4370 outFile: FileChooser
4372 file: GtkFileChooserButton.html
4373 struct: GtkFileChooserButton
4374 class: FileChooserButton
4375 prefix: gtk_file_chooser_button_
4376 prefix: gtk_
4377 import: glib.Str
4378 import: gtk.Widget
4379 structWrap: GtkWidget* Widget
4380 import: glib.ListSG;
4381 import: gtk.Widget;
4382 import: gtk.FileFilter;
4383 import: gtk.FileChooser;
4385 code: start
4387         private FileChooser fileChooser;
4389         public FileChooser getFileChooser()
4390         {
4391                 if ( fileChooser is null )
4392                 {
4393                         fileChooser = new FileChooser(cast(GtkFileChooser*)getFileChooserButtonStruct());
4394                 }
4395                 return fileChooser;
4396         }
4397 code: end
4398 outFile: FileChooserButton
4400 file: GtkFileChooserDialog.html
4401 struct: GtkFileChooserDialog
4402 class: FileChooserDialog
4403 prefix: gtk_file_chooser_dialog_
4404 prefix: gtk_
4405 import: glib.Str
4406 import: gtk.Window
4407 structWrap: GtkWindow* Window
4408 import: glib.ListSG;
4409 import: gtk.Widget;
4410 import: gtk.FileFilter;
4411 import: gtk.FileChooser;
4412 import: glib.Str
4413 nocode: gtk_file_chooser_dialog_new
4414 nocode: gtk_file_chooser_dialog_new_with_backend
4416 code: start
4418         private FileChooser fileChooser;
4420         public FileChooser getFileChooser()
4421         {
4422                 if ( fileChooser is null )
4423                 {
4424                         fileChooser = new FileChooser(cast(GtkFileChooser*)getFileChooserDialogStruct());
4425                 }
4426                 return fileChooser;
4427         }
4429         /**
4430          * Creates a new GtkFileChooserDialog. This function is analogous to
4431          * gtk_dialog_new_with_buttons().
4432          * title:
4433          *  Title of the dialog, or NULL
4434          * parent:
4435          *  Transient parent of the dialog, or NULL
4436          * action:
4437          *  Open or save mode for the dialog
4438          * first_button_text:
4439          *  stock ID or text to go in the first button, or NULL
4440          * ...:
4441          *  response ID for the first button, then additional (button, id) pairs, ending with NULL
4442          * Returns:
4443          *  a new GtkFileChooserDialog
4444          * Since 2.4
4445          */
4446         this(char[] title, Window parent, FileChooserAction action,  char[][] buttonsText=null, ResponseType[] responses=null)
4447         {
4448                 if ( buttonsText  is  null )
4449                 {
4450                         buttonsText ~= "OK";
4451                         buttonsText ~= "Cancel";
4452                 }
4453                 if ( responses  is  null )
4454                 {
4455                         responses ~= ResponseType.GTK_RESPONSE_OK;
4456                         responses ~= ResponseType.GTK_RESPONSE_CANCEL;
4457                 }
4459                 this(
4460                         cast(GtkFileChooserDialog*)gtk_file_chooser_dialog_new(
4461                                 Str.toStringz(title),
4462                                 parent.getWindowStruct(),
4463                                 action,
4464                                 null,
4465                                 0));
4466                 addButtons(buttonsText, responses);
4467         }
4469         /**
4470          * Creates a new GtkFileChooserDialog with a specified backend. This is
4471          * especially useful if you use gtk_file_chooser_set_local_only() to allow
4472          * non-local files and you use a more expressive vfs, such as gnome-vfs,
4473          * to load files.
4474          * title:
4475          *  Title of the dialog, or NULL
4476          * parent:
4477          *  Transient parent of the dialog, or NULL
4478          * action:
4479          *  Open or save mode for the dialog
4480          * backend:
4481          *  The name of the specific filesystem backend to use.
4482          * first_button_text:
4483          *  stock ID or text to go in the first button, or NULL
4484          * ...:
4485          *  response ID for the first button, then additional (button, id) pairs, ending with NULL
4486          * Returns:
4487          *  a new GtkFileChooserDialog
4488          * Since 2.4
4489          * See Also
4490          *  GtkFileChooser, GtkDialog
4491          */
4492         public this (char[] title, Window parent, GtkFileChooserAction action, char[] backend,  char[][] buttonsText=null, ResponseType[] responses=null)
4493         {
4494                 // GtkWidget* gtk_file_chooser_dialog_new_with_backend  (const gchar *title,  GtkWindow *parent,  GtkFileChooserAction action,  const gchar *backend,  const gchar *first_button_text,  ...);
4495                 this(
4496                         cast(GtkFileChooserDialog*)gtk_file_chooser_dialog_new_with_backend(
4497                                 Str.toStringz(title), 
4498                                 parent.getWindowStruct(), 
4499                                 action, 
4500                                 Str.toStringz(backend), 
4501                                 null,
4502                                 0
4503                                 ));
4504                 if ( buttonsText  is  null )
4505                 {
4506                         buttonsText ~= "OK";
4507                         buttonsText ~= "Cancel";
4508                 }
4509                 if ( responses  is  null )
4510                 {
4511                         responses ~= ResponseType.GTK_RESPONSE_OK;
4512                         responses ~= ResponseType.GTK_RESPONSE_CANCEL;
4513                 }
4515                 addButtons(buttonsText, responses);
4516         }
4517         
4518 //      this(char[] title, Window parent, FileChooserAction action,  StockID[] buttons=null, ResponseType[] responses=null)
4519 //      {
4520 //              if ( buttons  is  null )
4521 //              {
4522 //                      buttons ~= STOCK_OK;
4523 //                      buttons ~= STOCK_CANCEL;
4524 //              }
4525 //              if ( responses  is  null )
4526 //              {
4527 //                      responses ~= ResponseType.GTK_RESPONSE_OK;
4528 //                      responses ~= ResponseType.GTK_RESPONSE_CANCEL;
4529 //              }
4531 //              this(gtk_file_chooser_dialog_new(
4532 //                              title.toStringz(),
4533 //                              parent.getWindowStruct(),
4534 //                              action,
4535 //                              null,
4536 //                              0));
4537 //              addButtons(buttons, responses);
4538 //      }
4540 code: end
4541 outFile: FileChooserDialog
4543 file: GtkFileChooserWidget.html
4544 struct: GtkFileChooserWidget
4545 class: FileChooserWidget
4546 prefix: gtk_file_chooser_widget_
4547 prefix: gtk_
4548 import: glib.Str
4549 import: glib.ListSG;
4550 import: gtk.Widget;
4551 import: gtk.FileFilter;
4552 import: gtk.FileChooser;
4554 code: start
4555         private FileChooser fileChooser;
4557         public FileChooser getFileChooser()
4558         {
4559                 if ( fileChooser is null )
4560                 {
4561                         fileChooser = new FileChooser(cast(GtkFileChooser*)getFileChooserWidgetStruct());
4562                 }
4563                 return fileChooser;
4564         }
4565 code: end
4566 outFile: FileChooserWidget
4568 file: gtk-gtkfilefilter.html
4569 struct:  GtkFileFilter
4570 class: FileFilter
4571 prefix: gtk_file_filter_
4572 prefix: gtk_
4573 import: glib.Str
4574 outFile: FileFilter
4576 file: GtkFontButton.html
4577 struct: GtkFontButton
4578 class: FontButton
4579 prefix: gtk_font_button_
4580 prefix: gtk_
4581 import: glib.Str
4582 outFile: FontButton
4584 file: GtkFontSelection.html
4585 struct: GtkFontSelection
4586 class: FontSelection
4587 prefix: gtk_font_selection_
4588 prefix: gtk_
4589 import: glib.Str
4590 import: gdk.Font
4591 structWrap: GdkFont* Font
4592 outFile: FontSelection
4594 file: GtkFontSelectionDialog.html
4595 struct: GtkFontSelectionDialog
4596 class: FontSelectionDialog
4597 prefix: gtk_font_selection_dialog_
4598 prefix: gtk_
4599 import: glib.Str
4600 import: gdk.Font
4601 structWrap: GdkFont* Font
4602 outFile: FontSelectionDialog
4604 file: GtkInputDialog.html
4605 struct: GtkInputDialog
4606 class: InputDialog
4607 prefix: gtk_input_dialog_
4608 prefix: gtk_
4609 outFile: InputDialog
4611 ###########################################################
4612 ### Layout Containers #####################################
4613 ###########################################################
4615 file: GtkAlignment.html
4616 struct: GtkAlignment
4617 class: Alignment
4618 prefix: gtk_alignment_
4619 prefix: gtk_
4620 import: gtk.Widget
4622 code: start
4623         public static Alignment center(Widget widget)
4624         {
4625                 Alignment a = new Alignment(0.5, 0.5, 0, 0);
4626                 a.add(widget);
4627                 return a;
4628         }
4629         
4630         public static Alignment north(Widget widget)
4631         {
4632                 Alignment a = new Alignment(0.5, 0.0, 0, 0);
4633                 a.add(widget);
4634                 return a;
4635         }
4636         
4637         public static Alignment south(Widget widget)
4638         {
4639                 Alignment a = new Alignment(0.5, 1.0, 0, 0);
4640                 a.add(widget);
4641                 return a;
4642         }
4643         
4644         public static Alignment east(Widget widget)
4645         {
4646                 Alignment a = new Alignment(1.0, 0.5, 0, 0);
4647                 a.add(widget);
4648                 return a;
4649         }
4650         
4651         public static Alignment west(Widget widget)
4652         {
4653                 Alignment a = new Alignment(0.0, 0.5, 0, 0);
4654                 a.add(widget);
4655                 return a;
4656         }
4657         
4658         public static Alignment northWest(Widget widget)
4659         {
4660                 Alignment a = new Alignment(0.0, 0.0, 0, 0);
4661                 a.add(widget);
4662                 return a;
4663         }
4665         public static Alignment southWest(Widget widget)
4666         {
4667                 Alignment a = new Alignment(0.0, 0.5, 0, 0);
4668                 a.add(widget);
4669                 return a;
4670         }
4672         public static Alignment northEast(Widget widget)
4673         {
4674                 Alignment a = new Alignment(1.0, 0.0, 0, 0);
4675                 a.add(widget);
4676                 return a;
4677         }
4679         public static Alignment southEast(Widget widget)
4680         {
4681                 Alignment a = new Alignment(1.0, 1.0, 0, 0);
4682                 a.add(widget);
4683                 return a;
4684         }
4686 code: end
4687 outFile: Alignment
4689 file: GtkAspectFrame.html
4690 struct: GtkAspectFrame
4691 class: AspectFrame
4692 prefix: gtk_aspect_frame_
4693 prefix: gtk_
4694 import: glib.Str
4695 outFile: AspectFrame
4697 file: GtkHBox.html
4698 struct: GtkHBox
4699 class: HBox
4700 prefix: gtk_hbox_
4701 prefix: gtk_
4702 outFile: HBox
4704 file: GtkVBox.html
4705 struct: GtkVBox
4706 class: VBox
4707 prefix: gtk_vbox_
4708 prefix: gtk_
4709 outFile: VBox
4711 file: GtkHButtonBox.html
4712 struct: GtkHButtonBox
4713 class: HButtonBox
4714 prefix: gtk_hbutton_box_
4715 prefix: gtk_
4716 code: start
4717         /**
4718          * Creates a new HButtonBox and sets comon parameters
4719          */
4720         static ButtonBox createActionBox()
4721         {
4722                 ButtonBox bBox = new HButtonBox();
4723                 bBox.setLayout(ButtonBoxStyle.END);
4724                 bBox.setBorderWidth(5);
4725                 bBox.setSpacing(7);
4726                 return bBox;
4727         }
4728         
4729 code: end
4730 outFile: HButtonBox
4732 file: GtkVButtonBox.html
4733 struct: GtkVButtonBox
4734 class: VButtonBox
4735 prefix: gtk_vbutton_box_
4736 prefix: gtk_
4737 code: start
4738     /**
4739      * Creates a new vertical button box and sets standart values for it's comon parameters
4740      * @return a new vertical button box
4741      */
4742         static ButtonBox createActionBox()
4743         {
4744                 ButtonBox bBox = new VButtonBox();
4745                 bBox.setLayout(ButtonBoxStyle.START);
4746                 bBox.setBorderWidth(5);
4747                 bBox.setSpacing(7);
4748                 return bBox;
4749         }
4750 code: end
4751 outFile: VButtonBox
4753 file: GtkFixed.html
4754 struct: GtkFixed
4755 class: Fixed
4756 prefix: gtk_fixed_
4757 prefix: gtk_
4758 import: gtk.Widget
4759 structWrap: GtkWidget* Widget
4760 outFile: Fixed
4762 file: GtkHPaned.html
4763 struct: GtkHPaned
4764 class: HPaned
4765 prefix: gtk_hpaned_
4766 prefix: gtk_
4767 structWrap: GtkWidget* Widget
4768 import: gtk.Widget
4770 code: start
4771         /**
4772          * Creates a new HPaned and adds two widgets as it's children
4773          * @param child1
4774          * @param child2
4775          */
4776         this(Widget child1, Widget child2)
4777         {
4778                 this();
4779                 add1(child1);
4780                 add2(child2);
4781         }
4782         
4783 code: end
4784 outFile: HPaned
4786 file: GtkVPaned.html
4787 struct: GtkVPaned
4788 class: VPaned
4789 prefix: gtk_vpaned_
4790 prefix: gtk_
4791 import: gtk.Widget
4793 code: start
4794         /**
4795          * Creates a new HPaned and adds two widgets as it's children
4796          * @param child1
4797          * @param child2
4798          */
4799         this(Widget child1, Widget child2)
4800         {
4801                 this();
4802                 add1(child1);
4803                 add2(child2);
4804         }
4805         
4806 code: end
4807 outFile: VPaned
4809 file: GtkLayout.html
4810 struct: GtkLayout
4811 class: Layout
4812 prefix: gtk_layout_
4813 prefix: gtk_
4814 import: gtk.Adjustment
4815 structWrap: GtkAdjustment* Adjustment
4816 import: gtk.Widget
4817 structWrap: GtkWidget* Widget
4818 outFile: Layout
4820 file: GtkNotebook.html
4821 struct: GtkNotebook
4822 class: Notebook
4823 prefix: gtk_notebook_
4824 prefix: gtk_
4825 import: glib.Str
4826 import: gtk.Label
4827 import: gtk.Widget
4828 structWrap: GtkWidget* Widget
4829 code: start
4830 /** The GtkNotebookTab is not documented */
4831 public enum GtkNotebookTab
4833   GTK_NOTEBOOK_TAB_FIRST,
4834   GTK_NOTEBOOK_TAB_LAST
4836 alias GtkNotebookTab NotebookTab;
4838         /**
4839          * Append a page with a widget and a text for a label
4840          */
4841         public int appendPage(Widget child, char[] tabLabel)
4842         {
4843                 return appendPage(child, new Label(tabLabel));
4844         }
4846         void setCurrentPage(Widget child)
4847         {
4848                 gtk_notebook_set_current_page(gtkNotebook,gtk_notebook_page_num(gtkNotebook, child.getWidgetStruct()));
4849         }
4850         
4853 code: end
4854 outFile: Notebook
4856 file: GtkTable.html
4857 struct: GtkTable
4858 class: Table
4859 import: gtk.Widget
4860 structWrap: GtkWidget* Widget
4861 prefix: gtk_table_
4862 prefix: gtk_
4864 nocode: gtk_table_new
4866 code: start
4868         int row;
4869         int col;
4870         int maxRows;
4871         int maxCols;
4873         public AttachOptions defaultXOption = AttachOptions.SHRINK;
4874         public AttachOptions defaultYOption = AttachOptions.SHRINK;
4875         
4876         /**
4877          * Removes all children and resizes the table to 1,1
4878          */
4879         void removeAll()
4880         {
4881                 super.removeAll();
4882                 resize(1,1);
4883         }
4884         
4885         /**
4886          * Used to create a new table widget. An initial size must be given by
4887          * specifying how many rows and columns the table should have, although
4888          * this can be changed later with gtk_table_resize(). rows and columns
4889          * must both be in the range 0 .. 65535.
4890          * rows:
4891          * The number of rows the new table should have.
4892          * columns:
4893          * The number of columns the new table should have.
4894          * homogeneous:
4895          * If set to TRUE, all table cells are resized to the size of the cell
4896          * containing the largest widget.
4897          * Returns:
4898          * A pointer to the the newly created table widget.
4899          */
4900         public this (uint rows, uint columns, int homogeneous)
4901         {
4902                 // GtkWidget* gtk_table_new (guint rows,  guint columns,  gboolean homogeneous);
4903                 this(cast(GtkTable*)gtk_table_new(rows, columns, homogeneous) );
4904                 row = 0;
4905                 col = 0;
4906                 maxRows = rows;
4907                 maxCols = columns;
4908         }
4909         
4911         /**
4912          * Attach a new widget creating a new row if necessary
4913          */
4914         void attach(Widget child)
4915         {
4916                 attach(child, col, col + 1, row, row + 1,
4917                                 defaultXOption, defaultYOption,
4918                                 getDefaultColSpacing(), getDefaultRowSpacing());
4919                 ++col;
4920                 if (col >= maxCols)
4921                 {
4922                         col = 0;
4923                         ++row;
4924                 }
4925         }
4928 code: end
4929 outFile: Table
4931 file: GtkExpander.html
4932 struct: GtkExpander
4933 class: Expander
4934 prefix: gtk_expander_
4935 prefix: gtk_
4936 import: glib.Str
4937 import: gtk.Widget
4938 structWrap: GtkWidget* Widget
4940 nocode: gtk_expander_new
4941 nocode: gtk_expander_new_with_mnemonic
4943 code: start
4944         /**
4945          * Creates a new expander using label as the text of the label.
4946          * If mnemonic os true 
4947          * If characters in label are preceded by an underscore, they are underlined.
4948          * If you need a literal underscore character in a label, use '__' (two
4949          * underscores). The first underlined character represents a keyboard
4950          * accelerator called a mnemonic.
4951          * label:
4952          *  the text of the label
4953          * Returns:
4954          *  a new GtkExpander widget.
4955          * Since 2.4
4956          */
4957         public this (char[] label, bool mnemonic=true)
4958         {
4959                 if ( mnemonic )
4960                 {
4961                         // GtkWidget* gtk_expander_new_with_mnemonic (const gchar *label);
4962                         this(cast(GtkExpander*)gtk_expander_new_with_mnemonic(Str.toStringz(label)) );
4963                 }
4964                 else
4965                 {
4966                         // GtkWidget* gtk_expander_new (const gchar *label);
4967                         this(cast(GtkExpander*)gtk_expander_new(Str.toStringz(label)) );
4968                 }
4969         }
4970 code: end
4972 outFile: Expander
4974 ###########################################################
4975 ### Ornaments #############################################
4976 ###########################################################
4978 file: GtkFrame.html
4979 struct: GtkFrame
4980 class: Frame
4981 prefix: gtk_frame_
4982 prefix: gtk_
4983 import: glib.Str
4984 import: gtk.Widget
4985 structWrap: GtkWidget* Widget
4986 code: start
4988  * Creates frame with label and set it's child widget
4989  */
4990 public this(Widget widget, char[] label)
4992         this(label);
4993         add(widget);
4995 code: end
4997 outFile: Frame
4999 file: GtkHSeparator.html
5000 struct: GtkHSeparator
5001 class: HSeparator
5002 prefix: gtk_hseparator_
5003 prefix: gtk_
5004 outFile: HSeparator
5006 file: GtkVSeparator.html
5007 struct: GtkVSeparator
5008 class: VSeparator
5009 prefix: gtk_vseparator_
5010 prefix: gtk_
5011 outFile: VSeparator
5013 ###########################################################
5014 ### Scrolling #############################################
5015 ###########################################################
5017 file: GtkHScrollbar.html
5018 struct: GtkHScrollbar
5019 class: HScrollbar
5020 prefix: gtk_hscrollbar_
5021 prefix: gtk_
5022 import: gtk.Adjustment
5023 structWrap: GtkAdjustment* Adjustment
5024 outFile: HScrollbar
5026 file: GtkVScrollbar.html
5027 struct: GtkVScrollbar
5028 class: VScrollbar
5029 prefix: gtk_vscrollbar_
5030 prefix: gtk_
5031 import: gtk.Adjustment
5032 structWrap: GtkAdjustment* Adjustment
5033 outFile: VScrollbar
5035 file: GtkScrolledWindow.html
5036 struct: GtkScrolledWindow
5037 class: ScrolledWindow
5038 prefix: gtk_scrolled_window_
5039 prefix: gtk_
5040 import: gtk.Widget
5041 structWrap: GtkWidget* Widget
5042 import: gtk.Adjustment
5043 structWrap: GtkAdjustment* Adjustment
5046 nocode: gtk_scrolled_window_new
5047 code: start
5049         public this()
5050         {
5051                 this(null, null);
5052         }
5053         
5054         public this(Widget widget)
5055         {
5056                 this();
5057                 addWithViewport(widget);
5058         }
5059         
5060         /**
5061          * Creates a new scrolled window. The two arguments are the scrolled
5062          * window's adjustments; these will be shared with the scrollbars and the
5063          * child widget to keep the bars in sync with the child. Usually you want
5064          * to pass NULL for the adjustments, which will cause the scrolled window
5065          * to create them for you.
5066          * hadjustment:
5067          * Horizontal adjustment.
5068          * vadjustment:
5069          * Vertical adjustment.
5070          * Returns:
5071          * New scrolled window.
5072          */
5073         public this (Adjustment hadjustment, Adjustment vadjustment)
5074         {
5075                 // GtkWidget* gtk_scrolled_window_new (GtkAdjustment *hadjustment,  GtkAdjustment *vadjustment);
5076                 this(cast(GtkScrolledWindow*)gtk_scrolled_window_new(
5077                                 hadjustment is null ? null : hadjustment.getAdjustmentStruct(), 
5078                                 vadjustment is null ? null : vadjustment.getAdjustmentStruct()) 
5079                                 );
5080         }
5082         /**
5083          * Creates a new Scrolled window and set the policy type
5084          * @param hPolicy the horizontal policy
5085          * @param vPolicy the vertical policy
5086          */
5087         this(PolicyType hPolicy, PolicyType vPolicy)
5088         {
5089                 this();
5090                 setPolicy(hPolicy, vPolicy);
5091         }
5092 code: end
5093 outFile: ScrolledWindow
5095 ###########################################################
5096 ### Miscellaneous #########################################
5097 ###########################################################
5099 file: GtkAdjustment.html
5100 struct: GtkAdjustment
5101 class: Adjustment
5102 prefix: gtk_adjustment_
5103 prefix: gtk_
5104 import: gtk.ObjectGtk
5105 structWrap: GtkObject* ObjectGtk
5106 outFile: Adjustment
5108 file: GtkArrow.html
5109 struct: GtkArrow
5110 class: Arrow
5111 prefix: gtk_arrow_
5112 prefix: gtk_
5113 outFile: Arrow
5115 file: GtkCalendar.html
5116 struct: GtkCalendar
5117 class: Calendar
5118 prefix: gtk_calendar_
5119 prefix: gtk_
5120 outFile: Calendar
5122 file: GtkDrawingArea.html
5123 struct: GtkDrawingArea
5124 class: DrawingArea
5125 prefix: gtk_drawing_area_
5126 prefix: gtk_
5128 code: start
5129         /**
5130          * Create a new DrawingArea and sets the SizeRequest
5131          * Params:
5132          *      width =         
5133          *      height =        
5134          * Returns: 
5135          */
5136         this(int width, int height)
5137         {
5138                 this();
5139                 setSizeRequest(width, height);
5140         }
5141         
5142 code: end
5144 outFile: DrawingArea
5146 file: GtkEventBox.html
5147 struct: GtkEventBox
5148 class: EventBox
5149 prefix: gtk_event_box_
5150 prefix: gtk_
5151 outFile: EventBox
5153 file: GtkHandleBox.html
5154 struct: GtkHandleBox
5155 class: HandleBox
5156 prefix: gtk_handle_box_
5157 prefix: gtk_
5158 outFile: HandleBox
5160 file: GtkIMContextSimple.html
5161 struct: GtkIMContextSimple
5162 class: IMContextSimple
5163 prefix: gtk_im_context_simple_
5164 prefix: gtk_
5165 import: gtk.IMContext
5166 structWrap: GtkIMContext* IMContext
5167 outFile: IMContextSimple
5169 file: GtkIMMulticontext.html
5170 struct: GtkIMMulticontext
5171 class: IMMulticontext
5172 prefix: gtk_im_multicontext_
5173 prefix: gtk_
5174 import: gtk.IMContext
5175 structWrap: GtkIMContext* IMContext
5176 import: gtk.MenuShell
5177 structWrap: GtkMenuShell* MenuShell
5178 outFile: IMMulticontext
5180 file: GtkSizeGroup.html
5181 struct: GtkSizeGroup
5182 class: SizeGroup
5183 prefix: gtk_size_group_
5184 prefix: gtk_
5185 import: gtk.Widget
5186 structWrap: GtkWidget* Widget
5187 outFile: SizeGroup
5189 file: GtkTooltips.html
5190 struct: GtkTooltips
5191 class: Tooltips
5192 prefix: gtk_tooltips_
5193 prefix: gtk_
5194 import: glib.Str
5195 import: gtk.Widget
5196 structWrap: GtkWidget* Widget
5197 #import: gtk.TooltipsData
5198 #structWrap: GtkTooltipsData* TooltipsData
5199 import: gtk.Window
5200 structWrap: GtkWindow* Window
5201 outFile: Tooltips
5203 file: GtkViewport.html
5204 struct: GtkViewport
5205 class: Viewport
5206 prefix: gtk_viewport_
5207 prefix: gtk_
5208 import: gtk.Adjustment
5209 structWrap: GtkAdjustment* Adjustment
5210 outFile: Viewport
5212 file: GtkAccessible.html
5213 struct: GtkAccessible
5214 class: Accessible
5215 prefix: gtk_accessible_
5216 prefix: gtk_
5217 outFile: Accessible
5219 ###########################################################
5220 ### Abstract Base Classes #################################
5221 ###########################################################
5223 file: GtkBin.html
5224 struct: GtkBin
5225 class: Bin
5226 prefix: gtk_bin_
5227 prefix: gtk_
5228 import: gtk.Widget
5229 structWrap: GtkWidget* Widget
5231 nocode: gtk_bin_get_child
5233 code: start
5234         /**
5235          * Gets the child of the GtkBin, or NULL if the bin contains
5236          * no child widget. The returned widget does not have a reference
5237          * added, so you do not need to unref it.
5238          * bin:
5239          *  a GtkBin
5240          * Returns:
5241          *  pointer to child of the GtkBin
5242          */
5243         public Widget getChild()
5244         {
5245                 // GtkWidget* gtk_bin_get_child (GtkBin *bin);
5246                 GtkWidget * gtkWidget = gtk_bin_get_child(gtkBin);
5247                 if ( gtkWidget )
5248                 {
5249                         return new Widget(gtkWidget);
5250                 }
5251                 else
5252                 {
5253                         return null;
5254                 }
5255         }
5256 code: end
5258 outFile: Bin
5260 file: GtkBox.html
5261 struct: GtkBox
5262 class: Box
5263 import: gtk.Widget
5264 structWrap: GtkWidget* Widget
5265 prefix: gtk_box_
5266 prefix: gtk_
5267 #import: gtk.PackType
5268 #structWrap: GtkPackType* PackType
5269 outFile: Box
5271 file: GtkButtonBox.html
5272 struct: GtkButtonBox
5273 class: ButtonBox
5274 prefix: gtk_button_box_
5275 prefix: gtk_
5276 import: gtk.Widget
5277 structWrap: GtkWidget* Widget
5278 import: gtk.Button
5279 import: gtk.HButtonBox
5280 import: gtk.VButtonBox
5281 code: start
5282         static ButtonBox createActionBox(
5283                         void delegate(Button) onClicked, 
5284                         StockID[] stocks, 
5285                         char[][] actions,
5286                         bool vertical=false
5287                 )
5288         {
5289                 ButtonBox bBox;
5290                 if ( vertical )
5291                 {
5292                         bBox = VButtonBox.createActionBox();
5293                 }
5294                 else
5295                 {
5296                         bBox = HButtonBox.createActionBox();
5297                 }
5299                 Button button;
5300                 for( int i=0 ; i<stocks.length && i<actions.length ; i++)
5301                 {
5302                         button =  new Button(stocks[i]);
5303                         bBox.packEnd(button, false, false, 7);
5304                         button.setActionName(actions[i]);
5305                         button.addOnClicked(onClicked);
5306                 }
5307                 return bBox;
5308         }
5309         
5310         static ButtonBox createOkBox(void delegate(Button) onClicked)
5311         {
5312                 static StockID[] stocks = [StockID.OK];
5313                 char[][] actions;
5314                 actions ~= "action.ok";
5315                 return createActionBox(onClicked, stocks, actions);
5316         }
5318         static ButtonBox createOkCancelBox(void delegate(Button) onClicked)
5319         {
5320                 static StockID[] stocks = [StockID.OK, StockID.CANCEL];
5321                 char[][] actions;
5322                 actions ~= "action.ok";
5323                 actions ~= "action.cancel";
5324                 return createActionBox(onClicked, stocks, actions);
5325         }
5326 code: end
5327 outFile: ButtonBox
5329 file: GtkContainer.html
5330 struct: GtkContainer
5331 class: Container
5332 structWrap: GtkContainerClass* Container
5333 structWrap: GtkWidget* Widget
5334 import: glib.Str
5335 import: gtk.Adjustment
5336 structWrap: GtkAdjustment* Adjustment
5337 prefix: gtk_container_
5338 prefix: gtk_
5339 import: glib.ListG
5340 structWrap: GList* ListG
5341 import: gobject.Value
5342 structWrap: GValue* Value
5343 #import: gdk.EventExpose
5344 #structWrap: GdkEventExpose* EventExpose
5345 #import: gobject.ParamSpec
5346 #structWrap: GParamSpec* ParamSpec
5347 #import: g.ObjectClass
5348 #structWrap: GObjectClass* ObjectClass
5350 code: start
5352         /**
5353          * Removes all widgets from the container
5354          */
5355         void removeAll()
5356         {
5357                 GList* gList = gtk_container_get_children(getContainerStruct());
5358                 if ( gList !is null )
5359                 {
5360                         ListG children = new ListG(gList);
5361                         for ( int i=children.length()-1 ; i>=0 ; i-- )
5362                         {
5363                                 gtk_container_remove(getContainerStruct(), cast(GtkWidget*)children.nthData(i));
5364                         }
5365                 }
5366         }
5368 code: end
5369 outFile: Container
5371 file: GtkItem.html
5372 struct: GtkItem
5373 class: Item
5374 prefix: gtk_item_
5375 prefix: gtk_
5376 outFile: Item
5378 file: GtkMisc.html
5379 struct: GtkMisc
5380 class: Misc
5381 prefix: gtk_misc_
5382 prefix: gtk_
5383 outFile: Misc
5385 file: GtkObject.html
5386 struct: GtkObject
5387 class: ObjectGtk
5388 prefix: gtk_object_
5389 prefix: gtk_
5390 import: glib.Str
5392 code: star
5393         public static char[] getId(StockID id)
5394         {
5395                 return StockDesc[id];
5396         }
5397 code: end
5399 outFile: ObjectGtk
5401 file: GtkPaned.html
5402 struct: GtkPaned
5403 class: Paned
5404 prefix: gtk_paned_
5405 prefix: gtk_
5406 import: gtk.Widget
5407 structWrap: GtkWidget* Widget
5409 code: start
5411         public void add(Widget child1, Widget child2)
5412         {
5413                 add1(child1);
5414                 add2(child2);
5415         }
5417 code: end
5418 outFile: Paned
5420 file: GtkRange.html
5421 struct: GtkRange
5422 class: Range
5423 prefix: gtk_range_
5424 prefix: gtk_
5425 import: gtk.Adjustment
5426 structWrap: GtkAdjustment* Adjustment
5427 outFile: Range
5429 file: GtkScale.html
5430 struct: GtkScale
5431 class: Scale
5432 prefix: gtk_scale_
5433 prefix: gtk_
5434 outFile: Scale
5436 file: GtkScrollbar.html
5437 struct: GtkScrollbar
5438 class: Scrollbar
5439 prefix: gtk_scrollbar_
5440 prefix: gtk_
5441 outFile: Scrollbar
5443 file: GtkSeparator.html
5444 struct: GtkSeparator
5445 class: Separator
5446 prefix: gtk_separator
5447 prefix: gtk_
5448 outFile: Separator
5450 file: GtkWidget.html
5451 struct: GtkWidget
5452 class: Widget
5453 import: glib.Str
5454 import: atk.ObjectAtk
5455 structWrap: AtkObject* ObjectAtk
5456 prefix: gtk_widget_
5457 prefix: gtk_
5458 # This function is exactly the same as calling g_object_ref(), and exists mostly for historical reasons.
5459 noprefix: gtk_widget_ref
5460 import: gdk.Rectangle
5461 structWrap: GdkRectangle* Rectangle
5462 #import: gtk.Requisition
5463 #structWrap: GtkRequisition* Requisition
5464 #import: gtk.Allocation
5465 #structWrap: GtkAllocation* Allocation
5466 import: gtk.AccelGroup
5467 structWrap: GtkAccelGroup* AccelGroup
5468 import: glib.ListG
5469 structWrap: GList* ListG
5470 import: gdk.Event
5471 structWrap: GdkEvent* Event
5472 import: gdk.Window
5473 structWrap: GdkWindow* Window
5474 import: gdk.Colormap
5475 structWrap: GdkColormap* Colormap
5476 import: gdk.Visual
5477 structWrap: GdkVisual* Visual
5478 import: gtk.Style
5479 structWrap: GtkStyle* Style
5480 import: gdk.Bitmap
5481 structWrap: GdkBitmap* Bitmap
5482 import: gtk.RcStyle
5483 structWrap: GtkRcStyle* RcStyle
5484 import: gdk.Color
5485 structWrap: GdkColor* Color
5486 import: gdk.Pixbuf
5487 structWrap: GdkPixbuf* Pixbuf
5488 import: gtk.Adjustment
5489 structWrap: GtkAdjustment* Adjustment
5490 #import: gtk.WidgetClass
5491 #structWrap: GtkWidgetClass* WidgetClass
5492 #import: g.ParamSpec
5493 #structWrap: GParamSpec* ParamSpec
5494 import: gdk.Region
5495 structWrap: GdkRegion* Region
5496 import: gobject.Value
5497 structWrap: GValue* Value
5498 import: gtk.Settings
5499 structWrap: GtkSettings* Settings
5500 import: gtk.Clipboard
5501 structWrap: GtkClipboard* Clipboard
5502 import: gdk.Display
5503 structWrap: GdkDisplay* Display
5504 import: gdk.Screen
5505 structWrap: GdkScreen* Screen
5506 import: gtkc.gdk
5507 import: gdk.Cursor
5509 import: pango.PgLayout
5510 structWrap: PangoLayout* PgLayout
5511 import: pango.PgContext
5512 structWrap: PangoContext* PgContext
5513 import: pango.PgFontDescription
5514 structWrap: PangoFontDescription* PgFontDescription
5515 import: gdk.Drawable
5516 import: gtk.Tooltips
5518 code: start
5520         public int getWidth()
5521         {
5522                 int width;
5523                 gtk_widget_get_size_request(gtkWidget, &width, null);
5524                 return width;
5525         }
5526         public int getHeight()
5527         {
5528                 int height;
5529                 gtk_widget_get_size_request(gtkWidget, null, &height);
5530                 return height;
5531         }
5532         
5533         /**
5534          * Gets the drawable for this widget
5535          * return:
5536          *              The drawable for this widget
5537          */
5538         Drawable getDrawable()
5539         {
5540                 
5541 //              ubyte *p = cast(ubyte*)getStruct();
5543 //              for ( int i=0 ; i<120 ; i+=4 )
5544 //              {
5545 //                      printf("(%d) %X %x %x %x %x\n", i,p,*(p+0), *(p+1), *(p+2), *(p+3));
5546 //                      p+=4;
5547 //              }
5548 //              
5549 //              int* pt =cast(int*)getStruct();
5550 //              
5551 //              printf("pt=%X strcut=%X\n", pt, getStruct());
5552 //              printf("*pt=%X\n", *pt);
5553 //              pt+=52/4;
5554 //              printf("pt+52=%X strcut.window=%X\n", pt, getWidgetStruct().window);
5555 //              printf("*pt+52=%X\n", *pt);
5556 //              
5557 //              //return new Drawable(cast(GdkDrawable*)(getWidgetStruct().window));
5558                 int* pt =cast(int*)getStruct();
5559                 pt += 52/4;
5560                 return new Drawable(cast(GdkDrawable*)(*pt));
5561         }
5563          * Gets the Window for this widget
5564          * return:
5565          *              The window for this widget
5566          */
5567         Window getWindow()
5568         {
5569                 
5570                 //              ubyte *p = cast(ubyte*)getStruct();
5571                 //
5572                 //              for ( int i=0 ; i<120 ; i+=4 )
5573                 //              {
5574                         //                      printf("(%d) %X %x %x %x %x\n", i,p,*(p+0), *(p+1), *(p+2), *(p+3));
5575                         //                      p+=4;
5576                 //              }
5577                 //
5578                 //              int* pt =cast(int*)getStruct();
5579                 //
5580                 //              printf("pt=%X strcut=%X\n", pt, getStruct());
5581                 //              printf("*pt=%X\n", *pt);
5582                 //              pt+=52/4;
5583                 //              printf("pt+52=%X strcut.window=%X\n", pt, getWidgetStruct().window);
5584                 //              printf("*pt+52=%X\n", *pt);
5585                 //
5586                 //              //return new Drawable(cast(GdkDrawable*)(getWidgetStruct().window));
5587                 int* pt =cast(int*)getStruct();
5588                 pt += 52/4;
5589                 return new Window(cast(GdkWindow*)(*pt));
5590         }
5591         /**
5592          * Sets  the cursor.
5593          * @param cursor the new cursor
5594          * \bug the cursor changes to the parent widget also
5595          */
5596         void setCursor(Cursor cursor)
5597         {
5598                 int* pt =cast(int*)getStruct();
5599                 pt += 52/4;
5600                 gdk_window_set_cursor(cast(GdkWindow*)(*pt), cursor.getCursorStruct());
5601         }
5602         
5603         /**
5604          * Resets the cursor.
5605          * don't know if this is implemented by GTK+. Seems that it's not
5606          * \bug does nothing
5607          */
5608         public void resetCursor()
5609         {
5610                 int* pt =cast(int*)getStruct();
5611                 pt += 52/4;
5612                 gdk_window_set_cursor(cast(GdkWindow*)(*pt), null);
5613         }
5615         version(Tango)import tango.text.convert.Integer;
5617         /**
5618          * Modifies the font for this widget.
5619          * This just calls modifyFont(new PgFontDescription(PgFontDescription.fromString(family ~ " " ~ size)));
5620          */
5621         public void modifyFont(char[] family, int size)
5622         {
5623                 if ( size < 0 ) size = -size;   // hack to workaround leds bug - TO BE REMOVED
5625                 version(Tango)
5626                 {
5627                         char[10] s;
5628                         modifyFont(
5629                                 new PgFontDescription(
5630                                                 PgFontDescription.fromString(
5631                                                         family ~ " " ~ itoa(s,size)
5632                                                 )
5633                                 )
5634                         );
5635                 }
5636                 else
5637                 {
5638                         modifyFont(
5639                                 new PgFontDescription(
5640                                                 PgFontDescription.fromString(
5641                                                         family ~ " " ~ std.string.toString(size)
5642                                                 )
5643                                 )
5644                         );
5645                 }
5646         }
5647         
5648         
5649         /**
5650          * Sets this widget tooltip
5651          * @param tipText the tooltip
5652          * @param tipPrivate a private text
5653          */
5654         void setTooltip(char[] tipText, char[] tipPrivate)
5655         {
5656                 Tooltips tt = new Tooltips();
5657                 tt.setTip(this, tipText, tipPrivate);
5658         }
5662 code: end
5664 outFile: Widget
5666 file: GtkIMContext.html
5667 struct: GtkIMContext
5668 class: IMContext
5669 prefix: gtk_im_context_
5670 prefix: gtk_
5671 import: glib.Str
5672 import: gdk.Window
5673 structWrap: GdkWindow* Window
5674 #import: gtk.EventKey
5675 #structWrap: GdkEventKey* EventKey
5676 import: gdk.Rectangle
5677 structWrap: GdkRectangle* Rectangle
5678 outFile: IMContext
5680 ###########################################################
5681 ### Cross-process Embedding ###############################
5682 ###########################################################
5684 file: GtkPlug.html
5685 struct: GtkPlug
5686 class: Plug
5687 prefix: gtk_plug_
5688 prefix: gtk_
5689 import: gdk.Display
5690 structWrap: GdkDisplay* Display
5691 outFile: Plug
5693 file: GtkSocket.html
5694 struct: GtkSocket
5695 class: Socket
5696 prefix: gtk_socket_
5697 prefix: gtk_
5698 outFile: Socket
5700 ###########################################################
5701 ### Special-purpose features ##############################
5702 ###########################################################
5704 file: GtkCurve.html
5705 struct: GtkCurve
5706 class: Curve
5707 prefix: gtk_curve_
5708 prefix: gtk_
5709 outFile: Curve
5711 file: GtkGammaCurve.html
5712 struct: GtkGammaCurve
5713 class: GammaCurve
5714 prefix: gtk_gamma_curve_
5715 prefix: gtk_
5716 outFile: GammaCurve
5718 file: GtkRuler.html
5719 struct: GtkRuler
5720 class: Ruler
5721 prefix: gtk_ruler_
5722 prefix: gtk_
5723 outFile: Ruler
5725 file: GtkHRuler.html
5726 struct: GtkHRuler
5727 class: HRuler
5728 prefix: gtk_hruler_
5729 prefix: gtk_
5730 outFile: HRuler
5732 file: GtkVRuler.html
5733 struct: GtkVRuler
5734 class: VRuler
5735 prefix: gtk_vruler_
5736 prefix: gtk_
5737 outFile: VRuler
5739 ###########################################################
5740 ### Deprecated ############################################
5741 ###########################################################
5743 #file: GtkCList.html
5744 #struct: 
5745 #class: 
5746 #prefix: 
5747 #prefix: gtk_
5748 #outFile: 
5750 #file: GtkCTree.html
5751 #struct: 
5752 #class: 
5753 #prefix: 
5754 #prefix: gtk_
5755 #outFile: 
5757 #file: GtkCombo.html
5758 #struct: 
5759 #class: 
5760 #prefix: 
5761 #prefix: gtk_
5762 #outFile: 
5764 file: GtkItemFactory.html
5765 struct: GtkItemFactory
5766 class: ItemFactory
5767 prefix: gtk_item_factory_
5768 prefix: gtk_
5769 noprefix: gtk_item_factory_create_menu_entries
5770 import: glib.Str
5771 import: gtk.AccelGroup
5772 structWrap: GtkAccelGroup* AccelGroup
5773 import: gtk.Widget
5774 structWrap: GtkWidget* Widget
5775 import: gtk.ItemFactory
5776 structWrap: GtkItemFactory* ItemFactory
5777 #import: gtk.ItemFactoryEntry
5778 #structWrap: GtkItemFactoryEntry* ItemFactoryEntry
5779 outFile: ItemFactory
5781 #file: GtkList.html
5782 #struct: 
5783 #class: 
5784 #prefix: 
5785 #prefix: gtk_
5786 #outFile: 
5788 #file: GtkListItem.html
5789 #struct: 
5790 #class: 
5791 #prefix: 
5792 #prefix: gtk_
5793 #outFile: 
5795 #file: GtkOldEditable.html
5796 #struct: 
5797 #class: 
5798 #prefix: 
5799 #prefix: gtk_
5800 #outFile: 
5802 #file: GtkOptionMenu.html
5803 #struct: 
5804 #class: 
5805 #prefix: 
5806 #prefix: gtk_
5807 #outFile: 
5809 #file: GtkPixmap.html
5810 #struct: 
5811 #class: 
5812 #prefix: 
5813 #prefix: gtk_
5814 #outFile: 
5816 #file: GtkPreview.html
5817 #struct: 
5818 #class: 
5819 #prefix: 
5820 #prefix: gtk_
5821 #outFile: 
5823 #file: GtkText.html
5824 #struct: 
5825 #class: 
5826 #prefix: 
5827 #prefix: gtk_
5828 #outFile: 
5830 #file: gtkTipsQuery.html
5831 #struct: 
5832 #class: 
5833 #prefix: 
5834 #prefix: gtk_
5835 #outFile: 
5837 #file: GtkTree.html
5838 #struct: 
5839 #class: 
5840 #prefix: 
5841 #prefix: gtk_
5842 #outFile: 
5844 #file: GtkTreeItem.html
5845 #struct: 
5846 #class: 
5847 #prefix: 
5848 #prefix: gtk_
5849 #outFile: 
5851 file: GtkProgress.html
5852 struct: GtkProgress
5853 class: Progress
5854 prefix: gtk_progress_
5855 prefix: gtk_
5856 import: glib.Str
5857 import: gtk.Adjustment
5858 structWrap: GtkAdjustment* Adjustment
5859 outFile: Progress