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