2 # This file is part of gtkD.
4 # gtkD is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU Lesser General Public License as published by
6 # the Free Software Foundation; either version 2.1 of the License, or
7 # (at your option) any later version.
9 # gtkD is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public License
15 # along with gtkD; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 # Definitions for wrapping Gtk
28 # must start with wrap
33 public import gtkc.glibtypes;
34 public import gtkc.gobjecttypes;
35 public import gtkc.pangotypes;
36 public import gtkc.atktypes;
37 public import gtkc.gdkpixbuftypes;
38 public import gtkc.gdktypes;
39 alias void GtkAccelGroupEntry;
40 alias void GtkContainerClass;
42 //alias GTokenType.G_TOKEN_LAST G_TOKEN_LAST;";
43 //alias GtkSignalRunType.G_SIGNAL_RUN_FIRST G_SIGNAL_RUN_FIRST;
44 //alias GtkSignalRunType.G_SIGNAL_RUN_LAST G_SIGNAL_RUN_LAST;
45 //alias GtkSignalRunType.G_SIGNAL_NO_RECURSE G_SIGNAL_NO_RECURSE;
46 //alias GtkSignalRunType.G_SIGNAL_ACTION G_SIGNAL_ACTION;
47 //alias GtkSignalRunType.G_SIGNAL_NO_HOOKS G_SIGNAL_NO_HOOKS;
49 alias int GtkDragResult;
63 /* GtkTextIter is an opaque datatype; ignore all these fields.
64 * Initialize the iter with gtk_text_buffer_get_iter_*
103 ###########################################################
104 ### Core Reference ########################################
105 ###########################################################
108 file: gtk-General.html
116 noprefix: gtk_timeout_
118 #import: g.OptionEntry
119 #structWrap: GOptionEntry* OptionEntry
121 #structWrap: GError** Error*
122 #import: g.OptionGroup
123 #structWrap: GOptionGroup* OptionGroup
125 structWrap: GdkEvent* Event
127 structWrap: GtkWidget* Widget
128 import: gtk.ObjectGtk
129 structWrap: GtkObject* ObjectGtk
130 #import: gdk.ModifierType
131 #structWrap: GdkModifierType* ModifierType
134 import: gthread.Thread
136 moduleAlias: GtkD Gtk
140 * Call this function before using any other GTK+ functions in your GUI applications.
142 public static void init(char[][] args)
144 char** argv = (new char*[args.length]).ptr;
146 foreach (char[] p; args)
148 argv[argc++] = cast(char*)p;
155 * This initiates GtkD to supports multi threaded programs.
156 * read full documantation at http://gtk.org/faq/#AEN482
158 * "There is a single global lock that you must acquire with
159 * gdk_threads_enter() before making any GDK calls,
160 * and release with gdk_threads_leave() afterwards throughout your code."
161 * This is to be used on any call to GDK not executed from the main thread.
163 public static void initMultiThread(char[][] args)
177 /** Holds all timeout delegates */
178 bool delegate()[] timeoutListeners;
179 /** our gtk timeout ID */
184 * Creates a new timeout cycle.
186 * interval = the timeout in milieconds
187 * delegate() = the delegate to be executed
188 * fireNow = When true the delegate will be executed emmidiatly
191 this(uint interval, bool delegate() dlg, bool fireNow=false)
193 timeoutListeners ~= dlg;
194 timeoutID = gtk_timeout_add(interval, cast(GtkFunction)&timeoutCallback, cast(void*)this);
199 timeoutListeners.length = 0;
208 gtk_timeout_remove(timeoutID);
210 timeoutListeners.length = 0;
214 * Removes the timeout from gtk
223 * Adds a new delegate to this timeout cycle
228 public void addListener(bool delegate() dlg, bool fireNow=false)
230 timeoutListeners ~= dlg;
235 timeoutListeners.length = timeoutListeners.length - 1;
241 * The callback execution from glib
246 extern(C) static bool timeoutCallback(Timeout timeout)
248 return timeout.callAllListeners();
252 * Executes all delegates on the execution list
255 private bool callAllListeners()
257 bool runAgain = false;
261 while ( i<timeoutListeners.length )
263 if ( !timeoutListeners[i]() )
265 timeoutListeners = timeoutListeners[0..i] ~ timeoutListeners[i+1..timeoutListeners.length];
282 /** Holds all idle delegates */
283 bool delegate()[] idleListeners;
284 /** our gtk idle ID */
288 * Creates a new idle cycle.
290 * interval = the idle in milieconds
291 * delegate() = the delegate to be executed
292 * fireNow = When true the delegate will be executed emmidiatly
295 this(bool delegate() dlg, bool fireNow=false)
297 idleListeners ~= dlg;
298 idleID = gtk_idle_add(cast(GtkFunction)&idleCallback, cast(void*)this);
303 idleListeners.length = 0;
312 gtk_idle_remove(idleID);
314 idleListeners.length = 0;
318 * Removes the idle from gtk
327 * Adds a new delegate to this idle cycle
332 public void addListener(bool delegate() dlg, bool fireNow=false)
334 idleListeners ~= dlg;
339 idleListeners.length = idleListeners.length - 1;
345 * The callback execution from glib
350 extern(C) static bool idleCallback(Idle idle)
352 return idle.callAllListeners();
356 * Executes all delegates on the execution list
359 private bool callAllListeners()
361 bool runAgain = false;
365 while ( i<idleListeners.length )
367 if ( !idleListeners[i]() )
369 idleListeners = idleListeners[0..i] ~ idleListeners[i+1..idleListeners.length];
383 file: gtk-Keyboard-Accelerators.html
384 struct: GtkAccelGroup
386 prefix: gtk_accel_group_
389 import: gobject.Closure
390 structWrap: GClosure* Closure
391 #import: gtk.AccelGroupEntry
392 #structWrap: GtkAccelGroupEntry* AccelGroupEntry
393 import: gobject.ObjectG
394 structWrap: GObject* ObjectG
395 import: gtk.AccelGroup
396 structWrap: GtkAccelGroup* AccelGroup
398 structWrap: GSList* ListSG
399 #import: gtk.AccelKey
400 #structWrap: GtkAccelKey* AccelKey
401 #import: gdk.ModifierType
402 #structWrap: GdkModifierType* ModifierType
405 file: gtk-Accelerator-Maps.html
408 prefix: gtk_accel_map_
411 #import: gtk.AccelKey
412 #structWrap: GtkAccelKey* AccelKey
414 #structWrap: GScanner* Scanner
416 structWrap: GtkAccelMap* AccelMap
419 file: gtk-Clipboards.html
422 prefix: gtk_clipboard_
425 import: gtk.Clipboard
426 structWrap: GtkClipboard* Clipboard
428 structWrap: GdkDisplay* Display
429 #import: gtk.TargetEntry
430 #structWrap: GtkTargetEntry* TargetEntry
431 import: gobject.ObjectG
432 structWrap: GObject* ObjectG
434 structWrap: GdkPixbuf* Pixbuf
435 #import: gtk.SelectionData
436 #structWrap: GtkSelectionData* SelectionData
438 #structWrap: GdkAtom** Atom*
441 file: gtk-Drag-and-Drop.html
442 struct: GdkDragContext
448 structWrap: GtkWidget* Widget
449 #import: gtk.TargetEntry
450 #structWrap: GtkTargetEntry* TargetEntry
452 structWrap: GdkWindow* Window
453 import: gdk.DragContext
454 structWrap: GdkDragContext* DragContext
455 #import: gtk.TargetList
456 #structWrap: GtkTargetList* TargetList
458 structWrap: GdkEvent* Event
460 structWrap: GdkColormap* Colormap
462 structWrap: GdkPixmap* Pixmap
464 structWrap: GdkBitmap* Bitmap
466 structWrap: GdkPixbuf* Pixbuf
470 file: GtkIconTheme.html
474 prefix: gtk_icon_theme_
475 noprefix: gtk_icon_info_
478 import: gtk.IconTheme
479 structWrap: GtkIconTheme* IconTheme
481 structWrap: GdkScreen* Screen
483 structWrap: GtkIconInfo* IconInfo
485 structWrap: GdkPixbuf* Pixbuf
487 #structWrap: GError** Error*
489 structWrap: GList* ListG
494 prefix: gtk_icon_info_
498 structWrap: GtkIconInfo* IconInfo
500 structWrap: GdkPixbuf* Pixbuf
503 file: gtk-Stock-Items.html
509 import: gtk.StockItem
510 structWrap: GtkStockItem* StockItem
512 structWrap: GSList* ListSG
515 file: gtk-Themeable-Stock-Images.html
516 struct: GtkIconSource
521 #import: gtk.IconSource
522 #structWrap: GtkIconSource* IconSource
523 #import: gtk.IconFactory
524 #structWrap: GtkIconFactory* IconFactory
526 #structWrap: GtkIconSet* IconSet
528 structWrap: GdkPixbuf* Pixbuf
530 structWrap: GtkStyle* Style
532 structWrap: GtkWidget* Widget
534 structWrap: GtkSettings* Settings
537 file: gtk-Resource-Files.html
543 #structWrap: GScanner* Scanner
546 structWrap: GtkStyle* Style
548 structWrap: GtkWidget* Widget
550 structWrap: GtkSettings* Settings
552 structWrap: GdkColor* Color
553 #import: gtk.StateType
554 #structWrap: GtkStateType* StateType
555 #import: gtk.PathPriorityType
556 #structWrap: GtkPathPriorityType* PathPriorityType
558 structWrap: GtkRcStyle* RcStyle
561 file: GtkSettings.html
564 prefix: gtk_settings_
568 structWrap: GtkSettings* Settings
570 structWrap: GdkScreen* Screen
572 #structWrap: GParamSpec* ParamSpec
574 structWrap: GString* StringG
575 import: gobject.Value
576 structWrap: GValue* Value
577 #import: gtk.SettingsValue
578 #structWrap: GtkSettingsValue* SettingsValue
581 file: gtk-Bindings.html
582 struct: GtkBindingSet
584 prefix: gtk_binding_set_
585 prefix: gtk_bindings_
588 import: gtk.BindingSet
589 structWrap: GtkBindingSet* BindingSet
590 import: gtk.ObjectGtk
591 structWrap: GtkObject* ObjectGtk
592 #import: gdk.EventKey
593 #structWrap: GdkEventKey* EventKey
595 structWrap: GSList* ListSG
598 #structWrap: GScanner* Scanner
601 file: gtk-Standard-Enumerations.html
603 class: StandardEnumerations
606 outFile: StandardEnumerations
608 file: gtk-Graphics-Contexts.html
614 structWrap: GdkGC* GC
616 structWrap: GdkColormap* Colormap
617 #import: gdk.GCValues
618 #structWrap: GdkGCValues* GCValues
628 structWrap: GtkStyle* Style
630 structWrap: GdkWindow* Window
631 import: gdk.Rectangle
632 structWrap: GdkRectangle* Rectangle
634 #structWrap: GtkIconSet* IconSet
636 structWrap: GdkPixbuf* Pixbuf
637 import: gtk.IconSource
638 structWrap: GtkIconSource* IconSource
640 structWrap: GtkWidget* Widget
642 structWrap: GdkFont* Font
644 #structWrap: GdkPoint* Point
646 structWrap: GdkDrawable* Drawable
648 #structWrap: GtkBorder* Border
651 file: gtk-Selections.html
656 #import: gtk.TargetList
657 #structWrap: GtkTargetList* TargetList
658 #import: gtk.TargetEntry
659 #structWrap: GtkTargetEntry* TargetEntry
661 structWrap: GtkWidget* Widget
663 structWrap: GdkDisplay* Display
664 #import: gtk.SelectionData
665 #structWrap: GtkSelectionData* SelectionData
667 structWrap: GdkPixbuf* Pixbuf
671 file: gtk-Feature-Test-Macros.html
678 file: gtk-Signals.html
685 #structWrap: GtkType* Type
686 import: gtk.ObjectGtk
687 structWrap: GtkObject* ObjectGtk
689 #structWrap: GtkArg* Arg
699 #import: gtk.TypeInfo
700 #structWrap: GtkTypeInfo* TypeInfo
701 #import: gtk.EnumValue
702 #structWrap: GtkEnumValue* EnumValue
703 #import: gtk.FlagValue
704 #structWrap: GtkFlagValue* FlagValue
707 ###########################################################
708 ### Windows ###############################################
709 ###########################################################
718 structWrap: GtkWindow* Window
720 structWrap: GtkWidget* Widget
722 structWrap: GdkScreen* Screen
726 public Widget addButton(StockID stockID, int responseId)
728 return addButton(StockDesc[stockID], responseId);
732 public void addButtons(char[][] buttonsText, ResponseType[] responses)
734 for ( int i=0 ; i<buttonsText.length && i<responses.length ; i++)
736 addButton(buttonsText[i], responses[i]);
740 public void addButtons(StockID[] stockIDs, ResponseType[] responses)
742 for ( int i=0 ; i<stockIDs.length && i<responses.length ; i++)
744 addButton(stockIDs[i], responses[i]);
751 file: GtkInvisible.html
754 prefix: gtk_invisible_
757 structWrap: GdkScreen* Screen
760 file: GtkMessageDialog.html
761 struct: GtkMessageDialog
763 prefix: gtk_message_dialog_
767 structWrap: GtkWindow* Window
769 nocode: gtk_message_dialog_new
770 nocode: gtk_message_dialog_new_with_markup
774 * Creates a new message dialog, which is a simple dialog with an icon
775 * indicating the dialog type (error, warning, etc.) and some text the
776 * user may want to see. When the user clicks a button a "response"
777 * signal is emitted with response IDs from GtkResponseType. See
778 * GtkDialog for more details.
780 * transient parent, or NULL for none
786 * set of buttons to use
788 * printf()-style format string, or NULL
790 * the message - should be null, any formatting should be done prior to call this constructor
791 * arguments for message_format
793 * a new GtkMessageDialog
795 public this (Window parent, GtkDialogFlags flags, GtkMessageType type, GtkButtonsType buttons, char[] messageFormat, char[] message=null )
797 this(parent, flags, type, buttons, false, messageFormat, message );
801 * Creates a new message dialog, which is a simple dialog with an icon
802 * indicating the dialog type (error, warning, etc.) and some text which
803 * is marked up with the Pango text markup language.
804 * When the user clicks a button a "response" signal is emitted with
805 * response IDs from GtkResponseType. See GtkDialog for more details.
807 * If Markup is true special XML characters in the printf() arguments passed to this
808 * function will automatically be escaped as necessary.
809 * (See g_markup_printf_escaped() for how this is implemented.)
810 * Usually this is what you want, but if you have an existing
811 * Pango markup string that you want to use literally as the
812 * label, then you need to use gtk_message_dialog_set_markup()
813 * instead, since you can't pass the markup string either
814 * as the format (it might contain '%' characters) or as a string
817 * dialog = gtk_message_dialog_new (main_application_window,
818 * GTK_DIALOG_DESTROY_WITH_PARENT,
822 * gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG (dialog),
825 * transient parent, or NULL for none
831 * set of buttons to use
833 * printf()-style format string, or NULL
835 * the message - should be null, any formatting should be done prior to call this constructor
837 * arguments for message_format
839 * a new GtkMessageDialog
842 public this (Window parent, GtkDialogFlags flags, GtkMessageType type, GtkButtonsType buttons, bool markup, char[] messageFormat, char[] message=null )
846 // GtkWidget* gtk_message_dialog_new_with_markup (GtkWindow *parent, GtkDialogFlags flags, GtkMessageType type, GtkButtonsType buttons, const gchar *message_format, ...);
848 cast(GtkMessageDialog*)gtk_message_dialog_new_with_markup(
849 parent is null ? null : parent.getWindowStruct(),
853 Str.toStringz(messageFormat),
854 Str.toStringz(message), // this should be null
861 // GtkWidget* gtk_message_dialog_new (GtkWindow *parent, GtkDialogFlags flags, GtkMessageType type, GtkButtonsType buttons, const gchar *message_format, ...);
863 cast(GtkMessageDialog*)gtk_message_dialog_new(
864 parent is null ? null : parent.getWindowStruct(),
868 Str.toStringz(messageFormat),
869 Str.toStringz(message), // this should be null
878 outFile: MessageDialog
882 import: gtk.MessageDialog;
887 * Create an information popup dialog.
888 * @param message The message to show on the dialog
889 * @param title The title of the dialog
891 public static void information(char[] message, char[] title)
893 information(null, message, title);
897 * Create an information popup dialog.
898 * @param parent The parent window of this popup dialog
899 * @param message The message to show on the dialog
900 * @param title The title of the dialog
902 public static void information(Window parent, char[] message, char[] title)
904 MessageDialog d = new MessageDialog(parent, cast(GtkDialogFlags)0,
909 //d.addButton("gtk-dialog-info",GtkResponseType.GTK_RESPONSE_OK);
916 * Create an error popup dialog.
917 * @param message The message to show on the dialog
918 * @param title The title of the dialog
920 public static void error(char[] message, char[] title)
922 error(null, message, title);
926 * Create an error popup dialog.
927 * @param parent The parent window of this popup dialog
928 * @param message The message to show on the dialog
929 * @param title The title of the dialog
931 public static void error(Window parent, char[] message, char[] title)
933 MessageDialog d = new MessageDialog(parent, cast(GtkDialogFlags)0,
938 //d.addButton("gtk-dialog-error",ResponseType.GTK_RESPONSE_CANCEL);
946 * Create an 'yes' or 'no' popup dialog.
947 * @param message The message to show on the dialog
948 * @param title The title of the dialog
950 public static bool yesNo(char[] message, char[] title)
952 return yesNo(null, message, title);
956 * Create an 'yes' or 'no' popup dialog.
957 * @param parent The parent window of this popup dialog
958 * @param message The message to show on the dialog
959 * @param title The title of the dialog
961 public static bool yesNo(Window parent, char[] message, char[] title)
963 MessageDialog d = new MessageDialog(
964 parent, cast(GtkDialogFlags)0,
965 MessageType.QUESTION,
969 d.addButton("gtk-no",ResponseType.GTK_RESPONSE_NO);
970 d.addButton("gtk-yes",ResponseType.GTK_RESPONSE_YES);
971 int responce = d.run();
973 return responce == ResponseType.GTK_RESPONSE_YES;
978 * Create an 'yes', 'no' or 'cancel' popup dialog.
979 * @param message The message to show on the dialog
980 * @param title The title of the dialog
982 public static ResponseType yesNoCancel(char[] message, char[] title)
984 return yesNoCancel(null, message, title);
988 * Create an 'yes', 'no' or 'cancel' popup dialog.
989 * @param parent The parent window of this popup dialog
990 * @param message The message to show on the dialog
991 * @param title The title of the dialog
993 public static ResponseType yesNoCancel(Window parent, char[] message, char[] title)
995 MessageDialog d = new MessageDialog(
996 parent, cast(GtkDialogFlags)0,
997 MessageType.QUESTION,
1001 d.addButton("gtk-no",ResponseType.GTK_RESPONSE_NO);
1002 d.addButton("gtk-yes",ResponseType.GTK_RESPONSE_YES);
1003 d.addButton("gtk-cancel",ResponseType.GTK_RESPONSE_CANCEL);
1004 ResponseType responce = cast(ResponseType)d.run();
1011 file: GtkWindow.html
1017 import: gtk.AccelGroup
1018 structWrap: GtkAccelGroup* AccelGroup
1020 structWrap: GtkWidget* Widget
1021 #import: gdk.Geometry
1022 #structWrap: GdkGeometry* Geometry
1024 structWrap: GtkWindow* Window
1026 structWrap: GdkScreen* Screen
1028 structWrap: GList* ListG
1029 #import: gdk.EventKey
1030 #structWrap: GdkEventKey* EventKey
1032 structWrap: GdkPixbuf* Pixbuf
1037 * Creates a top level window with a title
1039 * title: The Window title
1041 public this(char[] title)
1043 this(GtkWindowType.TOPLEVEL);
1048 * Move the window to an absolute position.
1049 * just calls move(int, int).
1050 * convinience because GdkEvent structs return the position coords as doubles
1052 public void move(double x, double y)
1054 move(cast(int)x, cast(int)y);
1072 * A top Level window that will stop the main event cycle when it's closed.
1073 * Closing the last of the windows of class "MainWindow" will end the application.
1075 public class MainWindow : Window
1078 private static int countTotalMainWindows = 0;
1081 * Creates a new MainWindow with a title
1083 public this(char[] title)
1086 countTotalMainWindows++;
1087 //printf("MainWindows.this count = %d\n", countTotalMainWindows);
1088 addOnDelete(&windowDelete);
1092 * Executed when the user tries to close the window
1093 * @return true to refuse to close the window
1095 protected int windowDelete(Event event, Widget widget)
1097 --countTotalMainWindows;
1098 //printf("MainWindows.windowDelete count = %d\n", countTotalMainWindows);
1099 if ( exit(0, false) || countTotalMainWindows==0 )
1108 * Allows the application to close and decide if it can exit
1109 * @param code the code reason to exit
1110 * @param force if true the application must expect to be closed even against it's will
1111 * @return false to refuse to exit
1113 protected bool exit(int code, bool force)
1122 file: GtkWindowGroup.html
1123 struct: GtkWindowGroup
1125 prefix: gtk_window_group_
1128 structWrap: GtkWindow* Window
1129 outFile: WindowGroup
1131 file: GtkAboutDialog.html
1132 struct: GtkAboutDialog
1134 prefix: gtk_about_dialog_
1138 structWrap: GdkPixbuf* Pixbuf
1140 structWrap: GtkWindow* Window
1141 outFile: AboutDialog
1143 file: GtkAssistant.html
1144 struct: GtkAssistant
1146 prefix: gtk_assistant_
1150 structWrap: GdkPixbuf* Pixbuf
1152 structWrap: GtkWidget* Widget
1157 ###########################################################
1158 ### Display Widgets #######################################
1159 ###########################################################
1161 file: GtkAccelLabel.html
1162 struct: GtkAccelLabel
1164 prefix: gtk_accel_label_
1167 import: gobject.Closure
1168 structWrap: GClosure* Closure
1170 structWrap: GtkWidget* Widget
1179 #import: gtk.IconSet*
1180 #structWrap: GtkIconSet** IconSet*
1181 #import: gtk.IconSize
1182 #structWrap: GtkIconSize* IconSize
1183 #import: gdk.ImageGdk*
1184 #structWrap: GdkImage** ImageGdk*
1185 #import: gdk.Bitmap*
1186 #structWrap: GdkBitmap** Bitmap*
1188 structWrap: GdkPixbuf* Pixbuf
1189 #import: gdk.Pixmap*
1190 #structWrap: GdkPixmap** Pixmap*
1191 #import: gdk.PixbufAnimation
1192 #structWrap: GdkPixbufAnimation* PixbufAnimation
1193 #import: gtk.IconSet
1194 #structWrap: GtkIconSet* IconSet
1195 import: gdk.ImageGdk
1196 structWrap: GdkImage* ImageGdk
1198 structWrap: GdkBitmap* Bitmap
1200 structWrap: GdkPixmap* Pixmap
1202 nocode: gtk_image_new_from_stock
1203 nocode: gtk_image_new_from_icon_name
1206 // this will be an enum
1208 * Creates a GtkImage displaying a stock icon. Sample stock icon
1209 * names are GTK_STOCK_OPEN, GTK_STOCK_EXIT. Sample stock sizes
1210 * are GTK_ICON_SIZE_MENU, GTK_ICON_SIZE_SMALL_TOOLBAR. If the stock
1211 * icon name isn't known, the image will be empty.
1212 * You can register your own stock icon names, see
1213 * gtk_icon_factory_add_default() and gtk_icon_factory_add().
1219 * a new GtkImage displaying the stock icon
1221 public this (StockID stockID, GtkIconSize size)
1223 // GtkWidget* gtk_image_new_from_stock (const gchar *stock_id, GtkIconSize size);
1224 this(cast(GtkImage*)gtk_image_new_from_stock(StockDesc[stockID].ptr, size) );
1228 * Creates a GtkImage displaying an icon from the current icon theme.
1229 * If the icon name isn't known, a "broken image" icon will be
1230 * displayed instead. If the current icon theme is changed, the icon
1231 * will be updated appropriately.
1237 * a new GtkImage displaying the themed icon
1240 public this (char[] iconName, GtkIconSize size)
1242 // GtkWidget* gtk_image_new_from_icon_name (const gchar *icon_name, GtkIconSize size);
1243 this(cast(GtkImage*)gtk_image_new_from_icon_name(Str.toStringz(iconName), size) );
1257 structWrap: GtkWidget* Widget
1258 nocode: gtk_label_new
1259 nocode: gtk_label_new_with_mnemonic
1262 * Creates a new GtkLabel, containing the text in str.
1263 * If characters in str are preceded by an underscore, they are
1264 * underlined. If you need a literal underscore character in a label, use
1265 * '__' (two underscores). The first underlined character represents a
1266 * keyboard accelerator called a mnemonic. The mnemonic key can be used
1267 * to activate another widget, chosen automatically, or explicitly using
1268 * gtk_label_set_mnemonic_widget().
1269 * If gtk_label_set_mnemonic_widget()
1270 * is not called, then the first activatable ancestor of the GtkLabel
1271 * will be chosen as the mnemonic widget. For instance, if the
1272 * label is inside a button or menu item, the button or menu item will
1273 * automatically become the mnemonic widget and be activated by
1276 * The text of the label, with an underscore in front of the
1277 * mnemonic character
1278 * mnemonic: when false uses the literal text passed in without mnemonic
1282 public this (char[] str, bool mnemonic=true)
1286 // GtkWidget* gtk_label_new_with_mnemonic (const gchar *str);
1287 this(cast(GtkLabel*)gtk_label_new_with_mnemonic(Str.toStringz(str)) );
1291 // GtkWidget* gtk_label_new (const gchar *str);
1292 this(cast(GtkLabel*)gtk_label_new(Str.toStringz(str)) );
1298 file: GtkProgressBar.html
1299 struct: GtkProgressBar
1301 prefix: gtk_progress_bar_
1304 import: gtk.Adjustment
1305 structWrap: GtkAdjustment* Adjustment
1306 outFile: ProgressBar
1308 file: GtkStatusbar.html
1309 struct: GtkStatusbar
1312 prefix: gtk_statusbar_
1316 ###########################################################
1317 ### Buttons and Toggles ###################################
1318 ###########################################################
1320 file: GtkButton.html
1327 structWrap: GtkWidget* Widget
1331 nocode: gtk_button_new_with_mnemonic
1332 nocode: gtk_button_new_with_label
1333 nocode: gtk_button_new_from_stock
1338 private static IconSize currentIconSize = IconSize.BUTTON;
1340 /** An arbitrary string to be used by the application */
1341 private char[] action;
1343 public static void setIconSize(IconSize iconSize)
1345 currentIconSize = iconSize;
1347 public static IconSize getIconSize()
1349 return currentIconSize;
1352 public void setActionName(char[] action)
1354 this.action = action.dup;
1357 public char[] getActionName()
1363 * Creates a new GtkButton containing a label.
1364 * If characters in label are preceded by an underscore, they are underlined.
1365 * If you need a literal underscore character in a label, use '__' (two
1366 * underscores). The first underlined character represents a keyboard
1367 * accelerator called a mnemonic.
1368 * Pressing Alt and that key activates the button.
1370 * The text of the button, with an underscore in front of the
1371 * mnemonic character
1375 public this (char[] label, bool mnemonic=true)
1379 // GtkWidget* gtk_button_new_with_mnemonic (const gchar *label);
1380 this(cast(GtkButton*)gtk_button_new_with_mnemonic(Str.toStringz(label)) );
1384 // GtkWidget* gtk_button_new_with_label (const gchar *label);
1385 this(cast(GtkButton*)gtk_button_new_with_label(Str.toStringz(label)) );
1390 * Creates a new GtkButton containing the image and text from a stock item.
1391 * Some stock ids have preprocessor macros like GTK_STOCK_OK and
1393 * If stock_id is unknown, then it will be treated as a mnemonic
1394 * label (as for gtk_button_new_with_mnemonic()).
1396 * the name of the stock item
1400 public this (StockID stockID, bool hideLabel=false)
1402 // GtkWidget* gtk_button_new_from_stock (const gchar *stock_id);
1406 Image image = new Image(stockID,currentIconSize);
1411 this(cast(GtkButton*)gtk_button_new_from_stock(StockDesc[stockID].ptr) );
1416 public this(StockID stockID, void delegate(Button) dlg, bool hideLabel=false)
1418 this(stockID, hideLabel);
1423 public this(char[] label, void delegate(Button) dlg, bool mnemonic=true)
1425 this(label, mnemonic);
1429 public this(char[] label, void delegate(Button) dlg, char[] action)
1432 setActionName(action);
1440 file: GtkCheckButton.html
1441 struct: GtkCheckButton
1446 prefix: gtk_check_button_
1449 nocode: gtk_check_button_new_with_label
1450 nocode: gtk_check_button_new_with_mnemonic
1454 * Creates a new GtkCheckButton with a GtkLabel to the right of it.
1455 * If mnemonic is true the label
1456 * will be created using gtk_label_new_with_mnemonic(), so underscores
1457 * in label indicate the mnemonic for the check button.
1459 * The text of the button, with an underscore in front of the
1460 * mnemonic character
1462 * the text for the check button.
1466 public this (char[] label, bool mnemonic=true)
1470 // GtkWidget* gtk_check_button_new_with_mnemonic (const gchar *label);
1471 this(cast(GtkCheckButton*)gtk_check_button_new_with_mnemonic(Str.toStringz(label)) );
1475 // GtkWidget* gtk_check_button_new_with_label (const gchar *label);
1476 this(cast(GtkCheckButton*)gtk_check_button_new_with_label(Str.toStringz(label)) );
1480 public this(char[] label, void delegate(CheckButton) onClicked, bool mnemonic=true)
1482 this(label, mnemonic);
1483 addOnClicked(cast(void delegate(Button))onClicked);
1488 outFile: CheckButton
1490 file: GtkRadioButton.html
1491 struct: GtkRadioButton
1493 prefix: gtk_radio_button_
1497 structWrap: GSList* ListSG
1499 nocode: gtk_radio_button_new_with_label
1500 nocode: gtk_radio_button_new_with_mnemonic
1501 nocode: gtk_radio_button_new_with_label_from_widget
1502 nocode: gtk_radio_button_new_with_mnemonic_from_widget
1506 * Creates a new GtkRadioButton with a text label.
1507 * If mnemonic if true the label will be created using
1508 * gtk_label_new_with_mnemonic(), so underscores in label indicate the
1509 * mnemonic for the button.
1510 * an existing radio button group, or NULL if you are creating a new
1513 * the text label to display next to the radio button.
1515 * a new radio button.
1517 public this (ListSG group, char[] label, bool mnemonic=true)
1521 // GtkWidget* gtk_radio_button_new_with_mnemonic (GSList *group, const gchar *label);
1522 this(cast(GtkRadioButton*)gtk_radio_button_new_with_mnemonic(
1523 group is null ? null : group.getListSGStruct(),
1524 Str.toStringz(label))
1529 // GtkWidget* gtk_radio_button_new_with_label (GSList *group, const gchar *label);
1530 this(cast(GtkRadioButton*)gtk_radio_button_new_with_label(
1531 group is null ? null : group.getListSGStruct(),
1532 Str.toStringz(label))
1538 * Creates a new GtkRadioButton with a text label, adding it to the same group
1540 * It mnemonic it true the label
1541 * will be created using gtk_label_new_with_mnemonic(), so underscores
1542 * in label indicate the mnemonic for the button.
1544 * an existing GtkRadioButton.
1546 * a text string to display next to the radio button.
1548 * a new radio button.
1550 public this (RadioButton radioButton, char[] label, bool mnemonic=true)
1554 // GtkWidget* gtk_radio_button_new_with_mnemonic_from_widget (GtkRadioButton *group, const gchar *label);
1555 this(cast(GtkRadioButton*)gtk_radio_button_new_with_mnemonic_from_widget(
1556 radioButton.getRadioButtonStruct(),
1557 Str.toStringz(label))
1562 // GtkWidget* gtk_radio_button_new_with_label_from_widget (GtkRadioButton *group, const gchar *label);
1563 this(cast(GtkRadioButton*)gtk_radio_button_new_with_label_from_widget(
1564 radioButton.getRadioButtonStruct(),
1565 Str.toStringz(label))
1570 outFile: RadioButton
1572 file: GtkToggleButton.html
1573 struct: GtkToggleButton
1575 prefix: gtk_toggle_button_
1579 nocode: gtk_toggle_button_new_with_label
1580 nocode: gtk_toggle_button_new_with_mnemonic
1584 * Creates a new toggle button with a text label.
1585 * If mnemonic is true the label
1586 * will be created using gtk_label_new_with_mnemonic(), so underscores
1587 * in label indicate the mnemonic for the button.
1589 * a string containing the message to be placed in the toggle button.
1591 * a new toggle button.
1593 public this (char[] label, bool mnemonic=true)
1597 // GtkWidget* gtk_toggle_button_new_with_mnemonic (const gchar *label);
1598 this(cast(GtkToggleButton*)gtk_toggle_button_new_with_mnemonic(Str.toStringz(label)) );
1602 // GtkWidget* gtk_toggle_button_new_with_label (const gchar *label);
1603 this(cast(GtkToggleButton*)gtk_toggle_button_new_with_label(Str.toStringz(label)) );
1608 outFile: ToggleButton
1610 ###########################################################
1611 ### numeric/text Data Entry ###############################
1612 ###########################################################
1620 import: gtk.EntryCompletion
1621 structWrap: GtkEntryCompletion* EntryCompletion
1624 public this (char[] text)
1630 public this (char[] text, int max)
1639 file: GtkEntryCompletion.html
1640 struct: GtkEntryCompletion
1641 class: EntryCompletion
1642 prefix: gtk_entry_completion_
1646 structWrap: GtkWidget* Widget
1647 import: gtk.TreeModel
1648 structWrap: GtkTreeModel* TreeModel
1649 outFile: EntryCompletion
1651 file: GtkHScale.html
1656 import: gtk.Adjustment
1657 structWrap: GtkAdjustment* Adjustment
1660 file: GtkVScale.html
1665 import: gtk.Adjustment
1666 structWrap: GtkAdjustment* Adjustment
1669 file: GtkSpinButton.html
1670 struct: GtkSpinButton
1672 prefix: gtk_spin_button_
1675 structWrap: GtkWidget* Widget
1676 import: gtk.Adjustment
1677 structWrap: GtkAdjustment* Adjustment
1680 file: GtkEditable.html
1683 prefix: gtk_editable_
1688 ###########################################################
1689 ### Multiline Text Editor #################################
1690 ###########################################################
1692 file: gtk-GtkTextIter.html
1695 nostruct: GtkTextIter
1696 prefix: gtk_text_iter_
1699 import: gtk.TextBuffer
1700 structWrap: GtkTextBuffer* TextBuffer
1701 import: gtk.TextIter
1702 structWrap: GtkTextIter* TextIter
1704 structWrap: GdkPixbuf* Pixbuf
1706 structWrap: GSList* ListSG
1707 #import: gtk.TextChildAnchor
1708 #structWrap: GtkTextChildAnchor* TextChildAnchor
1710 structWrap: GtkTextTag* TextTag
1711 import: gtk.TextAttributes
1712 structWrap: GtkTextAttributes* TextAttributes
1713 import: gtk.TextChildAnchor
1714 structWrap: GtkTextChildAnchor* TextChildAnchor
1719 this(new GtkTextIter);
1725 file: GtkTextMark.html
1728 prefix: gtk_text_mark_
1731 import: gtk.TextBuffer
1732 structWrap: GtkTextBuffer* TextBuffer
1735 file: GtkTextBuffer.html
1736 struct: GtkTextBuffer
1738 prefix: gtk_text_buffer_
1741 import: gtk.TextBuffer
1742 structWrap: GtkTextBuffer* TextBuffer
1743 #import: gtk.TextMark
1744 #structWrap: GtkTextMark* TextMark
1745 #import: gtk.TextIter
1746 #structWrap: GtkTextIter* TextIter
1747 import: gdk.Rectangle
1748 structWrap: GdkRectangle* Rectangle
1750 structWrap: GtkWidget* Widget
1751 import: pango.PgTabArray
1752 structWrap: PangoTabArray* PgTabArray
1753 import: gtk.TextAttributes
1754 structWrap: GtkTextAttributes* TextAttributes
1755 import: gtk.TextTagTable
1756 structWrap: GtkTextTagTable* TextTagTable
1757 import: gtk.TextIter
1758 structWrap: GtkTextIter* TextIter
1760 structWrap: GtkTextTag* TextTag
1762 structWrap: GdkPixbuf* Pixbuf
1763 import: gtk.TextChildAnchor
1764 structWrap: GtkTextChildAnchor* TextChildAnchor
1765 import: gtk.TextMark
1766 structWrap: GtkTextMark* TextMark
1767 import: gtk.Clipboard
1768 structWrap: GtkClipboard* Clipboard
1770 structWrap: GdkBitmap* Bitmap
1775 nocode: gtk_text_buffer_set_text
1776 nocode: gtk_text_buffer_insert_with_tags
1777 nocode: gtk_text_buffer_insert_with_tags_by_name
1778 nocode: gtk_text_buffer_create_tag
1783 * Deletes current contents of buffer, and inserts text instead. If
1784 * len is -1, text must be nul-terminated. text must be valid UTF-8.
1788 * UTF-8 text to insert
1790 * length of text in bytes
1792 public void setText(char[] text)
1794 // void gtk_text_buffer_set_text (GtkTextBuffer *buffer, const gchar *text, gint len);
1795 gtk_text_buffer_set_text(gtkTextBuffer, Str.toStringz(text), text.length);
1799 * Inserts len bytes of text at position iter. If len is -1,
1800 * text must be nul-terminated and will be inserted in its
1801 * entirety. Emits the "insert_text" signal; insertion actually occurs
1802 * in the default handler for the signal. iter is invalidated when
1803 * insertion occurs (because the buffer contents change), but the
1804 * default signal handler revalidates it to point to the end of the
1809 * a position in the buffer
1811 * UTF-8 format text to insert
1813 * length of text in bytes, or -1
1815 public void insert(TextIter iter, char[] text)
1817 // void gtk_text_buffer_insert (GtkTextBuffer *buffer, GtkTextIter *iter, const gchar *text, gint len);
1818 gtk_text_buffer_insert(gtkTextBuffer, (iter is null) ? null : iter.getTextIterStruct(), Str.toStringz(text), text.length);
1822 * Simply calls gtk_text_buffer_insert(), using the current
1823 * cursor position as the insertion point.
1827 * some text in UTF-8 format
1829 * length of text, in bytes
1831 public void insertAtCursor(char[] text)
1833 // void gtk_text_buffer_insert_at_cursor (GtkTextBuffer *buffer, const gchar *text, gint len);
1834 gtk_text_buffer_insert_at_cursor(gtkTextBuffer, Str.toStringz(text), text.length);
1838 * Like gtk_text_buffer_insert(), but the insertion will not occur if
1839 * iter is at a non-editable location in the buffer. Usually you
1840 * want to prevent insertions at ineditable locations if the insertion
1841 * results from a user action (is interactive).
1842 * default_editable indicates the editability of text that doesn't
1843 * have a tag affecting editability applied to it. Typically the
1844 * result of gtk_text_view_get_editable() is appropriate here.
1848 * a position in buffer
1852 * length of text in bytes, or -1
1854 * default editability of buffer
1856 * whether text was actually inserted
1858 public int insertInteractive(TextIter iter, char[] text, int defaultEditable)
1860 // gboolean gtk_text_buffer_insert_interactive (GtkTextBuffer *buffer, GtkTextIter *iter, const gchar *text, gint len, gboolean default_editable);
1861 return gtk_text_buffer_insert_interactive(gtkTextBuffer, (iter is null) ? null : iter.getTextIterStruct(), Str.toStringz(text), text.length, defaultEditable);
1865 * Calls gtk_text_buffer_insert_interactive() at the cursor
1867 * default_editable indicates the editability of text that doesn't
1868 * have a tag affecting editability applied to it. Typically the
1869 * result of gtk_text_view_get_editable() is appropriate here.
1873 * text in UTF-8 format
1875 * length of text in bytes, or -1
1877 * default editability of buffer
1879 * whether text was actually inserted
1881 public int insertInteractiveAtCursor(char[] text, int defaultEditable)
1883 // gboolean gtk_text_buffer_insert_interactive_at_cursor (GtkTextBuffer *buffer, const gchar *text, gint len, gboolean default_editable);
1884 return gtk_text_buffer_insert_interactive_at_cursor(gtkTextBuffer, Str.toStringz(text), text.length, defaultEditable);
1888 * Inserts text into buffer at iter, applying the list of tags to
1889 * the newly-inserted text. The last tag specified must be NULL to
1890 * terminate the list. Equivalent to calling gtk_text_buffer_insert(),
1891 * then gtk_text_buffer_apply_tag() on the inserted text;
1892 * gtk_text_buffer_insert_with_tags() is just a convenience function.
1896 * an iterator in buffer
1900 * length of text, or -1
1902 * first tag to apply to text
1904 * NULL-terminated list of tags to apply
1906 //version(Tango){} else -- still doesn't work on tango, but it compiles now
1907 public void insertWithTags(TextIter iter, char[] text, ... )
1909 for (int i = 0; (i<_arguments.length) && (_arguments[i] == typeid(TextTag)); i++)
1911 TextTag tag = va_arg!(TextTag)(_argptr);
1912 // void gtk_text_buffer_insert_with_tags (GtkTextBuffer *buffer, GtkTextIter *iter, const gchar *text, gint len, GtkTextTag *first_tag, ...);
1913 gtk_text_buffer_insert_with_tags(gtkTextBuffer, (iter is null) ? null : iter.getTextIterStruct(), Str.toStringz(text), text.length, (tag is null) ? null : tag.getTextTagStruct(), null);
1918 * Same as gtk_text_buffer_insert_with_tags(), but allows you
1919 * to pass in tag names instead of tag objects.
1923 * position in buffer
1927 * length of text, or -1
1929 * name of a tag to apply to text
1933 // version(Tango){} else -- still doesn't work on tango, but it compiles now
1934 public void insertWithTagsByName(TextIter iter, char[] text, ... )
1936 for (int i = 0; (i<_arguments.length) && (_arguments[i] == typeid(char[])); i++)
1938 char[] tagName = va_arg!(char[])(_argptr);
1939 // void gtk_text_buffer_insert_with_tags_by_name (GtkTextBuffer *buffer, GtkTextIter *iter, const gchar *text, gint len, const gchar *first_tag_name, ...);
1940 gtk_text_buffer_insert_with_tags_by_name(gtkTextBuffer, (iter is null) ? null : iter.getTextIterStruct(), Str.toStringz(text), text.length, Str.toStringz(tagName), null);
1945 * Create a new tag for this buffer
1946 * @param tagName can be null for no name
1947 * @param propertyName
1948 * @param propertyValue
1950 TextTag createTag(char[] tagName, char[] propertyName, int propertyValue,
1951 char[] propertyName1, char[] propertyValue1)
1954 gtk_text_buffer_create_tag(gtkTextBuffer,
1955 Str.toStringz(tagName),
1956 Str.toStringz(propertyName),propertyValue,
1957 Str.toStringz(propertyName1),
1958 Str.toStringz(propertyValue1),
1964 * Create a new tag for this buffer
1965 * @param tagName can be null for no name
1966 * @param propertyName
1967 * @param propertyValue
1969 TextTag createTag(char[] tagName, char[] propertyName, int propertyValue)
1972 gtk_text_buffer_create_tag(gtkTextBuffer,
1973 Str.toStringz(tagName),
1974 Str.toStringz(propertyName),propertyValue,null)
1980 * Create a new tag for this buffer
1981 * @param tagName can be null for no name
1982 * @param propertyName
1983 * @param propertyValue
1985 TextTag createTag(char[] tagName, char[] propertyName, double propertyValue)
1988 gtk_text_buffer_create_tag(gtkTextBuffer, Str.toStringz(tagName), Str.toStringz(propertyName),propertyValue,null)
1994 * Create a new tag for this buffer
1995 * @param tagName can be null for no name
1996 * @param propertyName
1997 * @param propertyValue
1998 * @param propertyName2
1999 * @param propertyValue2
2001 TextTag createTag(char[] tagName, char[] propertyName, int propertyValue, char[] propertyName2, int propertyValue2)
2004 gtk_text_buffer_create_tag(gtkTextBuffer, Str.toStringz(tagName), Str.toStringz(propertyName), propertyValue, Str.toStringz(propertyName2), propertyValue2, null)
2008 TextTag createTag(char[] tagName, char[] propertyName, int propertyValue, char[] propertyName2, int propertyValue2, char[] propertyName3, int propertyValue3, char[] propertyName4, int propertyValue4, char[] propertyName5, int propertyValue5)
2011 gtk_text_buffer_create_tag(gtkTextBuffer, Str.toStringz(tagName), Str.toStringz(propertyName), propertyValue, Str.toStringz(propertyName2), propertyValue2, Str.toStringz(propertyName3), propertyValue3, Str.toStringz(propertyName4), propertyValue4, Str.toStringz(propertyName5), propertyValue5, null)
2015 * Create a new tag for this buffer
2016 * @param tagName can be null for no name
2017 * @param propertyName
2018 * @param propertyValue
2020 TextTag createTag(char[] tagName, char[] propertyName, char[] propertyValue)
2023 gtk_text_buffer_create_tag(gtkTextBuffer, Str.toStringz(tagName), Str.toStringz(propertyName),Str.toStringz(propertyValue),null)
2029 * Create a new tag for this buffer
2030 * @param tagName can be null for no name
2031 * @param propertyName
2032 * @param propertyValue
2035 TextTag createTag(char[] tagName, char[] propertyName, Bitmap propertyValue)
2038 gtk_text_buffer_create_tag(gtkTextBuffer, Str.toStringz(tagName), Str.toStringz(propertyName),propertyValue.getBitmapStruct(),null)
2044 * Obtain the entire text
2045 * @return The text char[]
2049 TextIter start = new TextIter();
2050 TextIter end = new TextIter();
2051 getBounds(start,end);
2052 return Str.toString(gtk_text_buffer_get_slice(gtkTextBuffer, start.getTextIterStruct(), end.getTextIterStruct(), true));
2056 * Create a new tag for this buffer
2057 * @param tagName can be null for no name
2058 * @param propertyName
2059 * @param propertyValue
2060 * @param propertyName2
2061 * @param propertyValue2
2063 TextTag createTag(char[] tagName,
2064 char[] propertyName, char[] propertyValue,
2065 char[] propertyName2, int propertyValue2)
2068 gtk_text_buffer_create_tag(gtkTextBuffer, Str.toStringz(tagName),
2069 Str.toStringz(propertyName), Str.toStringz(propertyValue),
2070 Str.toStringz(propertyName2), propertyValue2, null)
2079 file: GtkTextTag.html
2083 prefix: gtk_text_tag_
2084 noprefix: gtk_text_attributes_
2087 import: gobject.ObjectG
2088 structWrap: GObject* ObjectG
2090 structWrap: GdkEvent* Event
2091 import: gtk.TextIter
2092 structWrap: GtkTextIter* TextIter
2095 struct: GtkTextAttributes
2096 class: TextAttributes
2097 prefix: gtk_text_attributes_
2099 import: gtk.TextAttributes
2100 structWrap: GtkTextAttributes* TextAttributes
2101 outFile: TextAttributes
2103 file: GtkTextTagTable.html
2104 struct: GtkTextTagTable
2106 prefix: gtk_text_tag_
2109 import: gtk.TextTagTable
2110 structWrap: GtkTextTagTable* TextTagTable
2112 structWrap: GtkTextTag* TextTag
2113 outFile: TextTagTable
2115 file: GtkTextView.html
2119 prefix: gtk_text_view_
2121 noprefix: gtk_text_child_anchor_
2123 import: gtk.TextBuffer
2124 structWrap: GtkTextBuffer* TextBuffer
2125 import: gtk.TextMark
2126 structWrap: GtkTextMark* TextMark
2127 import: gtk.TextIter
2128 structWrap: GtkTextIter* TextIter
2129 import: gdk.Rectangle
2130 structWrap: GdkRectangle* Rectangle
2132 structWrap: GtkWidget* Widget
2133 import: pango.PgTabArray
2134 structWrap: PangoTabArray* PgTabArray
2135 import: gtk.TextAttributes
2136 structWrap: GtkTextAttributes* TextAttributes
2138 structWrap: GdkWindow* Window
2139 import: gtk.TextChildAnchor
2140 structWrap: GtkTextChildAnchor* TextChildAnchor
2142 structWrap: GList* ListG
2145 #gtk_text_view_get_type ()
2147 #GType gtk_text_view_get_type ();
2155 * Get the text line at the pixel y
2157 char[] getLineTextAt(gint y)
2160 TextIter iter = new TextIter();
2163 bufferToWindowCoords(TextWindowType.TEXT, 0, y, &windowX, &windowY);
2165 gtk_text_view_get_line_at_y(gtkTextView, iter.getTextIterStruct(), y+y-windowY, null);
2167 TextIter iterEnd = new TextIter();
2168 TextBuffer buffer = getBuffer();
2169 buffer.getIterAtOffset(iterEnd, iter.getOffset()+iter.getCharsInLine());
2170 return buffer.getText(iter, iterEnd, false);
2174 * Simply appends some on the cursor position
2175 * @param text the text to append
2177 void insertText(char[] text)
2179 TextBuffer buf = getBuffer();
2180 buf.insertAtCursor(text);
2184 * Simply appends some text to this view
2185 * @param text the text to append
2187 void appendText(char[] text, bool ensureVisible=true)
2190 TextBuffer buf = getBuffer();
2191 TextIter iter = new TextIter();
2192 buf.getEndIter(iter);
2193 buf.insert(iter, text);
2194 if ( ensureVisible )
2196 gdouble within_margin = 0.0;
2197 bool use_align = false;
2198 gdouble xalign = 0.0;
2199 gdouble yalign = 0.0;
2200 scrollToMark(buf.createMark("",iter,true), within_margin, use_align, xalign, yalign);
2209 struct: GtkTextChildAnchor
2210 class: TextChildAnchor
2212 prefix: gtk_text_child_anchor_
2214 outFile: TextChildAnchor
2216 ###########################################################
2217 ### Tree, List and Icon Grid Widgets ######################
2218 ###########################################################
2220 file: GtkTreeModel.html
2222 struct: GtkTreeModel
2224 prefix: gtk_tree_model_
2225 noprefix: gtk_tree_row_reference_
2226 noprefix: gtk_tree_path_
2227 noprefix: gtk_tree_iter_
2230 import: gtk.TreeIter
2231 structWrap: GtkTreeIter* TreeIter
2232 import: gtk.TreePath
2233 structWrap: GtkTreePath* TreePath
2234 import: gobject.Value
2235 structWrap: GValue* Value
2237 interfaceCode: start
2239 * Get the value of a column as a char array.
2240 * this is the same calling getValue and get the string from the value object
2242 char[] getValueString(TreeIter iter, int column);
2245 * Get the value of a column as a char array.
2246 * this is the same calling getValue and get the int from the value object
2248 int getValueInt(TreeIter iter, int column);
2250 void setValue(TreeIter iter, int column, char[] value);
2252 void setValue(TreeIter iter, int column, int value);
2256 nocode: gtk_tree_model_get_iter
2260 * Get the value of a column as a char array.
2261 * this is the same calling getValue and get the string from the value object
2263 char[] getValueString(TreeIter iter, int column)
2265 Value value = new Value();
2266 getValue(iter, column, value);
2267 return value.getString();
2271 * Get the value of a column as a char array.
2272 * this is the same calling getValue and get the int from the value object
2274 int getValueInt(TreeIter iter, int column)
2276 Value value = new Value();
2277 getValue(iter, column, value);
2278 return value.getInt();
2282 * Sets iter to a valid iterator pointing to path.
2286 * The uninitialized GtkTreeIter.
2290 * TRUE, if iter was set.
2292 public int getIter(TreeIter iter, TreePath path)
2294 // gboolean gtk_tree_model_get_iter (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreePath *path);
2295 iter.setModel(this);
2296 return gtk_tree_model_get_iter(gtkTreeModel, (iter is null) ? null : iter.getTreeIterStruct(), (path is null) ? null : path.getTreePathStruct());
2301 #interface: TreeModelIF
2307 prefix: gtk_tree_iter_
2310 import: gtk.TreeIter
2311 structWrap: GtkTreeIter* TreeIter
2312 import: gtk.TreeModel
2313 import: gtk.TreePath
2314 import: gtk.TreeIterError
2315 import: gobject.Value;
2320 * this will be set only when the iter
2321 * is created from the model.
2323 GtkTreeModel *gtkTreeModel;
2325 public void setModel(GtkTreeModel *gtkTreeModel)
2327 this.gtkTreeModel = gtkTreeModel;
2330 public void setModel(TreeModel treeModel)
2332 this.gtkTreeModel = treeModel.getTreeModelStruct();
2335 public this(TreeModel treeModel, TreePath treePath)
2338 setModel(treeModel);
2339 if ( gtk_tree_model_get_iter_from_string(
2340 treeModel.getTreeModelStruct(),
2341 getTreeIterStruct(), Str.toStringz(treePath.toString())) )
2348 * creates a new tree iteractor.
2349 * used TreeView.createIter and TreeView.append() to create iteractor for a tree or list
2353 this(new GtkTreeIter);
2363 void getValue(int column, Value value)
2365 if ( gtkTreeModel is null )
2367 throw new TreeIterError("getValue","Tree model not set");
2369 gtk_tree_model_get_value(gtkTreeModel, gtkTreeIter, column, value.getValueStruct());
2373 * Get the value of a column as a string
2374 * @para column the column number
2375 * @return a string representing the value of the column
2377 char[] getValueString(int column)
2379 if ( gtkTreeModel is null )
2381 throw new TreeIterError("getValueString","Tree model not set");
2383 Value value = new Value();
2384 gtk_tree_model_get_value(gtkTreeModel, gtkTreeIter, column, value.getValueStruct());
2385 //printf("TreeIter.getValuaString = %.*s\n", value.getString().toString());
2386 return value.getString();
2390 * Get the value of a column as an int
2391 * @para column the column number
2392 * @return a string representing the value of the column
2394 int getValueInt(int column)
2396 if ( gtkTreeModel is null )
2398 throw new TreeIterError("getValueInt", "Tree model not set");
2400 Value value = new Value();
2401 gtk_tree_model_get_value(gtkTreeModel, gtkTreeIter, column, value.getValueStruct());
2402 return value.getInt();
2405 TreePath getTreePath()
2407 if ( gtkTreeModel is null )
2409 throw new TreeIterError("getTreePath","Tree model not set");
2411 return new TreePath(gtk_tree_model_get_path(gtkTreeModel, gtkTreeIter));
2415 * This return the path visible to the user.
2417 char[] getVisiblePath(char[] separator)
2420 if ( gtkTreeModel is null )
2422 throw new TreeIterError("getVisiblePath", "Tree model not set");
2425 vPath = getValueString(0);
2426 TreeIter parent = getParent();
2427 while ( parent !is null )
2429 //printf("TreeIter.getVisiblePath parent = %.*s\n",parent.getValueString(0).toString());
2430 vPath = parent.getValueString(0) ~ separator ~ vPath;
2431 parent = parent.getParent();
2434 //printf("TreeIter.getVisiblePath = %.*s\n", vPath.toString());
2440 * Gets the parent of this iter
2442 * @return the parent iter or null if can't get parent or an error occured
2444 TreeIter getParent()
2446 if ( gtkTreeModel is null )
2448 throw new TreeIterError("getParent", "Tree model not set");
2450 TreeIter parent = new TreeIter();
2451 bool gotParent = gtk_tree_model_iter_parent(gtkTreeModel, parent.getTreeIterStruct(), gtkTreeIter) == 0 ? false : true;
2456 parent.setModel(gtkTreeModel);
2461 TreeIter getGrandParent()
2463 if ( gtkTreeModel is null )
2465 throw new TreeIterError("getGrandParent", "Tree model not set");
2467 TreeIter grandParent = this;
2468 TreeIter parent = grandParent.getParent();
2469 while ( parent !is null )
2471 grandParent = parent;
2472 parent = grandParent.getParent();
2491 prefix: gtk_tree_path_
2494 import: gtk.TreePath
2495 structWrap: GtkTreePath* TreePath
2498 nocode: gtk_tree_path_new
2499 nocode: gtk_tree_path_new_first
2503 * Creates a new GtkTreePath. This structure refers to a row.
2504 * if firstRow is true this is the string representation of this path is "0"
2506 * A newly created GtkTreePath.
2508 public this (bool firstRow=false)
2512 // GtkTreePath* gtk_tree_path_new_first (void);
2513 this(cast(GtkTreePath*)gtk_tree_path_new_first() );
2517 // GtkTreePath* gtk_tree_path_new (void);
2518 this(cast(GtkTreePath*)gtk_tree_path_new() );
2524 struct: GtkTreeRowReference
2525 class: TreeRowReference
2527 prefix: gtk_tree_row_reference_
2529 import: gtk.TreeModel
2530 structWrap: GtkTreeModel* TreeModel
2531 import: gtk.TreePath
2532 structWrap: GtkTreePath* TreePath
2533 import: gobject.ObjectG
2534 structWrap: GObject* ObjectG
2535 #import: gtk.TreeRowReference
2536 #structWrap: GtkTreeRowReference* TreeRowReference
2537 import: gtk.TreeIter
2538 structWrap: GtkTreeIter* TreeIter
2539 outFile: TreeRowReference
2542 class: TreeIterError
2544 import(tango): tango.core.Exception
2550 * - trying to access a method that requires a tree model and the tree model was never set
2552 public this(char[] method, char[] message)
2554 super("TreeIter."~method~" : "~message);
2558 outFile: TreeIterError
2561 file: GtkTreeSelection.html
2562 struct: GtkTreeSelection
2563 class: TreeSelection
2564 prefix: gtk_tree_selection_
2566 import: gtk.TreeView
2567 structWrap: GtkTreeView* TreeView
2568 #import: gtk.TreeModel*
2569 #structWrap: GtkTreeModel** TreeModel*
2570 import: gtk.TreeIter
2571 structWrap: GtkTreeIter* TreeIter
2573 structWrap: GList* ListG
2574 import: gtk.TreePath
2575 structWrap: GtkTreePath* TreePath
2576 import: gtk.TreeModel
2577 import: gtk.TreeIter
2579 nocode: gtk_tree_selection_get_selected
2580 nocode: gtk_tree_selection_get_selected_rows
2584 * Sets iter to the currently selected node if selection is set to
2585 * GTK_SELECTION_SINGLE or GTK_SELECTION_BROWSE. iter may be NULL if you
2586 * just want to test if selection has any selected nodes. model is filled
2587 * with the current model as a convenience. This function will not work if you
2588 * use selection is GTK_SELECTION_MULTIPLE.
2590 * A GtkTreeSelection.
2592 * A pointer to set to the GtkTreeModel, or NULL.
2594 * The GtkTreeIter, or NULL.
2596 * TRUE, if there is a selected node.
2598 int getSelected(TreeModel model, TreeIter iter)
2600 GtkTreeModel* m = model.getTreeModelStruct();
2601 return gtk_tree_selection_get_selected(gtkTreeSelection, &m, iter.getTreeIterStruct())==0 ? false : true;
2605 * Creates a list of path of all selected rows. Additionally, if you are
2606 * planning on modifying the model after calling this function, you may
2607 * want to convert the returned list into a list of GtkTreeRowReferences.
2608 * To do this, you can use gtk_tree_row_reference_new().
2609 * To free the return value, use:
2610 * g_list_foreach (list, gtk_tree_path_free, NULL);
2611 * g_list_free (list);
2613 * A GtkTreeSelection.
2615 * A pointer to set to the GtkTreeModel, or NULL.
2617 * A GList containing a GtkTreePath for each selected row.
2620 TreePath[] getSelectedRows(TreeModel model)
2623 GtkTreeModel* m = model.getTreeModelStruct();
2624 GList* gList = gtk_tree_selection_get_selected_rows(gtkTreeSelection, &m);
2625 if ( gList !is null )
2627 ListG list = new ListG(gList);
2628 for ( int i=0 ; i<list.length() ; i++ )
2630 paths ~= new TreePath(cast(GtkTreePath*)list.nthData(i));
2639 outFile: TreeSelection
2641 file: GtkTreeViewColumn.html
2642 struct: GtkTreeViewColumn
2643 class: TreeViewColumn
2644 prefix: gtk_tree_view_column_
2647 import: gtk.CellRenderer
2648 structWrap: GtkCellRenderer* CellRenderer
2650 structWrap: GList* ListG
2652 structWrap: GtkWidget* Widget
2653 import: gtk.TreeModel
2654 structWrap: GtkTreeModel* TreeModel
2655 import: gtk.TreeIter
2656 structWrap: GtkTreeIter* TreeIter
2657 import: gdk.Rectangle
2658 structWrap: GdkRectangle* Rectangle
2660 nocode: gtk_tree_view_column_new_with_attributes
2664 * Creates a new Tree view column
2665 * @param header th column header text
2666 * @param renderer the rederer for the column cells
2667 * @param type the type of data to be displayed (shouldn't this be on the renderer?)
2668 * @param column the column number
2670 this(char [] header, CellRenderer renderer, char [] type, int column)
2672 this(gtk_tree_view_column_new_with_attributes(
2673 Str.toStringz(header),
2674 renderer.getCellRendererStruct(),
2675 Str.toStringz(type),
2684 outFile: TreeViewColumn
2686 file: GtkTreeView.html
2689 prefix: gtk_tree_view_
2692 import: gtk.TreeModel
2693 structWrap: GtkTreeModel* TreeModel
2694 import: gtk.TreeSelection
2695 structWrap: GtkTreeSelection* TreeSelection
2696 import: gtk.Adjustment
2697 structWrap: GtkAdjustment* Adjustment
2698 import: gtk.TreeViewColumn
2699 structWrap: GtkTreeViewColumn* TreeViewColumn
2700 import: gtk.CellRenderer
2701 structWrap: GtkCellRenderer* CellRenderer
2703 structWrap: GList* ListG
2704 import: gtk.TreePath
2705 structWrap: GtkTreePath* TreePath
2706 #import: gtk.TreePath*
2707 #structWrap: GtkTreePath** TreePath*
2708 #import: gtk.TreeViewColumn*
2709 #structWrap: GtkTreeViewColumn** TreeViewColumn*
2710 import: gdk.Rectangle
2711 structWrap: GdkRectangle* Rectangle
2713 structWrap: GdkWindow* Window
2714 #import: gtk.TargetEntry
2715 #structWrap: GtkTargetEntry* TargetEntry
2716 #import: gtk.TreeViewDropPosition
2717 #structWrap: GtkTreeViewDropPosition* TreeViewDropPosition
2719 structWrap: GdkPixmap* Pixmap
2720 import: gtk.TreeIter
2724 * Expands the row of the iter.
2729 int expandRow(TreeIter iter, TreeModel model, int openAll)
2731 return expandRow(model.getPath(iter), openAll);
2735 * Finds the path at the point (x, y), relative to widget coordinates. That
2736 * is, x and y are relative to an events coordinates. x and y must come
2737 * from an event on the tree_view only where event->window ==
2738 * gtk_tree_view_get_bin (). It is primarily for things
2739 * like popup menus. If path is non-NULL, then it will be filled with the
2740 * GtkTreePath at that point. This path should be freed with gtk_tree_path_free().
2741 * If column is non-NULL, then it will be filled with the column at that point.
2742 * cell_x and cell_y return the coordinates relative to the cell background
2743 * (i.e. the background_area passed to gtk_cell_renderer_render()). This
2744 * function is only meaningful if tree_view is realized.
2748 * The x position to be identified.
2750 * The y position to be identified.
2752 * A pointer to a GtkTreePath pointer to be filled in, or NULL
2754 * A pointer to a GtkTreeViewColumn pointer to be filled in, or NULL
2756 * A pointer where the X coordinate relative to the cell can be placed, or NULL
2758 * A pointer where the Y coordinate relative to the cell can be placed, or NULL
2760 * TRUE if a row exists at that coordinate.
2762 int getPathAtPos(gint x, gint y, inout TreePath path, inout TreeViewColumn column, out gint cellX, out gint cellY)
2764 GtkTreePath* p = path.getTreePathStruct();
2765 GtkTreeViewColumn* c = column.getTreeViewColumnStruct();
2767 int result = gtk_tree_view_get_path_at_pos(gtkTreeView, x, y, &p, &c, &cellX, &cellY)
2768 == 0 ? false : true;
2770 path = new TreePath(p);
2771 column = new TreeViewColumn(c);
2779 * gets the first selected iter or null if no rows are selected
2781 TreeIter getSelectedIter()
2783 TreeIter iter = new TreeIter();
2784 TreeSelection selection = getSelection();
2785 TreeModel model = getModel();
2786 TreePath[] paths = selection.getSelectedRows(model);
2787 if ( paths.length > 0 )
2789 model.getIter(iter,paths[0]);
2794 TreeIter[] getSelectedIters()
2798 TreeIter iter = new TreeIter();
2799 TreeSelection selection = getSelection();
2800 TreeModel model = getModel();
2801 TreePath[] paths = selection.getSelectedRows(model);
2802 foreach ( TreePath p; selection.getSelectedRows(model) )
2804 //iters.length = iters.length+1;
2805 //iters[iters.length-1] = model.getIter(iter,p);
2806 // iters ~= model.getIter(iter,p); >>> compile error can only concatenate arrays ???
2807 if ( model.getIter(iter,p) )
2810 iter = new TreeIter();
2814 //printf("TreeView.getSelectedIters iters.lenght = %d\n", iters.length);
2819 * Inserts a column and sets it's attributes
2824 * @return number of columns including the new one
2826 gint insertEditableColumn(int position, char[] title, CellRenderer renderer, bool editable)
2828 // OK, this is a trick because of my ignorance on how to pass variable argument lists
2831 position = getColumns().length();
2833 int tot = gtk_tree_view_insert_column_with_attributes(
2836 Str.toStringz(title),
2837 renderer.getCellRendererStruct(),
2838 Str.toStringz("text"),position,//v1.getV(),
2839 Str.toStringz("editable"),2,0);//v.getV(),0);
2849 file: gtk-GtkTreeView-drag-and-drop.html
2850 struct: GtkTreeDragSource
2851 class: TreeDragSource
2852 prefix: gtk_tree_drag_
2854 import: gtk.TreePath
2855 structWrap: GtkTreePath* TreePath
2856 #import: gtk.SelectionData
2857 #structWrap: GtkSelectionData* SelectionData
2858 #import: gtk.TreeDragDest
2859 #structWrap: GtkTreeDragDest* TreeDragDest
2860 import: gtk.TreeModel
2861 structWrap: GtkTreeModel* TreeModel
2862 outFile: TreeDragSource
2864 file: GtkCellView.html
2867 prefix: gtk_cell_view_
2871 structWrap: GdkPixbuf* Pixbuf
2872 import: gtk.TreeModel
2873 structWrap: GtkTreeModel* TreeModel
2874 import: gtk.TreePath
2875 structWrap: GtkTreePath* TreePath
2876 #import: gtk.Requisition
2877 #structWrap: GtkRequisition* Requisition
2879 structWrap: GdkColor* Color
2881 structWrap: GList* ListG
2883 nocode: gtk_cell_view_new_with_text
2884 nocode: gtk_cell_view_new_with_markup
2888 * Creates a new GtkCellView widget, adds a GtkCellRendererText
2889 * to it, and makes its show text.
2890 * If markup is true the text can be marked up with the Pango text
2893 * the text to display in the cell view
2895 * A newly created GtkCellView widget.
2898 public this (char[] text, bool markup=true)
2902 // GtkWidget* gtk_cell_view_new_with_markup (const gchar *markup);
2903 this(cast(GtkCellView*)gtk_cell_view_new_with_markup(Str.toStringz(text)) );
2907 // GtkWidget* gtk_cell_view_new_with_text (const gchar *text);
2908 this(cast(GtkCellView*)gtk_cell_view_new_with_text(Str.toStringz(text)) );
2915 file: GtkIconView.html
2918 prefix: gtk_icon_view_
2920 import: gtk.TreeModel
2921 structWrap: GtkTreeModel* TreeModel
2922 import: gtk.TreePath
2923 structWrap: GtkTreePath* TreePath
2924 #import: gtk.TreePath*
2925 #structWrap: GtkTreePath** TreePath*
2926 #import: gtk.CellRenderer*
2927 #structWrap: GtkCellRenderer** CellRenderer*
2928 import: gtk.CellRenderer
2929 structWrap: GtkCellRenderer* CellRenderer
2931 structWrap: GList* ListG
2932 #import: gtk.TargetEntry
2933 #structWrap: GtkTargetEntry* TargetEntry
2934 #import: gtk.IconViewDropPosition
2935 #structWrap: GtkIconViewDropPosition* IconViewDropPosition
2937 structWrap: GdkPixmap* Pixmap
2940 file: GtkTreeSortable.html
2941 struct: GtkTreeSortable
2943 prefix: gtk_tree_sortable_
2945 #import: gtk.SortType
2946 #structWrap: GtkSortType* SortType
2947 outFile: TreeSortable
2949 file: GtkTreeModelSort.html
2950 struct: GtkTreeModelSort
2951 class: TreeModelSort
2953 prefix: gtk_tree_model_sort_
2955 import: gtk.TreeModel
2956 structWrap: GtkTreeModel* TreeModel
2957 import: gtk.TreePath
2958 structWrap: GtkTreePath* TreePath
2959 import: gtk.TreeIter
2960 structWrap: GtkTreeIter* TreeIter
2961 outFile: TreeModelSort
2963 file: GtkTreeModelFilter.html
2964 struct: GtkTreeModelFilter
2965 class: TreeModelFilter
2966 prefix: gtk_tree_model_filter_
2968 import: gtk.TreeModel
2969 structWrap: GtkTreeModel* TreeModel
2970 import: gtk.TreePath
2971 structWrap: GtkTreePath* TreePath
2972 #import: gobject.Type
2973 #structWrap: GType* Type
2974 import: gtk.TreeIter
2975 structWrap: GtkTreeIter* TreeIter
2976 outFile: TreeModelFilter
2978 file: GtkCellLayout.html
2979 struct: GtkCellLayout
2982 prefix: gtk_cell_layout_
2985 import: gtk.CellRenderer
2986 structWrap: GtkCellRenderer* CellRenderer
2988 interface: CellLayoutIF
2989 outFile: CellLayoutT
2991 file: GtkCellRenderer.html
2992 struct: GtkCellRenderer
2994 prefix: gtk_cell_renderer_
2998 structWrap: GtkWidget* Widget
2999 import: gdk.Rectangle
3000 structWrap: GdkRectangle* Rectangle
3002 structWrap: GdkWindow* Window
3004 structWrap: GdkEvent* Event
3005 import: gtk.CellEditable
3006 structWrap: GtkCellEditable* CellEditable
3007 outFile: CellRenderer
3009 file: GtkCellEditable.html
3010 struct: GtkCellEditable
3012 prefix: gtk_cell_editable_
3015 structWrap: GdkEvent* Event
3016 outFile: CellEditable
3018 file: GtkCellRendererCombo.html
3019 struct: GtkCellRenderer
3020 realStruct: GtkCellRendererCombo
3021 class: CellRendererCombo
3022 prefix: gtk_cell_renderer_combo_
3024 import: gtk.CellRenderer
3025 structWrap: GtkCellRenderer* CellRenderer
3026 outFile: CellRendererCombo
3028 file: GtkCellRendererPixbuf.html
3029 struct: GtkCellRenderer
3030 realStruct: GtkCellRendererPixbuf
3031 class: CellRendererPixbuf
3032 prefix: gtk_cell_renderer_pixbuf_
3034 import: gtk.CellRenderer
3035 structWrap: GtkCellRenderer* CellRenderer
3036 outFile: CellRendererPixbuf
3038 file: GtkCellRendererProgress.html
3039 struct: GtkCellRenderer
3040 realStruct: GtkCellRendererProgress
3041 class: CellRendererProgress
3042 prefix: gtk_cell_renderer_progress_
3044 import: gtk.CellRenderer
3045 structWrap: GtkCellRenderer* CellRenderer
3046 outFile: CellRendererProgress
3048 file: GtkCellRendererText.html
3049 struct: GtkCellRenderer
3050 realStruct: GtkCellRendererText
3051 class: CellRendererText
3052 prefix: gtk_cell_renderer_text_
3055 import: gtk.CellRenderer
3056 structWrap: GtkCellRenderer* CellRenderer
3057 outFile: CellRendererText
3059 file: GtkCellRendererToggle.html
3060 struct: GtkCellRenderer
3061 realStruct: GtkCellRendererToggle
3062 class: CellRendererToggle
3063 prefix: gtk_cell_renderer_toggle_
3066 import: gtk.CellRenderer
3067 structWrap: GtkCellRenderer* CellRenderer
3068 outFile: CellRendererToggle
3074 * TreeNode interface
3076 public interface TreeNode
3078 char[] getNodeValue(int column);
3084 file: GtkListStore.html
3085 struct: GtkListStore
3087 extend: GtkTreeModel
3088 prefix: gtk_list_store_
3090 import: gtk.TreeModel
3092 #import: gobject.Type
3093 #structWrap: GType* Type
3094 import: gtk.TreeIter
3095 structWrap: GtkTreeIter* TreeIter
3096 import: gobject.Value
3097 structWrap: GValue* Value
3100 nocode: gtk_list_store_set
3105 * Non-vararg creation function. Used primarily by language bindings.
3107 * number of columns in the list store
3109 * an array of GType types for the columns, from first to last
3111 * a new GtkListStore
3113 public this (GType[] types)
3115 // GtkListStore* gtk_list_store_newv (gint n_columns, GType *types);
3116 this(cast(GtkListStore*)gtk_list_store_newv(types.length, cast(GType*)(types.ptr)) );
3120 * Creates a top level iteractor.
3121 * I don't think lists have but the top level iteractor
3123 TreeIter createIter()
3125 GtkTreeIter* iter = new GtkTreeIter;
3126 gtk_list_store_append(getListStoreStruct(), iter);
3127 return new TreeIter(iter);
3131 * sets the values for one row
3132 * @param iter the row iteractor
3133 * @param columns an arrays with the columns to set
3134 * @param values an arrays with the values
3136 void set(TreeIter iter, int [] columns, char*[] values)
3138 for ( int i=0 ; i<columns.length && i<values.length; i++ )
3140 //Value v = new Value(values[i]);
3141 //gtk_list_store_set(obj(), iter.getIter(), columns[i], v.getV(),-1);
3144 iter.getTreeIterStruct(),
3150 void set(TreeIter iter, int [] columns, char[][] values)
3152 for ( int i=0 ; i<columns.length && i<values.length; i++ )
3154 //Value v = new Value(values[i]);
3155 //gtk_list_store_set(obj(), iter.getIter(), columns[i], v.getV(),-1);
3158 iter.getTreeIterStruct(),
3160 Str.toStringz(values[i]),-1);
3164 void setValue(TreeIter iter, int column, char[] value)
3166 Value v = new Value(value);
3167 gtk_list_store_set_value(gtkListStore, iter.getTreeIterStruct(), column, v.getValueStruct());
3168 //gtk_list_store_set_value(obj(), iter.getIter(), column, (GValue*)cChar(value));
3171 void setValue(TreeIter iter, int column, int value)
3173 Value v = new Value(value);
3174 gtk_list_store_set_value(gtkListStore, iter.getTreeIterStruct(), column, v.getValueStruct());
3180 file: GtkTreeStore.html
3181 struct: GtkTreeStore
3183 extend: GtkTreeModel
3184 prefix: gtk_tree_store_
3187 #import: gobject.Type
3188 #structWrap: GType* Type
3189 import: gtk.TreeIter
3190 structWrap: GtkTreeIter* TreeIter
3191 import: gobject.Value
3192 structWrap: GValue* Value
3193 import: gtk.TreeNode
3195 import: gobject.Value;
3197 import: gtk.TreeModel
3199 nocode: gtk_tree_store_set
3204 * Non-vararg creation function. Used primarily by language bindings.
3206 * number of columns in the list store
3208 * an array of GType types for the columns, from first to last
3210 * a new GtkListStore
3212 public this (GType[] types)
3214 // GtkListStore* gtk_list_store_newv (gint n_columns, GType *types);
3215 this(cast(GtkTreeStore*)gtk_tree_store_newv(
3216 types.length, cast(GType*)(types.ptr))
3223 * Creates a top level iteractor.
3224 * I don't think lists have but the top level iteractor
3226 TreeIter createIter(TreeIter parent=null)
3228 GtkTreeIter* iter = new GtkTreeIter;
3229 gtk_tree_store_append(getTreeStoreStruct(), iter, (parent is null) ? null : parent.getTreeIterStruct());
3230 return new TreeIter(iter);
3234 * Sets one value into one cells.
3235 * @param iter the tree iteractor, effectivly the row
3236 * @param column to column number to set
3237 * @param value the value
3238 * \todo confirm we need to destroy the Value instance
3240 void setValue(TreeIter iter, int column, char[] value)
3242 gtk_tree_store_set(gtkTreeStore, iter.getTreeIterStruct(), column, Str.toStringz(value) , -1);
3245 void setValue(TreeIter iter, int column, int value)
3247 gtk_tree_store_set(gtkTreeStore, iter.getTreeIterStruct(), column, (new Value(value)).getValueStruct() , -1);
3253 * \todo confirm we need to destroy the Value instance
3255 void setValue(TreeIter iter, int column, Pixbuf pixbuf)
3257 Value v = new Value(pixbuf);
3258 gtk_tree_store_set_value(gtkTreeStore, iter.getTreeIterStruct(), column, v.getValueStruct());
3263 * sets the values for one row
3264 * @param iter the row iteractor
3265 * @param columns an arrays with the columns to set
3266 * @param values an arrays with the values
3268 void set(TreeIter iter, int [] columns, char*[] values)
3270 for ( int i=0 ; i<columns.length && i<values.length; i++ )
3272 //Value v = new Value(values[i]);
3273 //gtk_list_store_set(obj(), iter.getIter(), columns[i], v.getV(),-1);
3276 iter.getTreeIterStruct(),
3282 void set(TreeIter iter, int [] columns, char[][] values)
3284 for ( int i=0 ; i<columns.length && i<values.length; i++ )
3286 //Value v = new Value(values[i]);
3287 //gtk_list_store_set(obj(), iter.getIter(), columns[i], v.getV(),-1);
3290 iter.getTreeIterStruct(),
3292 Str.toStringz(values[i]),-1);
3297 * Sets an iteractor values from a tree node.
3298 * This is the way to add a new row to the tree,
3299 * the iteractor is either a top level iteractor created from createIter()
3300 * or a nested iteractor created from append()
3301 * @param iter the iteractor to set
3302 * @param treeNode the tree node
3306 void set(TreeIter iter, TreeNode treeNode)
3310 for ( int i=0 ; i<treeNode.columnCount() ; i++ )
3312 //printf(">>>>>>>>>>>>> requesting value for %d\n",i);
3314 char[] value = treeNode.getNodeValue(i);
3315 if ( value is null )
3324 set(iter, cols, vals);
3329 * Creates and prepends a new row to tree_store. If parent is non-NULL, then it will prepend
3330 * the new row before the first child of parent, otherwise it will prepend a row
3331 * to the top level. iter will be changed to point to this new row. The row
3332 * will be empty after this function is called. To fill in values, you need to
3333 * call gtk_tree_store_set() or gtk_tree_store_set_value().
3335 * A valid GtkTreeIter, or NULL
3337 public TreeIter prepend(TreeIter parent)
3339 TreeIter iter = new TreeIter();
3340 // void gtk_tree_store_prepend (GtkTreeStore *tree_store, GtkTreeIter *iter, GtkTreeIter *parent);
3341 gtk_tree_store_prepend(gtkTreeStore, iter.getTreeIterStruct(), (parent is null) ? null : parent.getTreeIterStruct());
3346 * Creates and appends a new row to tree_store. If parent is non-NULL, then it will append the
3347 * new row after the last child of parent, otherwise it will append a row to
3348 * the top level. iter will be changed to point to this new row. The row will
3349 * be empty after this function is called. To fill in values, you need to call
3350 * gtk_tree_store_set() or gtk_tree_store_set_value().
3352 * A valid GtkTreeIter, or NULL
3354 public TreeIter append(TreeIter parent)
3356 TreeIter iter = new TreeIter();
3357 // void gtk_tree_store_append (GtkTreeStore *tree_store, GtkTreeIter *iter, GtkTreeIter *parent);
3358 gtk_tree_store_append(gtkTreeStore,
3359 iter.getTreeIterStruct(),
3360 (parent is null) ? null : parent.getTreeIterStruct());
3368 ###########################################################
3369 ### Menus, Combo Box, Toolbar #############################
3370 ###########################################################
3372 file: GtkComboBox.html
3376 implements: CellLayoutIF
3377 import: atk.ObjectAtk
3378 structWrap: AtkObject* ObjectAtk
3379 prefix: gtk_combo_box_
3381 #noprefix: gtk_combo_box_new_text
3382 #noprefix: gtk_combo_box_append_text
3383 #noprefix: gtk_combo_box_insert_text
3384 #noprefix: gtk_combo_box_prepend_text
3385 #noprefix: gtk_combo_box_remove_text
3387 import: gtk.TreeModel
3388 structWrap: GtkTreeModel* TreeModel
3389 import: gtk.TreeIter
3390 structWrap: GtkTreeIter* TreeIter
3391 import: gtk.CellRenderer
3392 import: gtk.CellLayoutIF
3393 import: gtk.CellLayoutT
3395 nocode: gtk_combo_box_new
3396 nocode:gtk_combo_box_new_text
3400 private int count = 0;
3401 public int maxCount = 0;
3404 // add the CellLayout capabilities
3405 mixin CellLayoutT!(GtkComboBox);
3408 * Creates a new empty GtkComboBox.
3409 * If text is true then
3410 * constructs a new text combo box, which is a
3411 * GtkComboBox just displaying strings. If you use this function to create
3412 * a text combo box, you should only manipulate its data source with the
3413 * following convenience functions: gtk_combo_box_append_text(),
3414 * gtk_combo_box_insert_text(), gtk_combo_box_prepend_text() and
3415 * gtk_combo_box_remove_text().
3417 * A new GtkComboBox.
3420 public this (bool text=true)
3424 // GtkWidget* gtk_combo_box_new_text (void);
3425 this(cast(GtkComboBox*)gtk_combo_box_new_text() );
3429 // GtkWidget* gtk_combo_box_new (void);
3430 this(cast(GtkComboBox*)gtk_combo_box_new() );
3434 public void setActiveText(char[] text, bool insert=false)
3436 int currActive = getActive();
3440 while ( !found && active==getActive)
3442 found = text==getActiveText();
3454 //setActive(currActive);
3461 int getIndex(char[] text)
3463 TreeIter iter = new TreeIter();
3464 TreeModel model = getModel();
3465 iter.setModel(model);
3469 if ( model.getIterFirst(iter) )
3471 while ( !end && iter !is null && !found )
3473 found = iter.getValueString(0) == text;
3476 end = !model.iterNext(iter);
3485 return end ? -1 : index;
3488 void prependOrReplaceText(char[] text)
3490 int index = getIndex(text);
3496 else if ( index == -1 )
3506 #struct: GtkComboBox
3507 #class: ComboBoxText
3508 #import: atk.ObjectAtk
3509 #structWrap: AtkObject* ObjectAtk
3510 #filterIn: gtk_combo_box_new_text
3511 #filterIn: gtk_combo_box_append_text
3512 #filterIn: gtk_combo_box_insert_text
3513 #filterIn: gtk_combo_box_prepend_text
3514 #filterIn: gtk_combo_box_remove_text
3516 #outFile: ComboBoxText
3518 file: GtkComboBoxEntry.html
3520 struct: GtkComboBoxEntry
3521 class: ComboBoxEntry
3522 implements: CellLayoutIF
3523 prefix: gtk_combo_box_entry_
3524 #noprefix: gtk_combo_box_entry_new_text
3525 #noprefix: gtk_combo_box_append_text
3526 #noprefix: gtk_combo_box_insert_text
3527 #noprefix: gtk_combo_box_prepend_text
3528 #noprefix: gtk_combo_box_remove_text
3529 import: gtk.TreeModel
3530 structWrap: GtkTreeModel* TreeModel
3532 import: gtk.CellRenderer
3533 import: gtk.CellLayoutIF
3534 import: gtk.CellLayoutT
3536 nocode: gtk_combo_box_entry_new
3537 nocode: gtk_combo_box_entry_new_text
3541 mixin CellLayoutT!(GtkComboBoxEntry);
3543 * Creates a new GtkComboBoxEntry which has a GtkEntry as child. After
3544 * construction, you should set a model using gtk_combo_box_set_model() and a
3545 * text_column * using gtk_combo_box_entry_set_text_column().
3547 * A new GtkComboBoxEntry.
3550 public this (bool text=true)
3554 // GtkWidget* gtk_combo_box_entry_new_text (void);
3555 this(cast(GtkComboBoxEntry*)gtk_combo_box_entry_new_text() );
3559 // GtkWidget* gtk_combo_box_entry_new (void);
3560 this(cast(GtkComboBoxEntry*)gtk_combo_box_entry_new() );
3565 outFile: ComboBoxEntry
3568 #struct: GtkComboBoxEntry
3569 #class: ComboBoxEntryText
3570 #filterIn: gtk_combo_box_entry_new_text
3571 #filterIn: gtk_combo_box_append_text
3572 #filterIn: gtk_combo_box_insert_text
3573 #filterIn: gtk_combo_box_prepend_text
3574 #filterIn: gtk_combo_box_remove_text
3576 #outFile: ComboBoxEntryText
3585 structWrap: GtkWidget* Widget
3587 structWrap: GdkScreen* Screen
3588 import: gtk.AccelGroup
3589 structWrap: GtkAccelGroup* AccelGroup
3591 structWrap: GList* ListG
3592 import: gtk.MenuItem
3595 public void append(Widget widget)
3597 super.append(widget);
3601 * Popups up this menu
3602 * @param button ??? you can pass a button number here
3603 * @param activateTime ??? you can pass the time from an event here
3605 void popup(guint button, guint32 activateTime)
3607 popup(null, null, null, null, button, activateTime);
3611 * Creates and append a submenu to this menu.
3612 * This menu item that actualy has the sub menu is also created.
3613 * @param label the sub menu item label
3614 * @return the new menu
3616 Menu appendSubmenu(char[] label)
3618 MenuItem item = new MenuItem(label);
3620 Menu submenu = new Menu();
3621 item.setSubmenu(submenu);
3625 void appendSubmenu(char[] label, Menu submenu)
3627 MenuItem item = new MenuItem(label);
3629 item.setSubmenu(submenu);
3632 Menu prependSubmenu(char[] label)
3634 MenuItem item = new MenuItem(label);
3636 Menu submenu = new Menu();
3637 item.setSubmenu(submenu);
3645 file: GtkMenuBar.html
3648 prefix: gtk_menu_bar_
3651 structWrap: GtkWidget* Widget
3653 import: gtk.MenuItem;
3654 structWrap: GtkMenu* Menu
3655 structWrap: GtkMenuItem* MenuItem
3657 Menu append(char[] label, bool rightJustify=false)
3659 MenuItem item = new MenuItem(label);
3661 item.setRightJustified(rightJustify);
3662 Menu menu= new Menu();
3663 item.setSubmenu(menu);
3667 public void append(Widget widget)
3669 super.append(widget);
3674 file: GtkMenuItem.html
3677 prefix: gtk_menu_item_
3681 import: gtk.AccelGroup
3682 structWrap: GtkWidget* Widget
3683 # method conflict with parent method
3684 nocode: gtk_menu_item_activate
3685 nocode: gtk_menu_item_new_with_label
3686 nocode: gtk_menu_item_new_with_mnemonic
3687 # replace the method
3688 # TODO create a method rename instead of replacing the entire code
3691 /** store the action code passed in by the applcation */
3692 private char[] actionLabel;
3694 /** Gets the application set action code */
3695 public char[] getActionName()
3697 if ( actionLabel is null )
3705 * Creates a new menu item with a label and a listener and a action.
3706 * used for backward compatibily with DUI.
3708 this(char[] label, void delegate(MenuItem)dlg, char[] action)
3711 this.actionLabel = action;
3718 * Creates a new Item associated with a "activate" delegate and with a action code
3719 * and optionally accelGroup
3721 public this(void delegate(MenuItem) dlg, char[] label, char[] action,
3723 AccelGroup accelGroup=null,
3725 GdkModifierType modifierType=GdkModifierType.CONTROL_MASK,
3726 GtkAccelFlags accelFlags=GtkAccelFlags.VISIBLE
3729 this(label, mnemonic);
3730 this.actionLabel = action;
3732 if ( accelGroup !is null && accelKey != '\0' )
3734 addAccelerator("activate",accelGroup,accelKey,modifierType,accelFlags);
3741 * Creates a new Item associated with a "activate" delegate
3743 public this(void delegate(MenuItem) dlg, char[] label, bool mnemonic=true)
3745 this(label, mnemonic);
3750 * Creates a new GtkMenuItem whose child is a GtkLabel.
3751 * If mnemonic is true the label
3752 * will be created using gtk_label_new_with_mnemonic(), so underscores
3753 * in label indicate the mnemonic for the menu item.
3755 * the text for the label
3757 * the newly created GtkMenuItem
3759 public this (char[] label, bool mnemonic=true)
3763 // GtkWidget* gtk_menu_item_new_with_mnemonic (const gchar *label);
3764 this(cast(GtkMenuItem*)gtk_menu_item_new_with_mnemonic(Str.toStringz(label)) );
3768 // GtkWidget* gtk_menu_item_new_with_label (const gchar *label);
3769 this(cast(GtkMenuItem*)gtk_menu_item_new_with_label(Str.toStringz(label)) );
3775 * Emits the "activate" signal on the given item
3779 public void itemActivate()
3781 // void gtk_menu_item_activate (GtkMenuItem *menu_item);
3782 gtk_menu_item_activate(gtkMenuItem);
3788 file: GtkMenuShell.html
3789 struct: GtkMenuShell
3791 prefix: gtk_menu_shell_
3794 structWrap: GtkWidget* Widget
3797 file: GtkImageMenuItem.html
3798 struct: GtkImageMenuItem
3799 class: ImageMenuItem
3800 prefix: gtk_image_menu_item_
3804 structWrap: GtkWidget* Widget
3805 import: gtk.AccelGroup
3806 structWrap: GtkAccelGroup* AccelGroup
3808 nocode: gtk_image_menu_item_new_with_label
3809 nocode: gtk_image_menu_item_new_with_mnemonic
3813 * Creates a new GtkImageMenuItem containing a label.
3814 * If mnemonic it true the label
3815 * will be created using gtk_label_new_with_mnemonic(), so underscores
3816 * in label indicate the mnemonic for the menu item.
3818 * the text of the menu item.
3820 * a new GtkImageMenuItem.
3822 public this (char[] label, bool mnemonic=true)
3826 // GtkWidget* gtk_image_menu_item_new_with_mnemonic (const gchar *label);
3827 this(cast(GtkImageMenuItem*)gtk_image_menu_item_new_with_mnemonic(Str.toStringz(label)) );
3831 // GtkWidget* gtk_image_menu_item_new_with_label (const gchar *label);
3832 this(cast(GtkImageMenuItem*)gtk_image_menu_item_new_with_label(Str.toStringz(label)) );
3837 outFile: ImageMenuItem
3839 file: GtkRadioMenuItem.html
3840 struct: GtkRadioMenuItem
3841 class: RadioMenuItem
3842 prefix: gtk_radio_menu_item_
3846 structWrap: GSList* ListSG
3848 nocode: gtk_radio_menu_item_new_with_label
3849 nocode: gtk_radio_menu_item_new_with_mnemonic
3850 nocode: gtk_radio_menu_item_new_with_mnemonic_from_widget
3851 nocode: gtk_radio_menu_item_new_with_label_from_widget
3855 * Creates a new GtkRadioMenuItem whose child is a simple GtkLabel.
3856 * The new GtkRadioMenuItem is added to the same group as group.
3857 * If mnemonic is true the label will be
3858 * created using gtk_label_new_with_mnemonic(), so underscores in label
3859 * indicate the mnemonic for the menu item.
3861 * an existing GtkRadioMenuItem
3863 * the text for the label
3865 * The new GtkRadioMenuItem
3868 public this (RadioMenuItem radioMenuItem, char[] label, bool mnemonic=true)
3872 // GtkWidget* gtk_radio_menu_item_new_with_mnemonic_from_widget (GtkRadioMenuItem *group, const gchar *label);
3873 this(cast(GtkRadioMenuItem*)gtk_radio_menu_item_new_with_mnemonic_from_widget(
3874 radioMenuItem.getRadioMenuItemStruct(), Str.toStringz(label)) );
3878 // GtkWidget* gtk_radio_menu_item_new_with_label_from_widget (GtkRadioMenuItem *group, const gchar *label);
3879 this(cast(GtkRadioMenuItem*)gtk_radio_menu_item_new_with_label_from_widget(
3880 radioMenuItem.getRadioMenuItemStruct(), Str.toStringz(label)) );
3885 * Creates a new GtkRadioMenuItem containing a label. T
3886 * The new GtkRadioMenuItem is added to the same group as group.
3888 * An existing GtkRadioMenuItem
3890 * the text of the button, with an underscore in front of the
3891 * mnemonic character
3893 * The new GtkRadioMenuItem
3896 public this (char[] label)
3901 * Creates a new GtkRadioMenuItem whose child is a simple GtkLabel.
3902 * If mnemonic is true the label
3903 * will be created using gtk_label_new_with_mnemonic(), so underscores
3904 * in label indicate the mnemonic for the menu item.
3906 * the group to which the radio menu item is to be attached
3908 * the text for the label
3910 * a new GtkRadioMenuItem
3912 public this (ListSG group, char[] label, bool mnemonic=true)
3916 // GtkWidget* gtk_radio_menu_item_new_with_mnemonic (GSList *group, const gchar *label);
3917 this(cast(GtkRadioMenuItem*)gtk_radio_menu_item_new_with_mnemonic(
3918 group is null ? null : group.getListSGStruct(), Str.toStringz(label)) );
3922 // GtkWidget* gtk_radio_menu_item_new_with_label (GSList *group, const gchar *label);
3923 this(cast(GtkRadioMenuItem*)gtk_radio_menu_item_new_with_label(
3924 group is null ? null : group.getListSGStruct(), Str.toStringz(label)) );
3928 outFile: RadioMenuItem
3930 file: GtkCheckMenuItem.html
3931 struct: GtkCheckMenuItem
3932 class: CheckMenuItem
3933 prefix: gtk_check_menu_item_
3937 nocode: gtk_check_menu_item_new_with_label
3938 nocode: gtk_check_menu_item_new_with_mnemonic
3942 * Creates a new GtkCheckMenuItem with a label.
3943 * If mnemonic it true the label
3944 * will be created using gtk_label_new_with_mnemonic(), so underscores
3945 * in label indicate the mnemonic for the menu item.
3947 * the string to use for the label.
3949 * a new GtkCheckMenuItem.
3951 public this (char[] label, bool mnemonic=true)
3955 // GtkWidget* gtk_check_menu_item_new_with_mnemonic (const gchar *label);
3956 this(cast(GtkCheckMenuItem*)gtk_check_menu_item_new_with_mnemonic(Str.toStringz(label)) );
3960 // GtkWidget* gtk_check_menu_item_new_with_label (const gchar *label);
3961 this(cast(GtkCheckMenuItem*)gtk_check_menu_item_new_with_label(Str.toStringz(label)) );
3966 outFile: CheckMenuItem
3968 file: GtkSeparatorMenuItem.html
3969 struct: GtkSeparatorMenuItem
3970 class: SeparatorMenuItem
3971 prefix: gtk_separator_menu_item_
3973 outFile: SeparatorMenuItem
3975 file: GtkTearoffMenuItem.html
3976 struct: GtkTearoffMenuItem
3977 class: TearoffMenuItem
3978 prefix: gtk_tearoff_menu_item_
3980 outFile: TearoffMenuItem
3982 file: GtkToolbar.html
3985 prefix: gtk_toolbar_
3990 import: gtk.ToolItem
3991 structWrap: GtkWidget* Widget
3992 nocode: gtk_toolbar_get_style
3996 * Retrieves whether the toolbar has text, icons, or both . See
3997 * gtk_toolbar_set_style().
4001 * the current style of toolbar
4003 public GtkToolbarStyle toolbarGetStyle()
4005 // GtkToolbarStyle gtk_toolbar_get_style (GtkToolbar *toolbar);
4006 return gtk_toolbar_get_style(gtkToolbar);
4009 public void insert (ToolItem toolItem, int pos=-1)
4011 gtk_toolbar_insert(gtkToolbar, toolItem.getToolItemStruct(), pos);
4014 public Widget insertStock(StockID stockId, char[] tooltipText, char[] tooltipPrivateText, GtkSignalFunc callback, void* userData, int position)
4016 return insertStock(getId(stockId), tooltipText, tooltipPrivateText, callback, userData, position);
4019 public Widget insertStock(char[] stockId, char[] tooltipText, char[] tooltipPrivateText, int position)
4021 return insertStock(stockId, tooltipText, tooltipPrivateText, null, null, position);
4024 public Widget insertStock(StockID stockId, char[] tooltipText, char[] tooltipPrivateText, int position)
4026 return insertStock(getId(stockId), tooltipText, tooltipPrivateText, null, null, position);
4029 Button insertButton(StockID stockID,
4030 char[] tooltipText, char[] tooltipPrivateText,
4033 Button button = new Button(
4034 cast(GtkButton*)gtk_toolbar_insert_stock(
4036 Str.toStringz(StockDesc[stockID]),
4037 Str.toStringz(tooltipText),
4038 Str.toStringz(tooltipPrivateText),
4048 file: GtkToolItem.html
4051 prefix: gtk_tool_item_
4054 import: gtk.Tooltips
4055 structWrap: GtkTooltips* Tooltips
4057 structWrap: GtkWidget* Widget
4061 * Sets this widget tooltip
4062 * @param tipText the tooltip
4063 * @param tipPrivate a private text
4065 void setTooltip(char[] tipText, char[] tipPrivate)
4067 Tooltips tt = new Tooltips();
4068 tt.setTip(this, tipText, tipPrivate);
4075 file: GtkSeparatorToolItem.html
4076 struct: GtkSeparatorToolItem
4077 ctorStruct: GtkToolItem
4078 class: SeparatorToolItem
4079 prefix: gtk_separator_tool_item_
4081 import: gtk.ToolItem
4082 structWrap: GtkToolItem* ToolItem
4083 outFile: SeparatorToolItem
4085 file: GtkToolButton.html
4086 struct: GtkToolButton
4087 ctorStruct: GtkToolItem
4089 prefix: gtk_tool_button_
4092 import: gtk.ToolItem
4093 #structWrap: GtkToolItem* ToolItem
4095 structWrap: GtkWidget* Widget
4098 /** An arbitrary string to be used by the application */
4099 private char[] action;
4101 public void setActionName(char[] action)
4103 this.action = action.dup;
4106 public char[] getActionName()
4111 public this (StockID stockID)
4113 this(StockDesc[stockID]);
4121 file: GtkMenuToolButton.html
4122 struct: GtkMenuToolButton
4123 ctorStruct: GtkToolItem
4124 class: MenuToolButton
4125 prefix: gtk_menu_tool_button_
4128 import: gtk.ToolItem
4129 structWrap: GtkToolItem* ToolItem
4131 structWrap: GtkWidget* Widget
4132 import: gtk.Tooltips
4133 structWrap: GtkTooltips* Tooltips
4137 nocode: gtk_menu_tool_button_new
4138 nocode: gtk_menu_tool_button_new_from_stock
4139 nocode: gtk_menu_tool_button_get_menu
4143 * Creates a new GtkMenuToolButton using icon_widget as icon and
4146 * a widget that will be used as icon widget, or NULL
4148 * a string that will be used as label, or NULL
4150 * the new GtkMenuToolButton
4153 public this(Widget iconWidget, char[] label)
4155 // GtkToolItem* gtk_menu_tool_button_new (GtkWidget *icon_widget, const gchar *label);
4156 this( cast(GtkMenuToolButton*)gtk_menu_tool_button_new(
4157 (iconWidget is null) ? null : iconWidget.getWidgetStruct(),
4158 Str.toStringz(label))
4163 * Creates a new GtkMenuToolButton.
4164 * The new GtkMenuToolButton will contain an icon and label from
4165 * the stock item indicated by stock_id.
4167 * the name of a stock item
4169 * the new GtkMenuToolButton
4172 public this(StockID stockId)
4174 // GtkToolItem* gtk_menu_tool_button_new_from_stock (const gchar *stock_id);
4176 cast(GtkMenuToolButton*)gtk_menu_tool_button_new_from_stock(
4177 Str.toStringz(StockDesc[stockId]))
4182 * Gets the GtkMenu associated with GtkMenuToolButton.
4184 * a GtkMenuToolButton
4186 * the GtkMenu associated with GtkMenuToolButton
4189 public Menu getMenu()
4191 // GtkWidget* gtk_menu_tool_button_get_menu (GtkMenuToolButton *button);
4192 return new Menu( cast(GtkMenu*)gtk_menu_tool_button_get_menu(gtkMenuToolButton) );
4196 * Sets the toolTip for the arrow
4201 public void setArrowTooltip(char[] tipText, char[] tipPrivate)
4203 Tooltips tooltips = new Tooltips();
4204 gtk_menu_tool_button_set_arrow_tooltip(
4206 (tooltips is null) ? null : tooltips.getTooltipsStruct(),
4207 Str.toStringz(tipText),
4208 Str.toStringz(tipPrivate)
4214 outFile: MenuToolButton
4216 file: GtkToggleToolButton.html
4217 struct: GtkToggleToolButton
4218 ctorStruct: GtkToolItem
4219 class: ToggleToolButton
4220 prefix: gtk_toggle_tool_button_
4223 import: gtk.ToolItem
4224 structWrap: GtkToolItem* ToolItem
4225 outFile: ToggleToolButton
4227 file: GtkRadioToolButton.html
4228 struct: GtkRadioToolButton
4229 ctorStruct: GtkToolItem
4230 class: RadioToolButton
4231 prefix: gtk_radio_tool_button_
4234 import: gtk.ToolItem
4235 structWrap: GtkToolItem* ToolItem
4237 structWrap: GSList* ListSG
4238 outFile: RadioToolButton
4240 ###########################################################
4241 ### Action-based menus and toolbars #######################
4242 ###########################################################
4244 file: GtkUIManager.html
4245 struct: GtkUIManager
4247 prefix: gtk_ui_manager_
4250 import: gtk.ActionGroup
4251 structWrap: GtkActionGroup* ActionGroup
4253 structWrap: GList* ListG
4254 import: gtk.AccelGroup
4255 structWrap: GtkAccelGroup* AccelGroup
4257 structWrap: GtkWidget* Widget
4259 structWrap: GSList* ListSG
4261 structWrap: GtkAction* Action
4264 file: GtkActionGroup.html
4265 struct: GtkActionGroup
4267 prefix: gtk_action_group_
4271 structWrap: GtkAction* Action
4273 structWrap: GList* ListG
4274 #import: gtk.ActionEntry
4275 #structWrap: GtkActionEntry* ActionEntry
4276 #import: gtk.ToggleActionEntry
4277 #structWrap: GtkToggleActionEntry* ToggleActionEntry
4278 #import: gtk.RadioActionEntry
4279 #structWrap: GtkRadioActionEntry* RadioActionEntry
4280 outFile: ActionGroup
4282 file: GtkAction.html
4289 structWrap: GtkWidget* Widget
4291 structWrap: GSList* ListSG
4292 import: gobject.Closure
4293 structWrap: GClosure* Closure
4294 import: gtk.AccelGroup
4295 structWrap: GtkAccelGroup* AccelGroup
4298 file: GtkToggleAction.html
4299 struct: GtkToggleAction
4301 prefix: gtk_toggle_action_
4304 outFile: ToggleAction
4306 file: GtkRadioAction.html
4307 struct: GtkRadioAction
4309 prefix: gtk_radio_action_
4313 structWrap: GSList* ListSG
4314 outFile: RadioAction
4316 ###########################################################
4317 ### Selectors (File/Font/Color/Input Devices) ############
4318 ###########################################################
4320 file: GtkColorButton.html
4321 struct: GtkColorButton
4323 prefix: gtk_color_button_
4327 structWrap: GdkColor* Color
4328 outFile: ColorButton
4330 file: GtkColorSelection.html
4331 struct: GtkColorSelection
4332 class: ColorSelection
4333 prefix: gtk_color_selection_
4337 structWrap: GdkColor* Color
4338 outFile: ColorSelection
4340 file: GtkColorSelectionDialog.html
4341 struct: GtkColorSelectionDialog
4342 class: ColorSelectionDialog
4343 prefix: gtk_color_selection_dialog_
4346 outFile: ColorSelectionDialog
4348 file: GtkFileSelection.html
4349 struct: GtkFileSelection
4350 class: FileSelection
4351 prefix: gtk_file_selection_
4354 outFile: FileSelection
4356 file: GtkFileChooser.html
4357 struct: GtkFileChooser
4359 prefix: gtk_file_chooser_
4363 structWrap: GtkWindow* Window
4365 structWrap: GSList* ListSG
4367 structWrap: GtkWidget* Widget
4368 import: gtk.FileFilter
4369 structWrap: GtkFileFilter* FileFilter
4370 outFile: FileChooser
4372 file: GtkFileChooserButton.html
4373 struct: GtkFileChooserButton
4374 class: FileChooserButton
4375 prefix: gtk_file_chooser_button_
4379 structWrap: GtkWidget* Widget
4380 import: glib.ListSG;
4382 import: gtk.FileFilter;
4383 import: gtk.FileChooser;
4387 private FileChooser fileChooser;
4389 public FileChooser getFileChooser()
4391 if ( fileChooser is null )
4393 fileChooser = new FileChooser(cast(GtkFileChooser*)getFileChooserButtonStruct());
4398 outFile: FileChooserButton
4400 file: GtkFileChooserDialog.html
4401 struct: GtkFileChooserDialog
4402 class: FileChooserDialog
4403 prefix: gtk_file_chooser_dialog_
4407 structWrap: GtkWindow* Window
4408 import: glib.ListSG;
4410 import: gtk.FileFilter;
4411 import: gtk.FileChooser;
4413 nocode: gtk_file_chooser_dialog_new
4414 nocode: gtk_file_chooser_dialog_new_with_backend
4418 private FileChooser fileChooser;
4420 public FileChooser getFileChooser()
4422 if ( fileChooser is null )
4424 fileChooser = new FileChooser(cast(GtkFileChooser*)getFileChooserDialogStruct());
4430 * Creates a new GtkFileChooserDialog. This function is analogous to
4431 * gtk_dialog_new_with_buttons().
4433 * Title of the dialog, or NULL
4435 * Transient parent of the dialog, or NULL
4437 * Open or save mode for the dialog
4438 * first_button_text:
4439 * stock ID or text to go in the first button, or NULL
4441 * response ID for the first button, then additional (button, id) pairs, ending with NULL
4443 * a new GtkFileChooserDialog
4446 this(char[] title, Window parent, FileChooserAction action, char[][] buttonsText=null, ResponseType[] responses=null)
4448 if ( buttonsText is null )
4450 buttonsText ~= "OK";
4451 buttonsText ~= "Cancel";
4453 if ( responses is null )
4455 responses ~= ResponseType.GTK_RESPONSE_OK;
4456 responses ~= ResponseType.GTK_RESPONSE_CANCEL;
4460 cast(GtkFileChooserDialog*)gtk_file_chooser_dialog_new(
4461 Str.toStringz(title),
4462 parent.getWindowStruct(),
4466 addButtons(buttonsText, responses);
4470 * Creates a new GtkFileChooserDialog with a specified backend. This is
4471 * especially useful if you use gtk_file_chooser_set_local_only() to allow
4472 * non-local files and you use a more expressive vfs, such as gnome-vfs,
4475 * Title of the dialog, or NULL
4477 * Transient parent of the dialog, or NULL
4479 * Open or save mode for the dialog
4481 * The name of the specific filesystem backend to use.
4482 * first_button_text:
4483 * stock ID or text to go in the first button, or NULL
4485 * response ID for the first button, then additional (button, id) pairs, ending with NULL
4487 * a new GtkFileChooserDialog
4490 * GtkFileChooser, GtkDialog
4492 public this (char[] title, Window parent, GtkFileChooserAction action, char[] backend, char[][] buttonsText=null, ResponseType[] responses=null)
4494 // GtkWidget* gtk_file_chooser_dialog_new_with_backend (const gchar *title, GtkWindow *parent, GtkFileChooserAction action, const gchar *backend, const gchar *first_button_text, ...);
4496 cast(GtkFileChooserDialog*)gtk_file_chooser_dialog_new_with_backend(
4497 Str.toStringz(title),
4498 parent.getWindowStruct(),
4500 Str.toStringz(backend),
4504 if ( buttonsText is null )
4506 buttonsText ~= "OK";
4507 buttonsText ~= "Cancel";
4509 if ( responses is null )
4511 responses ~= ResponseType.GTK_RESPONSE_OK;
4512 responses ~= ResponseType.GTK_RESPONSE_CANCEL;
4515 addButtons(buttonsText, responses);
4518 // this(char[] title, Window parent, FileChooserAction action, StockID[] buttons=null, ResponseType[] responses=null)
4520 // if ( buttons is null )
4522 // buttons ~= STOCK_OK;
4523 // buttons ~= STOCK_CANCEL;
4525 // if ( responses is null )
4527 // responses ~= ResponseType.GTK_RESPONSE_OK;
4528 // responses ~= ResponseType.GTK_RESPONSE_CANCEL;
4531 // this(gtk_file_chooser_dialog_new(
4532 // title.toStringz(),
4533 // parent.getWindowStruct(),
4537 // addButtons(buttons, responses);
4541 outFile: FileChooserDialog
4543 file: GtkFileChooserWidget.html
4544 struct: GtkFileChooserWidget
4545 class: FileChooserWidget
4546 prefix: gtk_file_chooser_widget_
4549 import: glib.ListSG;
4551 import: gtk.FileFilter;
4552 import: gtk.FileChooser;
4555 private FileChooser fileChooser;
4557 public FileChooser getFileChooser()
4559 if ( fileChooser is null )
4561 fileChooser = new FileChooser(cast(GtkFileChooser*)getFileChooserWidgetStruct());
4566 outFile: FileChooserWidget
4568 file: gtk-gtkfilefilter.html
4569 struct: GtkFileFilter
4571 prefix: gtk_file_filter_
4576 file: GtkFontButton.html
4577 struct: GtkFontButton
4579 prefix: gtk_font_button_
4584 file: GtkFontSelection.html
4585 struct: GtkFontSelection
4586 class: FontSelection
4587 prefix: gtk_font_selection_
4591 structWrap: GdkFont* Font
4592 outFile: FontSelection
4594 file: GtkFontSelectionDialog.html
4595 struct: GtkFontSelectionDialog
4596 class: FontSelectionDialog
4597 prefix: gtk_font_selection_dialog_
4601 structWrap: GdkFont* Font
4602 outFile: FontSelectionDialog
4604 file: GtkInputDialog.html
4605 struct: GtkInputDialog
4607 prefix: gtk_input_dialog_
4609 outFile: InputDialog
4611 ###########################################################
4612 ### Layout Containers #####################################
4613 ###########################################################
4615 file: GtkAlignment.html
4616 struct: GtkAlignment
4618 prefix: gtk_alignment_
4623 public static Alignment center(Widget widget)
4625 Alignment a = new Alignment(0.5, 0.5, 0, 0);
4630 public static Alignment north(Widget widget)
4632 Alignment a = new Alignment(0.5, 0.0, 0, 0);
4637 public static Alignment south(Widget widget)
4639 Alignment a = new Alignment(0.5, 1.0, 0, 0);
4644 public static Alignment east(Widget widget)
4646 Alignment a = new Alignment(1.0, 0.5, 0, 0);
4651 public static Alignment west(Widget widget)
4653 Alignment a = new Alignment(0.0, 0.5, 0, 0);
4658 public static Alignment northWest(Widget widget)
4660 Alignment a = new Alignment(0.0, 0.0, 0, 0);
4665 public static Alignment southWest(Widget widget)
4667 Alignment a = new Alignment(0.0, 0.5, 0, 0);
4672 public static Alignment northEast(Widget widget)
4674 Alignment a = new Alignment(1.0, 0.0, 0, 0);
4679 public static Alignment southEast(Widget widget)
4681 Alignment a = new Alignment(1.0, 1.0, 0, 0);
4689 file: GtkAspectFrame.html
4690 struct: GtkAspectFrame
4692 prefix: gtk_aspect_frame_
4695 outFile: AspectFrame
4711 file: GtkHButtonBox.html
4712 struct: GtkHButtonBox
4714 prefix: gtk_hbutton_box_
4718 * Creates a new HButtonBox and sets comon parameters
4720 static ButtonBox createActionBox()
4722 ButtonBox bBox = new HButtonBox();
4723 bBox.setLayout(ButtonBoxStyle.END);
4724 bBox.setBorderWidth(5);
4732 file: GtkVButtonBox.html
4733 struct: GtkVButtonBox
4735 prefix: gtk_vbutton_box_
4739 * Creates a new vertical button box and sets standart values for it's comon parameters
4740 * @return a new vertical button box
4742 static ButtonBox createActionBox()
4744 ButtonBox bBox = new VButtonBox();
4745 bBox.setLayout(ButtonBoxStyle.START);
4746 bBox.setBorderWidth(5);
4759 structWrap: GtkWidget* Widget
4762 file: GtkHPaned.html
4767 structWrap: GtkWidget* Widget
4772 * Creates a new HPaned and adds two widgets as it's children
4776 this(Widget child1, Widget child2)
4786 file: GtkVPaned.html
4795 * Creates a new HPaned and adds two widgets as it's children
4799 this(Widget child1, Widget child2)
4809 file: GtkLayout.html
4814 import: gtk.Adjustment
4815 structWrap: GtkAdjustment* Adjustment
4817 structWrap: GtkWidget* Widget
4820 file: GtkNotebook.html
4823 prefix: gtk_notebook_
4828 structWrap: GtkWidget* Widget
4830 /** The GtkNotebookTab is not documented */
4831 public enum GtkNotebookTab
4833 GTK_NOTEBOOK_TAB_FIRST,
4834 GTK_NOTEBOOK_TAB_LAST
4836 alias GtkNotebookTab NotebookTab;
4839 * Append a page with a widget and a text for a label
4841 public int appendPage(Widget child, char[] tabLabel)
4843 return appendPage(child, new Label(tabLabel));
4846 void setCurrentPage(Widget child)
4848 gtk_notebook_set_current_page(gtkNotebook,gtk_notebook_page_num(gtkNotebook, child.getWidgetStruct()));
4860 structWrap: GtkWidget* Widget
4864 nocode: gtk_table_new
4873 public AttachOptions defaultXOption = AttachOptions.SHRINK;
4874 public AttachOptions defaultYOption = AttachOptions.SHRINK;
4877 * Removes all children and resizes the table to 1,1
4886 * Used to create a new table widget. An initial size must be given by
4887 * specifying how many rows and columns the table should have, although
4888 * this can be changed later with gtk_table_resize(). rows and columns
4889 * must both be in the range 0 .. 65535.
4891 * The number of rows the new table should have.
4893 * The number of columns the new table should have.
4895 * If set to TRUE, all table cells are resized to the size of the cell
4896 * containing the largest widget.
4898 * A pointer to the the newly created table widget.
4900 public this (uint rows, uint columns, int homogeneous)
4902 // GtkWidget* gtk_table_new (guint rows, guint columns, gboolean homogeneous);
4903 this(cast(GtkTable*)gtk_table_new(rows, columns, homogeneous) );
4912 * Attach a new widget creating a new row if necessary
4914 void attach(Widget child)
4916 attach(child, col, col + 1, row, row + 1,
4917 defaultXOption, defaultYOption,
4918 getDefaultColSpacing(), getDefaultRowSpacing());
4931 file: GtkExpander.html
4934 prefix: gtk_expander_
4938 structWrap: GtkWidget* Widget
4940 nocode: gtk_expander_new
4941 nocode: gtk_expander_new_with_mnemonic
4945 * Creates a new expander using label as the text of the label.
4946 * If mnemonic os true
4947 * If characters in label are preceded by an underscore, they are underlined.
4948 * If you need a literal underscore character in a label, use '__' (two
4949 * underscores). The first underlined character represents a keyboard
4950 * accelerator called a mnemonic.
4952 * the text of the label
4954 * a new GtkExpander widget.
4957 public this (char[] label, bool mnemonic=true)
4961 // GtkWidget* gtk_expander_new_with_mnemonic (const gchar *label);
4962 this(cast(GtkExpander*)gtk_expander_new_with_mnemonic(Str.toStringz(label)) );
4966 // GtkWidget* gtk_expander_new (const gchar *label);
4967 this(cast(GtkExpander*)gtk_expander_new(Str.toStringz(label)) );
4974 ###########################################################
4975 ### Ornaments #############################################
4976 ###########################################################
4985 structWrap: GtkWidget* Widget
4988 * Creates frame with label and set it's child widget
4990 public this(Widget widget, char[] label)
4999 file: GtkHSeparator.html
5000 struct: GtkHSeparator
5002 prefix: gtk_hseparator_
5006 file: GtkVSeparator.html
5007 struct: GtkVSeparator
5009 prefix: gtk_vseparator_
5013 ###########################################################
5014 ### Scrolling #############################################
5015 ###########################################################
5017 file: GtkHScrollbar.html
5018 struct: GtkHScrollbar
5020 prefix: gtk_hscrollbar_
5022 import: gtk.Adjustment
5023 structWrap: GtkAdjustment* Adjustment
5026 file: GtkVScrollbar.html
5027 struct: GtkVScrollbar
5029 prefix: gtk_vscrollbar_
5031 import: gtk.Adjustment
5032 structWrap: GtkAdjustment* Adjustment
5035 file: GtkScrolledWindow.html
5036 struct: GtkScrolledWindow
5037 class: ScrolledWindow
5038 prefix: gtk_scrolled_window_
5041 structWrap: GtkWidget* Widget
5042 import: gtk.Adjustment
5043 structWrap: GtkAdjustment* Adjustment
5046 nocode: gtk_scrolled_window_new
5054 public this(Widget widget)
5057 addWithViewport(widget);
5061 * Creates a new scrolled window. The two arguments are the scrolled
5062 * window's adjustments; these will be shared with the scrollbars and the
5063 * child widget to keep the bars in sync with the child. Usually you want
5064 * to pass NULL for the adjustments, which will cause the scrolled window
5065 * to create them for you.
5067 * Horizontal adjustment.
5069 * Vertical adjustment.
5071 * New scrolled window.
5073 public this (Adjustment hadjustment, Adjustment vadjustment)
5075 // GtkWidget* gtk_scrolled_window_new (GtkAdjustment *hadjustment, GtkAdjustment *vadjustment);
5076 this(cast(GtkScrolledWindow*)gtk_scrolled_window_new(
5077 hadjustment is null ? null : hadjustment.getAdjustmentStruct(),
5078 vadjustment is null ? null : vadjustment.getAdjustmentStruct())
5083 * Creates a new Scrolled window and set the policy type
5084 * @param hPolicy the horizontal policy
5085 * @param vPolicy the vertical policy
5087 this(PolicyType hPolicy, PolicyType vPolicy)
5090 setPolicy(hPolicy, vPolicy);
5093 outFile: ScrolledWindow
5095 ###########################################################
5096 ### Miscellaneous #########################################
5097 ###########################################################
5099 file: GtkAdjustment.html
5100 struct: GtkAdjustment
5102 prefix: gtk_adjustment_
5104 import: gtk.ObjectGtk
5105 structWrap: GtkObject* ObjectGtk
5115 file: GtkCalendar.html
5118 prefix: gtk_calendar_
5122 file: GtkDrawingArea.html
5123 struct: GtkDrawingArea
5125 prefix: gtk_drawing_area_
5130 * Create a new DrawingArea and sets the SizeRequest
5136 this(int width, int height)
5139 setSizeRequest(width, height);
5144 outFile: DrawingArea
5146 file: GtkEventBox.html
5149 prefix: gtk_event_box_
5153 file: GtkHandleBox.html
5154 struct: GtkHandleBox
5156 prefix: gtk_handle_box_
5160 file: GtkIMContextSimple.html
5161 struct: GtkIMContextSimple
5162 class: IMContextSimple
5163 prefix: gtk_im_context_simple_
5165 import: gtk.IMContext
5166 structWrap: GtkIMContext* IMContext
5167 outFile: IMContextSimple
5169 file: GtkIMMulticontext.html
5170 struct: GtkIMMulticontext
5171 class: IMMulticontext
5172 prefix: gtk_im_multicontext_
5174 import: gtk.IMContext
5175 structWrap: GtkIMContext* IMContext
5176 import: gtk.MenuShell
5177 structWrap: GtkMenuShell* MenuShell
5178 outFile: IMMulticontext
5180 file: GtkSizeGroup.html
5181 struct: GtkSizeGroup
5183 prefix: gtk_size_group_
5186 structWrap: GtkWidget* Widget
5189 file: GtkTooltips.html
5192 prefix: gtk_tooltips_
5196 structWrap: GtkWidget* Widget
5197 #import: gtk.TooltipsData
5198 #structWrap: GtkTooltipsData* TooltipsData
5200 structWrap: GtkWindow* Window
5203 file: GtkViewport.html
5206 prefix: gtk_viewport_
5208 import: gtk.Adjustment
5209 structWrap: GtkAdjustment* Adjustment
5212 file: GtkAccessible.html
5213 struct: GtkAccessible
5215 prefix: gtk_accessible_
5219 ###########################################################
5220 ### Abstract Base Classes #################################
5221 ###########################################################
5229 structWrap: GtkWidget* Widget
5231 nocode: gtk_bin_get_child
5235 * Gets the child of the GtkBin, or NULL if the bin contains
5236 * no child widget. The returned widget does not have a reference
5237 * added, so you do not need to unref it.
5241 * pointer to child of the GtkBin
5243 public Widget getChild()
5245 // GtkWidget* gtk_bin_get_child (GtkBin *bin);
5246 GtkWidget * gtkWidget = gtk_bin_get_child(gtkBin);
5249 return new Widget(gtkWidget);
5264 structWrap: GtkWidget* Widget
5267 #import: gtk.PackType
5268 #structWrap: GtkPackType* PackType
5271 file: GtkButtonBox.html
5272 struct: GtkButtonBox
5274 prefix: gtk_button_box_
5277 structWrap: GtkWidget* Widget
5279 import: gtk.HButtonBox
5280 import: gtk.VButtonBox
5282 static ButtonBox createActionBox(
5283 void delegate(Button) onClicked,
5292 bBox = VButtonBox.createActionBox();
5296 bBox = HButtonBox.createActionBox();
5300 for( int i=0 ; i<stocks.length && i<actions.length ; i++)
5302 button = new Button(stocks[i]);
5303 bBox.packEnd(button, false, false, 7);
5304 button.setActionName(actions[i]);
5305 button.addOnClicked(onClicked);
5310 static ButtonBox createOkBox(void delegate(Button) onClicked)
5312 static StockID[] stocks = [StockID.OK];
5314 actions ~= "action.ok";
5315 return createActionBox(onClicked, stocks, actions);
5318 static ButtonBox createOkCancelBox(void delegate(Button) onClicked)
5320 static StockID[] stocks = [StockID.OK, StockID.CANCEL];
5322 actions ~= "action.ok";
5323 actions ~= "action.cancel";
5324 return createActionBox(onClicked, stocks, actions);
5329 file: GtkContainer.html
5330 struct: GtkContainer
5332 structWrap: GtkContainerClass* Container
5333 structWrap: GtkWidget* Widget
5335 import: gtk.Adjustment
5336 structWrap: GtkAdjustment* Adjustment
5337 prefix: gtk_container_
5340 structWrap: GList* ListG
5341 import: gobject.Value
5342 structWrap: GValue* Value
5343 #import: gdk.EventExpose
5344 #structWrap: GdkEventExpose* EventExpose
5345 #import: gobject.ParamSpec
5346 #structWrap: GParamSpec* ParamSpec
5347 #import: g.ObjectClass
5348 #structWrap: GObjectClass* ObjectClass
5353 * Removes all widgets from the container
5357 GList* gList = gtk_container_get_children(getContainerStruct());
5358 if ( gList !is null )
5360 ListG children = new ListG(gList);
5361 for ( int i=children.length()-1 ; i>=0 ; i-- )
5363 gtk_container_remove(getContainerStruct(), cast(GtkWidget*)children.nthData(i));
5385 file: GtkObject.html
5393 public static char[] getId(StockID id)
5395 return StockDesc[id];
5407 structWrap: GtkWidget* Widget
5411 public void add(Widget child1, Widget child2)
5425 import: gtk.Adjustment
5426 structWrap: GtkAdjustment* Adjustment
5436 file: GtkScrollbar.html
5437 struct: GtkScrollbar
5439 prefix: gtk_scrollbar_
5443 file: GtkSeparator.html
5444 struct: GtkSeparator
5446 prefix: gtk_separator
5450 file: GtkWidget.html
5454 import: atk.ObjectAtk
5455 structWrap: AtkObject* ObjectAtk
5458 # This function is exactly the same as calling g_object_ref(), and exists mostly for historical reasons.
5459 noprefix: gtk_widget_ref
5460 import: gdk.Rectangle
5461 structWrap: GdkRectangle* Rectangle
5462 #import: gtk.Requisition
5463 #structWrap: GtkRequisition* Requisition
5464 #import: gtk.Allocation
5465 #structWrap: GtkAllocation* Allocation
5466 import: gtk.AccelGroup
5467 structWrap: GtkAccelGroup* AccelGroup
5469 structWrap: GList* ListG
5471 structWrap: GdkEvent* Event
5473 structWrap: GdkWindow* Window
5474 import: gdk.Colormap
5475 structWrap: GdkColormap* Colormap
5477 structWrap: GdkVisual* Visual
5479 structWrap: GtkStyle* Style
5481 structWrap: GdkBitmap* Bitmap
5483 structWrap: GtkRcStyle* RcStyle
5485 structWrap: GdkColor* Color
5487 structWrap: GdkPixbuf* Pixbuf
5488 import: gtk.Adjustment
5489 structWrap: GtkAdjustment* Adjustment
5490 #import: gtk.WidgetClass
5491 #structWrap: GtkWidgetClass* WidgetClass
5492 #import: g.ParamSpec
5493 #structWrap: GParamSpec* ParamSpec
5495 structWrap: GdkRegion* Region
5496 import: gobject.Value
5497 structWrap: GValue* Value
5498 import: gtk.Settings
5499 structWrap: GtkSettings* Settings
5500 import: gtk.Clipboard
5501 structWrap: GtkClipboard* Clipboard
5503 structWrap: GdkDisplay* Display
5505 structWrap: GdkScreen* Screen
5509 import: pango.PgLayout
5510 structWrap: PangoLayout* PgLayout
5511 import: pango.PgContext
5512 structWrap: PangoContext* PgContext
5513 import: pango.PgFontDescription
5514 structWrap: PangoFontDescription* PgFontDescription
5515 import: gdk.Drawable
5516 import: gtk.Tooltips
5520 public int getWidth()
5523 gtk_widget_get_size_request(gtkWidget, &width, null);
5526 public int getHeight()
5529 gtk_widget_get_size_request(gtkWidget, null, &height);
5534 * Gets the drawable for this widget
5536 * The drawable for this widget
5538 Drawable getDrawable()
5541 // ubyte *p = cast(ubyte*)getStruct();
5543 // for ( int i=0 ; i<120 ; i+=4 )
5545 // printf("(%d) %X %x %x %x %x\n", i,p,*(p+0), *(p+1), *(p+2), *(p+3));
5549 // int* pt =cast(int*)getStruct();
5551 // printf("pt=%X strcut=%X\n", pt, getStruct());
5552 // printf("*pt=%X\n", *pt);
5554 // printf("pt+52=%X strcut.window=%X\n", pt, getWidgetStruct().window);
5555 // printf("*pt+52=%X\n", *pt);
5557 // //return new Drawable(cast(GdkDrawable*)(getWidgetStruct().window));
5558 int* pt =cast(int*)getStruct();
5560 return new Drawable(cast(GdkDrawable*)(*pt));
5563 * Gets the Window for this widget
5565 * The window for this widget
5570 // ubyte *p = cast(ubyte*)getStruct();
5572 // for ( int i=0 ; i<120 ; i+=4 )
5574 // printf("(%d) %X %x %x %x %x\n", i,p,*(p+0), *(p+1), *(p+2), *(p+3));
5578 // int* pt =cast(int*)getStruct();
5580 // printf("pt=%X strcut=%X\n", pt, getStruct());
5581 // printf("*pt=%X\n", *pt);
5583 // printf("pt+52=%X strcut.window=%X\n", pt, getWidgetStruct().window);
5584 // printf("*pt+52=%X\n", *pt);
5586 // //return new Drawable(cast(GdkDrawable*)(getWidgetStruct().window));
5587 int* pt =cast(int*)getStruct();
5589 return new Window(cast(GdkWindow*)(*pt));
5593 * @param cursor the new cursor
5594 * \bug the cursor changes to the parent widget also
5596 void setCursor(Cursor cursor)
5598 int* pt =cast(int*)getStruct();
5600 gdk_window_set_cursor(cast(GdkWindow*)(*pt), cursor.getCursorStruct());
5604 * Resets the cursor.
5605 * don't know if this is implemented by GTK+. Seems that it's not
5608 public void resetCursor()
5610 int* pt =cast(int*)getStruct();
5612 gdk_window_set_cursor(cast(GdkWindow*)(*pt), null);
5615 version(Tango)import tango.text.convert.Integer;
5618 * Modifies the font for this widget.
5619 * This just calls modifyFont(new PgFontDescription(PgFontDescription.fromString(family ~ " " ~ size)));
5621 public void modifyFont(char[] family, int size)
5623 if ( size < 0 ) size = -size; // hack to workaround leds bug - TO BE REMOVED
5629 new PgFontDescription(
5630 PgFontDescription.fromString(
5631 family ~ " " ~ itoa(s,size)
5639 new PgFontDescription(
5640 PgFontDescription.fromString(
5641 family ~ " " ~ std.string.toString(size)
5650 * Sets this widget tooltip
5651 * @param tipText the tooltip
5652 * @param tipPrivate a private text
5654 void setTooltip(char[] tipText, char[] tipPrivate)
5656 Tooltips tt = new Tooltips();
5657 tt.setTip(this, tipText, tipPrivate);
5666 file: GtkIMContext.html
5667 struct: GtkIMContext
5669 prefix: gtk_im_context_
5673 structWrap: GdkWindow* Window
5674 #import: gtk.EventKey
5675 #structWrap: GdkEventKey* EventKey
5676 import: gdk.Rectangle
5677 structWrap: GdkRectangle* Rectangle
5680 ###########################################################
5681 ### Cross-process Embedding ###############################
5682 ###########################################################
5690 structWrap: GdkDisplay* Display
5693 file: GtkSocket.html
5700 ###########################################################
5701 ### Special-purpose features ##############################
5702 ###########################################################
5711 file: GtkGammaCurve.html
5712 struct: GtkGammaCurve
5714 prefix: gtk_gamma_curve_
5725 file: GtkHRuler.html
5732 file: GtkVRuler.html
5739 ###########################################################
5740 ### Deprecated ############################################
5741 ###########################################################
5743 #file: GtkCList.html
5750 #file: GtkCTree.html
5757 #file: GtkCombo.html
5764 file: GtkItemFactory.html
5765 struct: GtkItemFactory
5767 prefix: gtk_item_factory_
5769 noprefix: gtk_item_factory_create_menu_entries
5771 import: gtk.AccelGroup
5772 structWrap: GtkAccelGroup* AccelGroup
5774 structWrap: GtkWidget* Widget
5775 import: gtk.ItemFactory
5776 structWrap: GtkItemFactory* ItemFactory
5777 #import: gtk.ItemFactoryEntry
5778 #structWrap: GtkItemFactoryEntry* ItemFactoryEntry
5779 outFile: ItemFactory
5788 #file: GtkListItem.html
5795 #file: GtkOldEditable.html
5802 #file: GtkOptionMenu.html
5809 #file: GtkPixmap.html
5816 #file: GtkPreview.html
5830 #file: gtkTipsQuery.html
5844 #file: GtkTreeItem.html
5851 file: GtkProgress.html
5854 prefix: gtk_progress_
5857 import: gtk.Adjustment
5858 structWrap: GtkAdjustment* Adjustment