2 # This file is part of duit.
4 # duit is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU Lesser General Public License as published by
6 # the Free Software Foundation; either version 2.1 of the License, or
7 # (at your option) any later version.
9 # duit is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public License
15 # along with duit; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 # Definitions for wrapping Gtk
28 # must start with wrap
33 public import glib.glibtypes;
34 public import gobject.gobjecttypes;
35 public import pango.pangotypes;
36 public import atk.atktypes;
37 public import gdkpixbuf.gdkpixbuftypes;
38 public import gdk.gdktypes;
39 alias void GtkAccelGroupEntry;
40 alias void GtkContainerClass;
42 //alias GTokenType.G_TOKEN_LAST G_TOKEN_LAST;";
43 //alias GtkSignalRunType.G_SIGNAL_RUN_FIRST G_SIGNAL_RUN_FIRST;
44 //alias GtkSignalRunType.G_SIGNAL_RUN_LAST G_SIGNAL_RUN_LAST;
45 //alias GtkSignalRunType.G_SIGNAL_NO_RECURSE G_SIGNAL_NO_RECURSE;
46 //alias GtkSignalRunType.G_SIGNAL_ACTION G_SIGNAL_ACTION;
47 //alias GtkSignalRunType.G_SIGNAL_NO_HOOKS G_SIGNAL_NO_HOOKS;
60 /* GtkTextIter is an opaque datatype; ignore all these fields.
61 * Initialize the iter with gtk_text_buffer_get_iter_*
100 ###########################################################
101 ### Core Reference ########################################
102 ###########################################################
105 file: gtk-General.html
113 noprefix: gtk_timeout_
115 #import: g.OptionEntry
116 #structWrap: GOptionEntry* OptionEntry
118 #structWrap: GError** Error*
119 #import: g.OptionGroup
120 #structWrap: GOptionGroup* OptionGroup
122 structWrap: GdkEvent* Event
124 structWrap: GtkWidget* Widget
125 import: gtk.ObjectGtk
126 structWrap: GtkObject* ObjectGtk
127 #import: gdk.ModifierType
128 #structWrap: GdkModifierType* ModifierType
134 import: gthread.Thread;
142 * Call this function before using any other GTK+ functions in your GUI applications.
144 public static void init(char[][] args)
146 char** argv = (new char*[args.length]).ptr;
148 foreach (char[] p; args)
150 argv[argc++] = cast(char*)p;
157 * This initiates Duit to supports multi threaded programs.
158 * read full documantation at http://gtk.org/faq/#AEN482
160 * "There is a single global lock that you must acquire with
161 * gdk_threads_enter() before making any GDK calls,
162 * and release with gdk_threads_leave() afterwards throughout your code."
163 * This is to be used on any call to GDK not executed from the main thread.
165 public static void initMultiThread(char[][] args)
179 /** Holds all timeout delegates */
180 bit delegate()[] timeoutListeners;
181 /** our gtk timeout ID */
186 * Creates a new timeout cycle.
188 * interval = the timeout in milieconds
189 * delegate() = the delegate to be executed
190 * fireNow = When true the delegate will be executed emmidiatly
193 this(uint interval, bit delegate() dlg, bit fireNow=false)
195 timeoutListeners ~= dlg;
196 timeoutID = gtk_timeout_add(interval, cast(GtkFunction)&timeoutCallback, this);
201 timeoutListeners.length = 0;
210 gtk_timeout_remove(timeoutID);
212 timeoutListeners.length = 0;
216 * Removes the timeout from gtk
225 * Adds a new delegate to this timeout cycle
230 public void addListener(bit delegate() dlg, bit fireNow=false)
232 timeoutListeners ~= dlg;
237 timeoutListeners.length = timeoutListeners.length - 1;
243 * The callback execution from glib
248 extern(C) static bit timeoutCallback(Timeout timeout)
250 return timeout.callAllListeners();
254 * Executes all delegates on the execution list
257 private bit callAllListeners()
259 bit runAgain = false;
263 while ( i<timeoutListeners.length )
265 if ( !timeoutListeners[i]() )
267 timeoutListeners = timeoutListeners[0..i] ~ timeoutListeners[i+1..timeoutListeners.length];
284 /** Holds all idle delegates */
285 bit delegate()[] idleListeners;
286 /** our gtk idle ID */
290 * Creates a new idle cycle.
292 * interval = the idle in milieconds
293 * delegate() = the delegate to be executed
294 * fireNow = When true the delegate will be executed emmidiatly
297 this(bit delegate() dlg, bit fireNow=false)
299 idleListeners ~= dlg;
300 idleID = gtk_idle_add(cast(GtkFunction)&idleCallback, this);
305 idleListeners.length = 0;
314 gtk_idle_remove(idleID);
316 idleListeners.length = 0;
320 * Removes the idle from gtk
329 * Adds a new delegate to this idle cycle
334 public void addListener(bit delegate() dlg, bit fireNow=false)
336 idleListeners ~= dlg;
341 idleListeners.length = idleListeners.length - 1;
347 * The callback execution from glib
352 extern(C) static bit idleCallback(Idle idle)
354 return idle.callAllListeners();
358 * Executes all delegates on the execution list
361 private bit callAllListeners()
363 bit runAgain = false;
367 while ( i<idleListeners.length )
369 if ( !idleListeners[i]() )
371 idleListeners = idleListeners[0..i] ~ idleListeners[i+1..idleListeners.length];
385 file: gtk-Keyboard-Accelerators.html
386 struct: GtkAccelGroup
388 prefix: gtk_accel_group_
391 import: gobject.Closure
392 structWrap: GClosure* Closure
393 #import: gtk.AccelGroupEntry
394 #structWrap: GtkAccelGroupEntry* AccelGroupEntry
395 import: gobject.ObjectG
396 structWrap: GObject* ObjectG
397 import: gtk.AccelGroup
398 structWrap: GtkAccelGroup* AccelGroup
400 structWrap: GSList* ListSG
401 #import: gtk.AccelKey
402 #structWrap: GtkAccelKey* AccelKey
403 #import: gdk.ModifierType
404 #structWrap: GdkModifierType* ModifierType
407 file: gtk-Accelerator-Maps.html
410 prefix: gtk_accel_map_
413 #import: gtk.AccelKey
414 #structWrap: GtkAccelKey* AccelKey
416 #structWrap: GScanner* Scanner
418 structWrap: GtkAccelMap* AccelMap
421 file: gtk-Clipboards.html
424 prefix: gtk_clipboard_
427 import: gtk.Clipboard
428 structWrap: GtkClipboard* Clipboard
430 structWrap: GdkDisplay* Display
431 #import: gtk.TargetEntry
432 #structWrap: GtkTargetEntry* TargetEntry
433 import: gobject.ObjectG
434 structWrap: GObject* ObjectG
436 structWrap: GdkPixbuf* Pixbuf
437 #import: gtk.SelectionData
438 #structWrap: GtkSelectionData* SelectionData
440 #structWrap: GdkAtom** Atom*
443 file: gtk-Drag-and-Drop.html
444 struct: GdkDragContext
450 structWrap: GtkWidget* Widget
451 #import: gtk.TargetEntry
452 #structWrap: GtkTargetEntry* TargetEntry
454 structWrap: GdkWindow* Window
455 import: gdk.DragContext
456 structWrap: GdkDragContext* DragContext
457 #import: gtk.TargetList
458 #structWrap: GtkTargetList* TargetList
460 structWrap: GdkEvent* Event
462 structWrap: GdkColormap* Colormap
464 structWrap: GdkPixmap* Pixmap
466 structWrap: GdkBitmap* Bitmap
468 structWrap: GdkPixbuf* Pixbuf
472 file: GtkIconTheme.html
476 prefix: gtk_icon_theme_
477 noprefix: gtk_icon_info_
480 import: gtk.IconTheme
481 structWrap: GtkIconTheme* IconTheme
483 structWrap: GdkScreen* Screen
485 structWrap: GtkIconInfo* IconInfo
487 structWrap: GdkPixbuf* Pixbuf
489 #structWrap: GError** Error*
491 structWrap: GList* ListG
496 prefix: gtk_icon_info_
500 structWrap: GtkIconInfo* IconInfo
502 structWrap: GdkPixbuf* Pixbuf
505 file: gtk-Stock-Items.html
511 import: gtk.StockItem
512 structWrap: GtkStockItem* StockItem
514 structWrap: GSList* ListSG
517 file: gtk-Themeable-Stock-Images.html
518 struct: GtkIconSource
523 #import: gtk.IconSource
524 #structWrap: GtkIconSource* IconSource
525 #import: gtk.IconFactory
526 #structWrap: GtkIconFactory* IconFactory
528 #structWrap: GtkIconSet* IconSet
530 structWrap: GdkPixbuf* Pixbuf
532 structWrap: GtkStyle* Style
534 structWrap: GtkWidget* Widget
536 structWrap: GtkSettings* Settings
539 file: gtk-Resource-Files.html
545 #structWrap: GScanner* Scanner
548 structWrap: GtkStyle* Style
550 structWrap: GtkWidget* Widget
552 structWrap: GtkSettings* Settings
554 structWrap: GdkColor* Color
555 #import: gtk.StateType
556 #structWrap: GtkStateType* StateType
557 #import: gtk.PathPriorityType
558 #structWrap: GtkPathPriorityType* PathPriorityType
560 structWrap: GtkRcStyle* RcStyle
563 file: GtkSettings.html
566 prefix: gtk_settings_
570 structWrap: GtkSettings* Settings
572 structWrap: GdkScreen* Screen
574 #structWrap: GParamSpec* ParamSpec
576 structWrap: GString* StringG
577 import: gobject.Value
578 structWrap: GValue* Value
579 #import: gtk.SettingsValue
580 #structWrap: GtkSettingsValue* SettingsValue
583 file: gtk-Bindings.html
584 struct: GtkBindingSet
586 prefix: gtk_binding_set_
587 prefix: gtk_bindings_
590 import: gtk.BindingSet
591 structWrap: GtkBindingSet* BindingSet
592 import: gtk.ObjectGtk
593 structWrap: GtkObject* ObjectGtk
594 #import: gdk.EventKey
595 #structWrap: GdkEventKey* EventKey
597 structWrap: GSList* ListSG
600 #structWrap: GScanner* Scanner
603 file: gtk-Standard-Enumerations.html
605 class: StandardEnumerations
608 outFile: StandardEnumerations
610 file: gtk-Graphics-Contexts.html
616 structWrap: GdkGC* GC
618 structWrap: GdkColormap* Colormap
619 #import: gdk.GCValues
620 #structWrap: GdkGCValues* GCValues
630 structWrap: GtkStyle* Style
632 structWrap: GdkWindow* Window
633 import: gdk.Rectangle
634 structWrap: GdkRectangle* Rectangle
636 #structWrap: GtkIconSet* IconSet
638 structWrap: GdkPixbuf* Pixbuf
639 import: gtk.IconSource
640 structWrap: GtkIconSource* IconSource
642 structWrap: GtkWidget* Widget
644 structWrap: GdkFont* Font
646 #structWrap: GdkPoint* Point
648 structWrap: GdkDrawable* Drawable
650 #structWrap: GtkBorder* Border
653 file: gtk-Selections.html
658 #import: gtk.TargetList
659 #structWrap: GtkTargetList* TargetList
660 #import: gtk.TargetEntry
661 #structWrap: GtkTargetEntry* TargetEntry
663 structWrap: GtkWidget* Widget
665 structWrap: GdkDisplay* Display
666 #import: gtk.SelectionData
667 #structWrap: GtkSelectionData* SelectionData
669 structWrap: GdkPixbuf* Pixbuf
673 file: gtk-Feature-Test-Macros.html
680 file: gtk-Signals.html
687 #structWrap: GtkType* Type
688 import: gtk.ObjectGtk
689 structWrap: GtkObject* ObjectGtk
691 #structWrap: GtkArg* Arg
701 #import: gtk.TypeInfo
702 #structWrap: GtkTypeInfo* TypeInfo
703 #import: gtk.EnumValue
704 #structWrap: GtkEnumValue* EnumValue
705 #import: gtk.FlagValue
706 #structWrap: GtkFlagValue* FlagValue
709 ###########################################################
710 ### Windows ###############################################
711 ###########################################################
720 structWrap: GtkWindow* Window
722 structWrap: GtkWidget* Widget
724 structWrap: GdkScreen* Screen
728 public Widget addButton(StockID stockID, int responseId)
730 return addButton(StockDesc[stockID], responseId);
734 public void addButtons(char[][] buttonsText, ResponseType[] responses)
736 for ( int i=0 ; i<buttonsText.length && i<responses.length ; i++)
738 addButton(buttonsText[i], responses[i]);
742 public void addButtons(StockID[] stockIDs, ResponseType[] responses)
744 for ( int i=0 ; i<stockIDs.length && i<responses.length ; i++)
746 addButton(stockIDs[i], responses[i]);
753 file: GtkInvisible.html
756 prefix: gtk_invisible_
759 structWrap: GdkScreen* Screen
762 file: GtkMessageDialog.html
763 struct: GtkMessageDialog
765 prefix: gtk_message_dialog_
769 structWrap: GtkWindow* Window
771 nocode: gtk_message_dialog_new
772 nocode: gtk_message_dialog_new_with_markup
776 * Creates a new message dialog, which is a simple dialog with an icon
777 * indicating the dialog type (error, warning, etc.) and some text the
778 * user may want to see. When the user clicks a button a "response"
779 * signal is emitted with response IDs from GtkResponseType. See
780 * GtkDialog for more details.
782 * transient parent, or NULL for none
788 * set of buttons to use
790 * printf()-style format string, or NULL
792 * the message - should be null, any formatting should be done prior to call this constructor
793 * arguments for message_format
795 * a new GtkMessageDialog
797 public this (Window parent, GtkDialogFlags flags, GtkMessageType type, GtkButtonsType buttons, char[] messageFormat, char[] message=null )
799 this(parent, flags, type, buttons, false, messageFormat, message );
803 * Creates a new message dialog, which is a simple dialog with an icon
804 * indicating the dialog type (error, warning, etc.) and some text which
805 * is marked up with the Pango text markup language.
806 * When the user clicks a button a "response" signal is emitted with
807 * response IDs from GtkResponseType. See GtkDialog for more details.
809 * If Markup is true special XML characters in the printf() arguments passed to this
810 * function will automatically be escaped as necessary.
811 * (See g_markup_printf_escaped() for how this is implemented.)
812 * Usually this is what you want, but if you have an existing
813 * Pango markup string that you want to use literally as the
814 * label, then you need to use gtk_message_dialog_set_markup()
815 * instead, since you can't pass the markup string either
816 * as the format (it might contain '%' characters) or as a string
819 * dialog = gtk_message_dialog_new (main_application_window,
820 * GTK_DIALOG_DESTROY_WITH_PARENT,
824 * gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG (dialog),
827 * transient parent, or NULL for none
833 * set of buttons to use
835 * printf()-style format string, or NULL
837 * the message - should be null, any formatting should be done prior to call this constructor
839 * arguments for message_format
841 * a new GtkMessageDialog
844 public this (Window parent, GtkDialogFlags flags, GtkMessageType type, GtkButtonsType buttons, bit markup, char[] messageFormat, char[] message=null )
848 // GtkWidget* gtk_message_dialog_new_with_markup (GtkWindow *parent, GtkDialogFlags flags, GtkMessageType type, GtkButtonsType buttons, const gchar *message_format, ...);
850 cast(GtkMessageDialog*)gtk_message_dialog_new_with_markup(
851 parent is null ? null : parent.getWindowStruct(),
855 Str.toStringz(messageFormat),
856 Str.toStringz(message), // this should be null
863 // GtkWidget* gtk_message_dialog_new (GtkWindow *parent, GtkDialogFlags flags, GtkMessageType type, GtkButtonsType buttons, const gchar *message_format, ...);
865 cast(GtkMessageDialog*)gtk_message_dialog_new(
866 parent is null ? null : parent.getWindowStruct(),
870 Str.toStringz(messageFormat),
871 Str.toStringz(message), // this should be null
880 outFile: MessageDialog
885 import: gtk.MessageDialog;
892 * Create an information popup dialog.
893 * @param message The message to show on the dialog
894 * @param title The title of the dialog
896 public static void information(char[] message, char[] title)
898 information(null, message, title);
902 * Create an information popup dialog.
903 * @param parent The parent window of this popup dialog
904 * @param message The message to show on the dialog
905 * @param title The title of the dialog
907 public static void information(Window parent, char[] message, char[] title)
909 MessageDialog d = new MessageDialog(parent, cast(GtkDialogFlags)0,
914 //d.addButton("gtk-dialog-info",GtkResponseType.GTK_RESPONSE_OK);
921 * Create an error popup dialog.
922 * @param message The message to show on the dialog
923 * @param title The title of the dialog
925 public static void error(char[] message, char[] title)
927 error(null, message, title);
931 * Create an error popup dialog.
932 * @param parent The parent window of this popup dialog
933 * @param message The message to show on the dialog
934 * @param title The title of the dialog
936 public static void error(Window parent, char[] message, char[] title)
938 MessageDialog d = new MessageDialog(parent, cast(GtkDialogFlags)0,
943 //d.addButton("gtk-dialog-error",ResponseType.GTK_RESPONSE_CANCEL);
951 * Create an 'yes' or 'no' popup dialog.
952 * @param message The message to show on the dialog
953 * @param title The title of the dialog
955 public static bool yesNo(char[] message, char[] title)
957 return yesNo(null, message, title);
961 * Create an 'yes' or 'no' popup dialog.
962 * @param parent The parent window of this popup dialog
963 * @param message The message to show on the dialog
964 * @param title The title of the dialog
966 public static bool yesNo(Window parent, char[] message, char[] title)
968 MessageDialog d = new MessageDialog(
969 parent, cast(GtkDialogFlags)0,
970 MessageType.QUESTION,
974 d.addButton("gtk-no",ResponseType.GTK_RESPONSE_NO);
975 d.addButton("gtk-yes",ResponseType.GTK_RESPONSE_YES);
976 int responce = d.run();
978 return responce == ResponseType.GTK_RESPONSE_YES;
983 * Create an 'yes', 'no' or 'cancel' popup dialog.
984 * @param message The message to show on the dialog
985 * @param title The title of the dialog
987 public static ResponseType yesNoCancel(char[] message, char[] title)
989 return yesNoCancel(null, message, title);
993 * Create an 'yes', 'no' or 'cancel' popup dialog.
994 * @param parent The parent window of this popup dialog
995 * @param message The message to show on the dialog
996 * @param title The title of the dialog
998 public static ResponseType yesNoCancel(Window parent, char[] message, char[] title)
1000 MessageDialog d = new MessageDialog(
1001 parent, cast(GtkDialogFlags)0,
1002 MessageType.QUESTION,
1006 d.addButton("gtk-no",ResponseType.GTK_RESPONSE_NO);
1007 d.addButton("gtk-yes",ResponseType.GTK_RESPONSE_YES);
1008 d.addButton("gtk-cancel",ResponseType.GTK_RESPONSE_CANCEL);
1009 ResponseType responce = cast(ResponseType)d.run();
1016 file: GtkWindow.html
1022 import: gtk.AccelGroup
1023 structWrap: GtkAccelGroup* AccelGroup
1025 structWrap: GtkWidget* Widget
1026 #import: gdk.Geometry
1027 #structWrap: GdkGeometry* Geometry
1029 structWrap: GtkWindow* Window
1031 structWrap: GdkScreen* Screen
1033 structWrap: GList* ListG
1034 #import: gdk.EventKey
1035 #structWrap: GdkEventKey* EventKey
1037 structWrap: GdkPixbuf* Pixbuf
1042 * Creates a top level window with a title
1044 * title: The Window title
1046 public this(char[] title)
1048 this(GtkWindowType.TOPLEVEL);
1053 * Move the window to an absolute position.
1054 * just calls move(int, int).
1055 * convinience because GdkEvent structs return the position coords as doubles
1057 public void move(double x, double y)
1059 move(cast(int)x, cast(int)y);
1077 * A top Level window that will stop the main event cycle when it's closed.
1078 * Closing the last of the windows of class "MainWindow" will end the application.
1080 public class MainWindow : Window
1083 private static int countTotalMainWindows = 0;
1086 * Creates a new MainWindow with a title
1088 public this(char[] title)
1091 countTotalMainWindows++;
1092 //printf("MainWindows.this count = %d\n", countTotalMainWindows);
1093 addOnDelete(&windowDelete);
1097 * Executed when the user tries to close the window
1098 * @return true to refuse to close the window
1100 protected int windowDelete(Event event, Widget widget)
1102 --countTotalMainWindows;
1103 //printf("MainWindows.windowDelete count = %d\n", countTotalMainWindows);
1104 if ( exit(0, false) || countTotalMainWindows==0 )
1113 * Allows the application to close and decide if it can exit
1114 * @param code the code reason to exit
1115 * @param force if true the application must expect to be closed even against it's will
1116 * @return false to refuse to exit
1118 protected bit exit(int code, bit force)
1127 file: GtkWindowGroup.html
1128 struct: GtkWindowGroup
1130 prefix: gtk_window_group_
1133 structWrap: GtkWindow* Window
1134 outFile: WindowGroup
1136 file: GtkAboutDialog.html
1137 struct: GtkAboutDialog
1139 prefix: gtk_about_dialog_
1143 structWrap: GdkPixbuf* Pixbuf
1145 structWrap: GtkWindow* Window
1146 outFile: AboutDialog
1148 file: GtkAssistant.html
1149 struct: GtkAssistant
1151 prefix: gtk_assistant_
1155 structWrap: GdkPixbuf* Pixbuf
1157 structWrap: GtkWidget* Widget
1162 ###########################################################
1163 ### Display Widgets #######################################
1164 ###########################################################
1166 file: GtkAccelLabel.html
1167 struct: GtkAccelLabel
1169 prefix: gtk_accel_label_
1172 import: gobject.Closure
1173 structWrap: GClosure* Closure
1175 structWrap: GtkWidget* Widget
1184 #import: gtk.IconSet*
1185 #structWrap: GtkIconSet** IconSet*
1186 #import: gtk.IconSize
1187 #structWrap: GtkIconSize* IconSize
1188 #import: gdk.ImageGdk*
1189 #structWrap: GdkImage** ImageGdk*
1190 #import: gdk.Bitmap*
1191 #structWrap: GdkBitmap** Bitmap*
1193 structWrap: GdkPixbuf* Pixbuf
1194 #import: gdk.Pixmap*
1195 #structWrap: GdkPixmap** Pixmap*
1196 #import: gdk.PixbufAnimation
1197 #structWrap: GdkPixbufAnimation* PixbufAnimation
1198 #import: gtk.IconSet
1199 #structWrap: GtkIconSet* IconSet
1200 import: gdk.ImageGdk
1201 structWrap: GdkImage* ImageGdk
1203 structWrap: GdkBitmap* Bitmap
1205 structWrap: GdkPixmap* Pixmap
1207 nocode: gtk_image_new_from_stock
1208 nocode: gtk_image_new_from_icon_name
1211 // this will be an enum
1213 * Creates a GtkImage displaying a stock icon. Sample stock icon
1214 * names are GTK_STOCK_OPEN, GTK_STOCK_EXIT. Sample stock sizes
1215 * are GTK_ICON_SIZE_MENU, GTK_ICON_SIZE_SMALL_TOOLBAR. If the stock
1216 * icon name isn't known, the image will be empty.
1217 * You can register your own stock icon names, see
1218 * gtk_icon_factory_add_default() and gtk_icon_factory_add().
1224 * a new GtkImage displaying the stock icon
1226 public this (StockID stockID, GtkIconSize size)
1228 // GtkWidget* gtk_image_new_from_stock (const gchar *stock_id, GtkIconSize size);
1229 this(cast(GtkImage*)gtk_image_new_from_stock(StockDesc[stockID].ptr, size) );
1233 * Creates a GtkImage displaying an icon from the current icon theme.
1234 * If the icon name isn't known, a "broken image" icon will be
1235 * displayed instead. If the current icon theme is changed, the icon
1236 * will be updated appropriately.
1242 * a new GtkImage displaying the themed icon
1245 public this (char[] iconName, GtkIconSize size)
1247 // GtkWidget* gtk_image_new_from_icon_name (const gchar *icon_name, GtkIconSize size);
1248 this(cast(GtkImage*)gtk_image_new_from_icon_name(Str.toStringz(iconName), size) );
1262 structWrap: GtkWidget* Widget
1263 nocode: gtk_label_new
1264 nocode: gtk_label_new_with_mnemonic
1267 * Creates a new GtkLabel, containing the text in str.
1268 * If characters in str are preceded by an underscore, they are
1269 * underlined. If you need a literal underscore character in a label, use
1270 * '__' (two underscores). The first underlined character represents a
1271 * keyboard accelerator called a mnemonic. The mnemonic key can be used
1272 * to activate another widget, chosen automatically, or explicitly using
1273 * gtk_label_set_mnemonic_widget().
1274 * If gtk_label_set_mnemonic_widget()
1275 * is not called, then the first activatable ancestor of the GtkLabel
1276 * will be chosen as the mnemonic widget. For instance, if the
1277 * label is inside a button or menu item, the button or menu item will
1278 * automatically become the mnemonic widget and be activated by
1281 * The text of the label, with an underscore in front of the
1282 * mnemonic character
1283 * mnemonic: when false uses the literal text passed in without mnemonic
1287 public this (char[] str, bit mnemonic=true)
1291 // GtkWidget* gtk_label_new_with_mnemonic (const gchar *str);
1292 this(cast(GtkLabel*)gtk_label_new_with_mnemonic(Str.toStringz(str)) );
1296 // GtkWidget* gtk_label_new (const gchar *str);
1297 this(cast(GtkLabel*)gtk_label_new(Str.toStringz(str)) );
1303 file: GtkProgressBar.html
1304 struct: GtkProgressBar
1306 prefix: gtk_progress_bar_
1309 import: gtk.Adjustment
1310 structWrap: GtkAdjustment* Adjustment
1311 outFile: ProgressBar
1313 file: GtkStatusbar.html
1314 struct: GtkStatusbar
1317 prefix: gtk_statusbar_
1321 ###########################################################
1322 ### Buttons and Toggles ###################################
1323 ###########################################################
1325 file: GtkButton.html
1332 structWrap: GtkWidget* Widget
1334 import: gtk.gtktypes
1337 nocode: gtk_button_new_with_mnemonic
1338 nocode: gtk_button_new_with_label
1339 nocode: gtk_button_new_from_stock
1344 private static IconSize currentIconSize = IconSize.BUTTON;
1346 /** An arbitrary string to be used by the application */
1347 private char[] action;
1349 public static void setIconSize(IconSize iconSize)
1351 currentIconSize = iconSize;
1353 public static IconSize getIconSize()
1355 return currentIconSize;
1358 public void setActionName(char[] action)
1360 this.action = action.dup;
1363 public char[] getActionName()
1369 * Creates a new GtkButton containing a label.
1370 * If characters in label are preceded by an underscore, they are underlined.
1371 * If you need a literal underscore character in a label, use '__' (two
1372 * underscores). The first underlined character represents a keyboard
1373 * accelerator called a mnemonic.
1374 * Pressing Alt and that key activates the button.
1376 * The text of the button, with an underscore in front of the
1377 * mnemonic character
1381 public this (char[] label, bit mnemonic=true)
1385 // GtkWidget* gtk_button_new_with_mnemonic (const gchar *label);
1386 this(cast(GtkButton*)gtk_button_new_with_mnemonic(Str.toStringz(label)) );
1390 // GtkWidget* gtk_button_new_with_label (const gchar *label);
1391 this(cast(GtkButton*)gtk_button_new_with_label(Str.toStringz(label)) );
1396 * Creates a new GtkButton containing the image and text from a stock item.
1397 * Some stock ids have preprocessor macros like GTK_STOCK_OK and
1399 * If stock_id is unknown, then it will be treated as a mnemonic
1400 * label (as for gtk_button_new_with_mnemonic()).
1402 * the name of the stock item
1406 public this (StockID stockID, bool hideLabel=false)
1408 // GtkWidget* gtk_button_new_from_stock (const gchar *stock_id);
1412 Image image = new Image(stockID,currentIconSize);
1417 this(cast(GtkButton*)gtk_button_new_from_stock(StockDesc[stockID].ptr) );
1422 public this(StockID stockID, void delegate(Button) dlg, bool hideLabel=false)
1424 this(stockID, hideLabel);
1429 public this(char[] label, void delegate(Button) dlg, bit mnemonic=true)
1431 this(label, mnemonic);
1435 public this(char[] label, void delegate(Button) dlg, char[] action)
1438 setActionName(action);
1446 file: GtkCheckButton.html
1447 struct: GtkCheckButton
1452 prefix: gtk_check_button_
1455 nocode: gtk_check_button_new_with_label
1456 nocode: gtk_check_button_new_with_mnemonic
1460 * Creates a new GtkCheckButton with a GtkLabel to the right of it.
1461 * If mnemonic is true the label
1462 * will be created using gtk_label_new_with_mnemonic(), so underscores
1463 * in label indicate the mnemonic for the check button.
1465 * The text of the button, with an underscore in front of the
1466 * mnemonic character
1468 * the text for the check button.
1472 public this (char[] label, bool mnemonic=true)
1476 // GtkWidget* gtk_check_button_new_with_mnemonic (const gchar *label);
1477 this(cast(GtkCheckButton*)gtk_check_button_new_with_mnemonic(Str.toStringz(label)) );
1481 // GtkWidget* gtk_check_button_new_with_label (const gchar *label);
1482 this(cast(GtkCheckButton*)gtk_check_button_new_with_label(Str.toStringz(label)) );
1486 public this(char[] label, void delegate(CheckButton) onClicked, bool mnemonic=true)
1488 this(label, mnemonic);
1489 addOnClicked(cast(void delegate(Button))onClicked);
1494 outFile: CheckButton
1496 file: GtkRadioButton.html
1497 struct: GtkRadioButton
1499 prefix: gtk_radio_button_
1503 structWrap: GSList* ListSG
1505 nocode: gtk_radio_button_new_with_label
1506 nocode: gtk_radio_button_new_with_mnemonic
1507 nocode: gtk_radio_button_new_with_label_from_widget
1508 nocode: gtk_radio_button_new_with_mnemonic_from_widget
1512 * Creates a new GtkRadioButton with a text label.
1513 * If mnemonic if true the label will be created using
1514 * gtk_label_new_with_mnemonic(), so underscores in label indicate the
1515 * mnemonic for the button.
1516 * an existing radio button group, or NULL if you are creating a new
1519 * the text label to display next to the radio button.
1521 * a new radio button.
1523 public this (ListSG group, char[] label, bit mnemonic=true)
1527 // GtkWidget* gtk_radio_button_new_with_mnemonic (GSList *group, const gchar *label);
1528 this(cast(GtkRadioButton*)gtk_radio_button_new_with_mnemonic(
1529 group is null ? null : group.getListSGStruct(),
1530 Str.toStringz(label))
1535 // GtkWidget* gtk_radio_button_new_with_label (GSList *group, const gchar *label);
1536 this(cast(GtkRadioButton*)gtk_radio_button_new_with_label(
1537 group is null ? null : group.getListSGStruct(),
1538 Str.toStringz(label))
1544 * Creates a new GtkRadioButton with a text label, adding it to the same group
1546 * It mnemonic it true the label
1547 * will be created using gtk_label_new_with_mnemonic(), so underscores
1548 * in label indicate the mnemonic for the button.
1550 * an existing GtkRadioButton.
1552 * a text string to display next to the radio button.
1554 * a new radio button.
1556 public this (RadioButton radioButton, char[] label, bit mnemonic=true)
1560 // GtkWidget* gtk_radio_button_new_with_mnemonic_from_widget (GtkRadioButton *group, const gchar *label);
1561 this(cast(GtkRadioButton*)gtk_radio_button_new_with_mnemonic_from_widget(
1562 radioButton.getRadioButtonStruct(),
1563 Str.toStringz(label))
1568 // GtkWidget* gtk_radio_button_new_with_label_from_widget (GtkRadioButton *group, const gchar *label);
1569 this(cast(GtkRadioButton*)gtk_radio_button_new_with_label_from_widget(
1570 radioButton.getRadioButtonStruct(),
1571 Str.toStringz(label))
1576 outFile: RadioButton
1578 file: GtkToggleButton.html
1579 struct: GtkToggleButton
1581 prefix: gtk_toggle_button_
1585 nocode: gtk_toggle_button_new_with_label
1586 nocode: gtk_toggle_button_new_with_mnemonic
1590 * Creates a new toggle button with a text label.
1591 * If mnemonic is true the label
1592 * will be created using gtk_label_new_with_mnemonic(), so underscores
1593 * in label indicate the mnemonic for the button.
1595 * a string containing the message to be placed in the toggle button.
1597 * a new toggle button.
1599 public this (char[] label, bit mnemonic=true)
1603 // GtkWidget* gtk_toggle_button_new_with_mnemonic (const gchar *label);
1604 this(cast(GtkToggleButton*)gtk_toggle_button_new_with_mnemonic(Str.toStringz(label)) );
1608 // GtkWidget* gtk_toggle_button_new_with_label (const gchar *label);
1609 this(cast(GtkToggleButton*)gtk_toggle_button_new_with_label(Str.toStringz(label)) );
1614 outFile: ToggleButton
1616 ###########################################################
1617 ### numeric/text Data Entry ###############################
1618 ###########################################################
1626 import: gtk.EntryCompletion
1627 structWrap: GtkEntryCompletion* EntryCompletion
1630 public this (char[] text)
1636 public this (char[] text, int max)
1645 file: GtkEntryCompletion.html
1646 struct: GtkEntryCompletion
1647 class: EntryCompletion
1648 prefix: gtk_entry_completion_
1652 structWrap: GtkWidget* Widget
1653 import: gtk.TreeModel
1654 structWrap: GtkTreeModel* TreeModel
1655 outFile: EntryCompletion
1657 file: GtkHScale.html
1662 import: gtk.Adjustment
1663 structWrap: GtkAdjustment* Adjustment
1666 file: GtkVScale.html
1671 import: gtk.Adjustment
1672 structWrap: GtkAdjustment* Adjustment
1675 file: GtkSpinButton.html
1676 struct: GtkSpinButton
1678 prefix: gtk_spin_button_
1681 structWrap: GtkWidget* Widget
1682 import: gtk.Adjustment
1683 structWrap: GtkAdjustment* Adjustment
1686 file: GtkEditable.html
1689 prefix: gtk_editable_
1694 ###########################################################
1695 ### Multiline Text Editor #################################
1696 ###########################################################
1698 file: gtk-GtkTextIter.html
1701 nostruct: GtkTextIter
1702 prefix: gtk_text_iter_
1705 import: gtk.TextBuffer
1706 structWrap: GtkTextBuffer* TextBuffer
1707 import: gtk.TextIter
1708 structWrap: GtkTextIter* TextIter
1710 structWrap: GdkPixbuf* Pixbuf
1712 structWrap: GSList* ListSG
1713 #import: gtk.TextChildAnchor
1714 #structWrap: GtkTextChildAnchor* TextChildAnchor
1716 structWrap: GtkTextTag* TextTag
1717 import: gtk.TextAttributes
1718 structWrap: GtkTextAttributes* TextAttributes
1719 import: gtk.TextChildAnchor
1720 structWrap: GtkTextChildAnchor* TextChildAnchor
1725 this(new GtkTextIter);
1731 file: GtkTextMark.html
1734 prefix: gtk_text_mark_
1737 import: gtk.TextBuffer
1738 structWrap: GtkTextBuffer* TextBuffer
1741 file: GtkTextBuffer.html
1742 struct: GtkTextBuffer
1744 prefix: gtk_text_buffer_
1747 import: gtk.TextBuffer
1748 structWrap: GtkTextBuffer* TextBuffer
1749 #import: gtk.TextMark
1750 #structWrap: GtkTextMark* TextMark
1751 #import: gtk.TextIter
1752 #structWrap: GtkTextIter* TextIter
1753 import: gdk.Rectangle
1754 structWrap: GdkRectangle* Rectangle
1756 structWrap: GtkWidget* Widget
1757 import: pango.PgTabArray
1758 structWrap: PangoTabArray* PgTabArray
1759 import: gtk.TextAttributes
1760 structWrap: GtkTextAttributes* TextAttributes
1761 import: gtk.TextTagTable
1762 structWrap: GtkTextTagTable* TextTagTable
1763 import: gtk.TextIter
1764 structWrap: GtkTextIter* TextIter
1766 structWrap: GtkTextTag* TextTag
1768 structWrap: GdkPixbuf* Pixbuf
1769 import: gtk.TextChildAnchor
1770 structWrap: GtkTextChildAnchor* TextChildAnchor
1771 import: gtk.TextMark
1772 structWrap: GtkTextMark* TextMark
1773 import: gtk.Clipboard
1774 structWrap: GtkClipboard* Clipboard
1776 structWrap: GdkBitmap* Bitmap
1781 nocode: gtk_text_buffer_set_text
1782 nocode: gtk_text_buffer_insert_with_tags
1783 nocode: gtk_text_buffer_insert_with_tags_by_name
1784 nocode: gtk_text_buffer_create_tag
1789 * Deletes current contents of buffer, and inserts text instead. If
1790 * len is -1, text must be nul-terminated. text must be valid UTF-8.
1794 * UTF-8 text to insert
1796 * length of text in bytes
1798 public void setText(char[] text)
1800 // void gtk_text_buffer_set_text (GtkTextBuffer *buffer, const gchar *text, gint len);
1801 gtk_text_buffer_set_text(gtkTextBuffer, Str.toStringz(text), text.length);
1805 * Inserts len bytes of text at position iter. If len is -1,
1806 * text must be nul-terminated and will be inserted in its
1807 * entirety. Emits the "insert_text" signal; insertion actually occurs
1808 * in the default handler for the signal. iter is invalidated when
1809 * insertion occurs (because the buffer contents change), but the
1810 * default signal handler revalidates it to point to the end of the
1815 * a position in the buffer
1817 * UTF-8 format text to insert
1819 * length of text in bytes, or -1
1821 public void insert(TextIter iter, char[] text)
1823 // void gtk_text_buffer_insert (GtkTextBuffer *buffer, GtkTextIter *iter, const gchar *text, gint len);
1824 gtk_text_buffer_insert(gtkTextBuffer, (iter is null) ? null : iter.getTextIterStruct(), Str.toStringz(text), text.length);
1828 * Simply calls gtk_text_buffer_insert(), using the current
1829 * cursor position as the insertion point.
1833 * some text in UTF-8 format
1835 * length of text, in bytes
1837 public void insertAtCursor(char[] text)
1839 // void gtk_text_buffer_insert_at_cursor (GtkTextBuffer *buffer, const gchar *text, gint len);
1840 gtk_text_buffer_insert_at_cursor(gtkTextBuffer, Str.toStringz(text), text.length);
1844 * Like gtk_text_buffer_insert(), but the insertion will not occur if
1845 * iter is at a non-editable location in the buffer. Usually you
1846 * want to prevent insertions at ineditable locations if the insertion
1847 * results from a user action (is interactive).
1848 * default_editable indicates the editability of text that doesn't
1849 * have a tag affecting editability applied to it. Typically the
1850 * result of gtk_text_view_get_editable() is appropriate here.
1854 * a position in buffer
1858 * length of text in bytes, or -1
1860 * default editability of buffer
1862 * whether text was actually inserted
1864 public int insertInteractive(TextIter iter, char[] text, int defaultEditable)
1866 // gboolean gtk_text_buffer_insert_interactive (GtkTextBuffer *buffer, GtkTextIter *iter, const gchar *text, gint len, gboolean default_editable);
1867 return gtk_text_buffer_insert_interactive(gtkTextBuffer, (iter is null) ? null : iter.getTextIterStruct(), Str.toStringz(text), text.length, defaultEditable);
1871 * Calls gtk_text_buffer_insert_interactive() at the cursor
1873 * default_editable indicates the editability of text that doesn't
1874 * have a tag affecting editability applied to it. Typically the
1875 * result of gtk_text_view_get_editable() is appropriate here.
1879 * text in UTF-8 format
1881 * length of text in bytes, or -1
1883 * default editability of buffer
1885 * whether text was actually inserted
1887 public int insertInteractiveAtCursor(char[] text, int defaultEditable)
1889 // gboolean gtk_text_buffer_insert_interactive_at_cursor (GtkTextBuffer *buffer, const gchar *text, gint len, gboolean default_editable);
1890 return gtk_text_buffer_insert_interactive_at_cursor(gtkTextBuffer, Str.toStringz(text), text.length, defaultEditable);
1894 * Inserts text into buffer at iter, applying the list of tags to
1895 * the newly-inserted text. The last tag specified must be NULL to
1896 * terminate the list. Equivalent to calling gtk_text_buffer_insert(),
1897 * then gtk_text_buffer_apply_tag() on the inserted text;
1898 * gtk_text_buffer_insert_with_tags() is just a convenience function.
1902 * an iterator in buffer
1906 * length of text, or -1
1908 * first tag to apply to text
1910 * NULL-terminated list of tags to apply
1912 public void insertWithTags(TextIter iter, char[] text, ... )
1914 for (int i = 0; (i<_arguments.length) && (_arguments[i] == typeid(TextTag)); i++)
1916 TextTag tag = va_arg!(TextTag)(_argptr);
1917 // void gtk_text_buffer_insert_with_tags (GtkTextBuffer *buffer, GtkTextIter *iter, const gchar *text, gint len, GtkTextTag *first_tag, ...);
1918 gtk_text_buffer_insert_with_tags(gtkTextBuffer, (iter is null) ? null : iter.getTextIterStruct(), Str.toStringz(text), text.length, (tag is null) ? null : tag.getTextTagStruct(), null);
1923 * Same as gtk_text_buffer_insert_with_tags(), but allows you
1924 * to pass in tag names instead of tag objects.
1928 * position in buffer
1932 * length of text, or -1
1934 * name of a tag to apply to text
1938 public void insertWithTagsByName(TextIter iter, char[] text, ... )
1940 for (int i = 0; (i<_arguments.length) && (_arguments[i] == typeid(char[])); i++)
1942 char[] tagName = va_arg!(char[])(_argptr);
1943 // void gtk_text_buffer_insert_with_tags_by_name (GtkTextBuffer *buffer, GtkTextIter *iter, const gchar *text, gint len, const gchar *first_tag_name, ...);
1944 gtk_text_buffer_insert_with_tags_by_name(gtkTextBuffer, (iter is null) ? null : iter.getTextIterStruct(), Str.toStringz(text), text.length, Str.toStringz(tagName), null);
1949 * Create a new tag for this buffer
1950 * @param tagName can be null for no name
1951 * @param propertyName
1952 * @param propertyValue
1954 TextTag createTag(char[] tagName, char[] propertyName, int propertyValue,
1955 char[] propertyName1, char[] propertyValue1)
1958 gtk_text_buffer_create_tag(gtkTextBuffer,
1959 Str.toStringz(tagName),
1960 Str.toStringz(propertyName),propertyValue,
1961 Str.toStringz(propertyName1),
1962 Str.toStringz(propertyValue1),
1968 * Create a new tag for this buffer
1969 * @param tagName can be null for no name
1970 * @param propertyName
1971 * @param propertyValue
1973 TextTag createTag(char[] tagName, char[] propertyName, int propertyValue)
1976 gtk_text_buffer_create_tag(gtkTextBuffer,
1977 Str.toStringz(tagName),
1978 Str.toStringz(propertyName),propertyValue,null)
1984 * Create a new tag for this buffer
1985 * @param tagName can be null for no name
1986 * @param propertyName
1987 * @param propertyValue
1989 TextTag createTag(char[] tagName, char[] propertyName, double propertyValue)
1992 gtk_text_buffer_create_tag(gtkTextBuffer, Str.toStringz(tagName), Str.toStringz(propertyName),propertyValue,null)
1998 * Create a new tag for this buffer
1999 * @param tagName can be null for no name
2000 * @param propertyName
2001 * @param propertyValue
2002 * @param propertyName2
2003 * @param propertyValue2
2005 TextTag createTag(char[] tagName, char[] propertyName, int propertyValue, char[] propertyName2, int propertyValue2)
2008 gtk_text_buffer_create_tag(gtkTextBuffer, Str.toStringz(tagName), Str.toStringz(propertyName), propertyValue, Str.toStringz(propertyName2), propertyValue2, null)
2012 TextTag createTag(char[] tagName, char[] propertyName, int propertyValue, char[] propertyName2, int propertyValue2, char[] propertyName3, int propertyValue3, char[] propertyName4, int propertyValue4, char[] propertyName5, int propertyValue5)
2015 gtk_text_buffer_create_tag(gtkTextBuffer, Str.toStringz(tagName), Str.toStringz(propertyName), propertyValue, Str.toStringz(propertyName2), propertyValue2, Str.toStringz(propertyName3), propertyValue3, Str.toStringz(propertyName4), propertyValue4, Str.toStringz(propertyName5), propertyValue5, null)
2019 * Create a new tag for this buffer
2020 * @param tagName can be null for no name
2021 * @param propertyName
2022 * @param propertyValue
2024 TextTag createTag(char[] tagName, char[] propertyName, char[] propertyValue)
2027 gtk_text_buffer_create_tag(gtkTextBuffer, Str.toStringz(tagName), Str.toStringz(propertyName),Str.toStringz(propertyValue),null)
2033 * Create a new tag for this buffer
2034 * @param tagName can be null for no name
2035 * @param propertyName
2036 * @param propertyValue
2039 TextTag createTag(char[] tagName, char[] propertyName, Bitmap propertyValue)
2042 gtk_text_buffer_create_tag(gtkTextBuffer, Str.toStringz(tagName), Str.toStringz(propertyName),propertyValue.getBitmapStruct(),null)
2048 * Obtain the entire text
2049 * @return The text char[]
2053 TextIter start = new TextIter();
2054 TextIter end = new TextIter();
2055 getBounds(start,end);
2056 return Str.toString(gtk_text_buffer_get_slice(gtkTextBuffer, start.getTextIterStruct(), end.getTextIterStruct(), true));
2060 * Create a new tag for this buffer
2061 * @param tagName can be null for no name
2062 * @param propertyName
2063 * @param propertyValue
2064 * @param propertyName2
2065 * @param propertyValue2
2067 TextTag createTag(char[] tagName,
2068 char[] propertyName, char[] propertyValue,
2069 char[] propertyName2, int propertyValue2)
2072 gtk_text_buffer_create_tag(gtkTextBuffer, Str.toStringz(tagName),
2073 Str.toStringz(propertyName), Str.toStringz(propertyValue),
2074 Str.toStringz(propertyName2), propertyValue2, null)
2083 file: GtkTextTag.html
2087 prefix: gtk_text_tag_
2088 noprefix: gtk_text_attributes_
2091 import: gobject.ObjectG
2092 structWrap: GObject* ObjectG
2094 structWrap: GdkEvent* Event
2095 import: gtk.TextIter
2096 structWrap: GtkTextIter* TextIter
2099 struct: GtkTextAttributes
2100 class: TextAttributes
2101 prefix: gtk_text_attributes_
2103 import: gtk.TextAttributes
2104 structWrap: GtkTextAttributes* TextAttributes
2105 outFile: TextAttributes
2107 file: GtkTextTagTable.html
2108 struct: GtkTextTagTable
2110 prefix: gtk_text_tag_
2113 import: gtk.TextTagTable
2114 structWrap: GtkTextTagTable* TextTagTable
2116 structWrap: GtkTextTag* TextTag
2117 outFile: TextTagTable
2119 file: GtkTextView.html
2123 prefix: gtk_text_view_
2125 noprefix: gtk_text_child_anchor_
2127 import: gtk.TextBuffer
2128 structWrap: GtkTextBuffer* TextBuffer
2129 import: gtk.TextMark
2130 structWrap: GtkTextMark* TextMark
2131 import: gtk.TextIter
2132 structWrap: GtkTextIter* TextIter
2133 import: gdk.Rectangle
2134 structWrap: GdkRectangle* Rectangle
2136 structWrap: GtkWidget* Widget
2137 import: pango.PgTabArray
2138 structWrap: PangoTabArray* PgTabArray
2139 import: gtk.TextAttributes
2140 structWrap: GtkTextAttributes* TextAttributes
2142 structWrap: GdkWindow* Window
2143 import: gtk.TextChildAnchor
2144 structWrap: GtkTextChildAnchor* TextChildAnchor
2146 structWrap: GList* ListG
2149 #gtk_text_view_get_type ()
2151 #GType gtk_text_view_get_type ();
2159 * Get the text line at the pixel y
2161 char[] getLineTextAt(gint y)
2164 TextIter iter = new TextIter();
2167 bufferToWindowCoords(TextWindowType.TEXT, 0, y, &windowX, &windowY);
2169 gtk_text_view_get_line_at_y(gtkTextView, iter.getTextIterStruct(), y+y-windowY, null);
2171 TextIter iterEnd = new TextIter();
2172 TextBuffer buffer = getBuffer();
2173 buffer.getIterAtOffset(iterEnd, iter.getOffset()+iter.getCharsInLine());
2174 return buffer.getText(iter, iterEnd, false);
2178 * Simply appends some on the cursor position
2179 * @param text the text to append
2181 void insertText(char[] text)
2183 TextBuffer buf = getBuffer();
2184 buf.insertAtCursor(text);
2188 * Simply appends some text to this view
2189 * @param text the text to append
2191 void appendText(char[] text, bool ensureVisible=true)
2194 TextBuffer buf = getBuffer();
2195 TextIter iter = new TextIter();
2196 buf.getEndIter(iter);
2197 buf.insert(iter, text);
2198 if ( ensureVisible )
2200 gdouble within_margin = 0.0;
2201 bit use_align = false;
2202 gdouble xalign = 0.0;
2203 gdouble yalign = 0.0;
2204 scrollToMark(buf.createMark("",iter,true), within_margin, use_align, xalign, yalign);
2213 struct: GtkTextChildAnchor
2214 class: TextChildAnchor
2216 prefix: gtk_text_child_anchor_
2218 outFile: TextChildAnchor
2220 ###########################################################
2221 ### Tree, List and Icon Grid Widgets ######################
2222 ###########################################################
2224 file: GtkTreeModel.html
2226 struct: GtkTreeModel
2228 prefix: gtk_tree_model_
2229 noprefix: gtk_tree_row_reference_
2230 noprefix: gtk_tree_path_
2231 noprefix: gtk_tree_iter_
2234 import: gtk.TreeIter
2235 structWrap: GtkTreeIter* TreeIter
2236 import: gtk.TreePath
2237 structWrap: GtkTreePath* TreePath
2238 import: gobject.Value
2239 structWrap: GValue* Value
2241 interfaceCode: start
2243 * Get the value of a column as a char array.
2244 * this is the same calling getValue and get the string from the value object
2246 char[] getValueString(TreeIter iter, int column);
2249 * Get the value of a column as a char array.
2250 * this is the same calling getValue and get the int from the value object
2252 int getValueInt(TreeIter iter, int column);
2254 void setValue(TreeIter iter, int column, char[] value);
2256 void setValue(TreeIter iter, int column, int value);
2260 nocode: gtk_tree_model_get_iter
2264 * Get the value of a column as a char array.
2265 * this is the same calling getValue and get the string from the value object
2267 char[] getValueString(TreeIter iter, int column)
2269 Value value = new Value();
2270 getValue(iter, column, value);
2271 return value.getString();
2275 * Get the value of a column as a char array.
2276 * this is the same calling getValue and get the int from the value object
2278 int getValueInt(TreeIter iter, int column)
2280 Value value = new Value();
2281 getValue(iter, column, value);
2282 return value.getInt();
2286 * Sets iter to a valid iterator pointing to path.
2290 * The uninitialized GtkTreeIter.
2294 * TRUE, if iter was set.
2296 public int getIter(TreeIter iter, TreePath path)
2298 // gboolean gtk_tree_model_get_iter (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreePath *path);
2299 iter.setModel(this);
2300 return gtk_tree_model_get_iter(gtkTreeModel, (iter is null) ? null : iter.getTreeIterStruct(), (path is null) ? null : path.getTreePathStruct());
2305 #interface: TreeModelIF
2311 prefix: gtk_tree_iter_
2314 import: gtk.TreeIter
2315 structWrap: GtkTreeIter* TreeIter
2316 import: gtk.TreeModel
2317 import: gtk.TreePath
2318 import: gtk.TreeIterError
2319 import: gobject.Value;
2324 * this will be set only when the iter
2325 * is created from the model.
2327 GtkTreeModel *gtkTreeModel;
2329 public void setModel(GtkTreeModel *gtkTreeModel)
2331 this.gtkTreeModel = gtkTreeModel;
2334 public void setModel(TreeModel treeModel)
2336 this.gtkTreeModel = treeModel.getTreeModelStruct();
2339 public this(TreeModel treeModel, TreePath treePath)
2342 setModel(treeModel);
2343 if ( gtk_tree_model_get_iter_from_string(
2344 treeModel.getTreeModelStruct(),
2345 getTreeIterStruct(), Str.toStringz(treePath.toString())) )
2352 * creates a new tree iteractor.
2353 * used TreeView.createIter and TreeView.append() to create iteractor for a tree or list
2357 this(new GtkTreeIter);
2367 void getValue(int column, Value value)
2369 if ( gtkTreeModel is null )
2371 throw new TreeIterError("getValue","Tree model not set");
2373 gtk_tree_model_get_value(gtkTreeModel, gtkTreeIter, column, value.getValueStruct());
2377 * Get the value of a column as a string
2378 * @para column the column number
2379 * @return a string representing the value of the column
2381 char[] getValueString(int column)
2383 if ( gtkTreeModel is null )
2385 throw new TreeIterError("getValueString","Tree model not set");
2387 Value value = new Value();
2388 gtk_tree_model_get_value(gtkTreeModel, gtkTreeIter, column, value.getValueStruct());
2389 //printf("TreeIter.getValuaString = %.*s\n", value.getString().toString());
2390 return value.getString();
2394 * Get the value of a column as an int
2395 * @para column the column number
2396 * @return a string representing the value of the column
2398 int getValueInt(int column)
2400 if ( gtkTreeModel is null )
2402 throw new TreeIterError("getValueInt", "Tree model not set");
2404 Value value = new Value();
2405 gtk_tree_model_get_value(gtkTreeModel, gtkTreeIter, column, value.getValueStruct());
2406 return value.getInt();
2409 TreePath getTreePath()
2411 if ( gtkTreeModel is null )
2413 throw new TreeIterError("getTreePath","Tree model not set");
2415 return new TreePath(gtk_tree_model_get_path(gtkTreeModel, gtkTreeIter));
2419 * This return the path visible to the user.
2421 char[] getVisiblePath(char[] separator)
2424 if ( gtkTreeModel is null )
2426 throw new TreeIterError("getVisiblePath", "Tree model not set");
2429 vPath = getValueString(0);
2430 TreeIter parent = getParent();
2431 while ( parent !is null )
2433 //printf("TreeIter.getVisiblePath parent = %.*s\n",parent.getValueString(0).toString());
2434 vPath = parent.getValueString(0) ~ separator ~ vPath;
2435 parent = parent.getParent();
2438 //printf("TreeIter.getVisiblePath = %.*s\n", vPath.toString());
2444 * Gets the parent of this iter
2446 * @return the parent iter or null if can't get parent or an error occured
2448 TreeIter getParent()
2450 if ( gtkTreeModel is null )
2452 throw new TreeIterError("getParent", "Tree model not set");
2454 TreeIter parent = new TreeIter();
2455 bool gotParent = gtk_tree_model_iter_parent(gtkTreeModel, parent.getTreeIterStruct(), gtkTreeIter) == 0 ? false : true;
2460 parent.setModel(gtkTreeModel);
2465 TreeIter getGrandParent()
2467 if ( gtkTreeModel is null )
2469 throw new TreeIterError("getGrandParent", "Tree model not set");
2471 TreeIter grandParent = this;
2472 TreeIter parent = grandParent.getParent();
2473 while ( parent !is null )
2475 grandParent = parent;
2476 parent = grandParent.getParent();
2495 prefix: gtk_tree_path_
2498 import: gtk.TreePath
2499 structWrap: GtkTreePath* TreePath
2502 nocode: gtk_tree_path_new
2503 nocode: gtk_tree_path_new_first
2507 * Creates a new GtkTreePath. This structure refers to a row.
2508 * if firstRow is true this is the string representation of this path is "0"
2510 * A newly created GtkTreePath.
2512 public this (bit firstRow=false)
2516 // GtkTreePath* gtk_tree_path_new_first (void);
2517 this(cast(GtkTreePath*)gtk_tree_path_new_first() );
2521 // GtkTreePath* gtk_tree_path_new (void);
2522 this(cast(GtkTreePath*)gtk_tree_path_new() );
2528 struct: GtkTreeRowReference
2529 class: TreeRowReference
2531 prefix: gtk_tree_row_reference_
2533 import: gtk.TreeModel
2534 structWrap: GtkTreeModel* TreeModel
2535 import: gtk.TreePath
2536 structWrap: GtkTreePath* TreePath
2537 import: gobject.ObjectG
2538 structWrap: GObject* ObjectG
2539 #import: gtk.TreeRowReference
2540 #structWrap: GtkTreeRowReference* TreeRowReference
2541 import: gtk.TreeIter
2542 structWrap: GtkTreeIter* TreeIter
2543 outFile: TreeRowReference
2546 class: TreeIterError
2552 * - trying to access a method that requires a tree model and the tree model was never set
2554 public this(char[] method, char[] message)
2556 super("TreeIter."~method~" : "~message);
2560 outFile: TreeIterError
2563 file: GtkTreeSelection.html
2564 struct: GtkTreeSelection
2565 class: TreeSelection
2566 prefix: gtk_tree_selection_
2568 import: gtk.TreeView
2569 structWrap: GtkTreeView* TreeView
2570 #import: gtk.TreeModel*
2571 #structWrap: GtkTreeModel** TreeModel*
2572 import: gtk.TreeIter
2573 structWrap: GtkTreeIter* TreeIter
2575 structWrap: GList* ListG
2576 import: gtk.TreePath
2577 structWrap: GtkTreePath* TreePath
2578 import: gtk.TreeModel
2579 import: gtk.TreeIter
2581 nocode: gtk_tree_selection_get_selected
2582 nocode: gtk_tree_selection_get_selected_rows
2586 * Sets iter to the currently selected node if selection is set to
2587 * GTK_SELECTION_SINGLE or GTK_SELECTION_BROWSE. iter may be NULL if you
2588 * just want to test if selection has any selected nodes. model is filled
2589 * with the current model as a convenience. This function will not work if you
2590 * use selection is GTK_SELECTION_MULTIPLE.
2592 * A GtkTreeSelection.
2594 * A pointer to set to the GtkTreeModel, or NULL.
2596 * The GtkTreeIter, or NULL.
2598 * TRUE, if there is a selected node.
2600 int getSelected(TreeModel model, TreeIter iter)
2602 GtkTreeModel* m = model.getTreeModelStruct();
2603 return gtk_tree_selection_get_selected(gtkTreeSelection, &m, iter.getTreeIterStruct())==0 ? false : true;
2607 * Creates a list of path of all selected rows. Additionally, if you are
2608 * planning on modifying the model after calling this function, you may
2609 * want to convert the returned list into a list of GtkTreeRowReferences.
2610 * To do this, you can use gtk_tree_row_reference_new().
2611 * To free the return value, use:
2612 * g_list_foreach (list, gtk_tree_path_free, NULL);
2613 * g_list_free (list);
2615 * A GtkTreeSelection.
2617 * A pointer to set to the GtkTreeModel, or NULL.
2619 * A GList containing a GtkTreePath for each selected row.
2622 TreePath[] getSelectedRows(TreeModel model)
2624 //printf("getSelectedRows(model) 1\n");
2625 GtkTreeModel* m = model.getTreeModelStruct();
2626 //printf("getSelectedRows(model) 2\n");
2627 ListG list = new ListG(
2628 gtk_tree_selection_get_selected_rows(gtkTreeSelection, &m)
2630 //printf("getSelectedRows(model) 3\n");
2632 //printf("getSelectedRows(model) 4 list.length() = %d\n",list.length());
2633 for ( int i=0 ; i<list.length() ; i++ )
2635 //printf("getSelectedRows(model) 5\n");
2636 paths ~= new TreePath(cast(GtkTreePath*)list.nthData(i));
2638 //printf("getSelectedRows(model) 6\n");
2645 outFile: TreeSelection
2647 file: GtkTreeViewColumn.html
2648 struct: GtkTreeViewColumn
2649 class: TreeViewColumn
2650 prefix: gtk_tree_view_column_
2653 import: gtk.CellRenderer
2654 structWrap: GtkCellRenderer* CellRenderer
2656 structWrap: GList* ListG
2658 structWrap: GtkWidget* Widget
2659 import: gtk.TreeModel
2660 structWrap: GtkTreeModel* TreeModel
2661 import: gtk.TreeIter
2662 structWrap: GtkTreeIter* TreeIter
2663 import: gdk.Rectangle
2664 structWrap: GdkRectangle* Rectangle
2666 nocode: gtk_tree_view_column_new_with_attributes
2670 * Creates a new Tree view column
2671 * @param header th column header text
2672 * @param renderer the rederer for the column cells
2673 * @param type the type of data to be displayed (shouldn't this be on the renderer?)
2674 * @param column the column number
2676 this(char [] header, CellRenderer renderer, char [] type, int column)
2678 this(gtk_tree_view_column_new_with_attributes(
2679 Str.toStringz(header),
2680 renderer.getCellRendererStruct(),
2681 Str.toStringz(type),
2690 outFile: TreeViewColumn
2692 file: GtkTreeView.html
2695 prefix: gtk_tree_view_
2698 import: gtk.TreeModel
2699 structWrap: GtkTreeModel* TreeModel
2700 import: gtk.TreeSelection
2701 structWrap: GtkTreeSelection* TreeSelection
2702 import: gtk.Adjustment
2703 structWrap: GtkAdjustment* Adjustment
2704 import: gtk.TreeViewColumn
2705 structWrap: GtkTreeViewColumn* TreeViewColumn
2706 import: gtk.CellRenderer
2707 structWrap: GtkCellRenderer* CellRenderer
2709 structWrap: GList* ListG
2710 import: gtk.TreePath
2711 structWrap: GtkTreePath* TreePath
2712 #import: gtk.TreePath*
2713 #structWrap: GtkTreePath** TreePath*
2714 #import: gtk.TreeViewColumn*
2715 #structWrap: GtkTreeViewColumn** TreeViewColumn*
2716 import: gdk.Rectangle
2717 structWrap: GdkRectangle* Rectangle
2719 structWrap: GdkWindow* Window
2720 #import: gtk.TargetEntry
2721 #structWrap: GtkTargetEntry* TargetEntry
2722 #import: gtk.TreeViewDropPosition
2723 #structWrap: GtkTreeViewDropPosition* TreeViewDropPosition
2725 structWrap: GdkPixmap* Pixmap
2726 import: gtk.TreeIter
2730 * Expands the row of the iter.
2735 int expandRow(TreeIter iter, TreeModel model, int openAll)
2737 return expandRow(model.getPath(iter), openAll);
2741 * Finds the path at the point (x, y), relative to widget coordinates. That
2742 * is, x and y are relative to an events coordinates. x and y must come
2743 * from an event on the tree_view only where event->window ==
2744 * gtk_tree_view_get_bin (). It is primarily for things
2745 * like popup menus. If path is non-NULL, then it will be filled with the
2746 * GtkTreePath at that point. This path should be freed with gtk_tree_path_free().
2747 * If column is non-NULL, then it will be filled with the column at that point.
2748 * cell_x and cell_y return the coordinates relative to the cell background
2749 * (i.e. the background_area passed to gtk_cell_renderer_render()). This
2750 * function is only meaningful if tree_view is realized.
2754 * The x position to be identified.
2756 * The y position to be identified.
2758 * A pointer to a GtkTreePath pointer to be filled in, or NULL
2760 * A pointer to a GtkTreeViewColumn pointer to be filled in, or NULL
2762 * A pointer where the X coordinate relative to the cell can be placed, or NULL
2764 * A pointer where the Y coordinate relative to the cell can be placed, or NULL
2766 * TRUE if a row exists at that coordinate.
2768 int getPathAtPos(gint x, gint y, inout TreePath path, inout TreeViewColumn column, out gint cellX, out gint cellY)
2770 GtkTreePath* p = path.getTreePathStruct();
2771 GtkTreeViewColumn* c = column.getTreeViewColumnStruct();
2773 int result = gtk_tree_view_get_path_at_pos(gtkTreeView, x, y, &p, &c, &cellX, &cellY)
2774 == 0 ? false : true;
2776 path = new TreePath(p);
2777 column = new TreeViewColumn(c);
2785 * gets the first selected iter or null if no rows are selected
2787 TreeIter getSelectedIter()
2789 TreeIter iter = new TreeIter();
2790 TreeSelection selection = getSelection();
2791 TreeModel model = getModel();
2792 TreePath[] paths = selection.getSelectedRows(model);
2793 if ( paths.length > 0 )
2795 model.getIter(iter,paths[0]);
2800 TreeIter[] getSelectedIters()
2804 TreeIter iter = new TreeIter();
2805 TreeSelection selection = getSelection();
2806 TreeModel model = getModel();
2807 TreePath[] paths = selection.getSelectedRows(model);
2808 foreach ( TreePath p; selection.getSelectedRows(model) )
2810 //iters.length = iters.length+1;
2811 //iters[iters.length-1] = model.getIter(iter,p);
2812 // iters ~= model.getIter(iter,p); >>> compile error can only concatenate arrays ???
2813 if ( model.getIter(iter,p) )
2816 iter = new TreeIter();
2820 //printf("TreeView.getSelectedIters iters.lenght = %d\n", iters.length);
2825 * Inserts a column and sets it's attributes
2830 * @return number of columns including the new one
2832 gint insertEditableColumn(int position, char[] title, CellRenderer renderer, bit editable)
2834 // OK, this is a trick because of my ignorance on how to pass variable argument lists
2837 position = getColumns().length();
2839 int tot = gtk_tree_view_insert_column_with_attributes(
2842 Str.toStringz(title),
2843 renderer.getCellRendererStruct(),
2844 Str.toStringz("text"),position,//v1.getV(),
2845 Str.toStringz("editable"),2,0);//v.getV(),0);
2855 file: gtk-GtkTreeView-drag-and-drop.html
2856 struct: GtkTreeDragSource
2857 class: TreeDragSource
2858 prefix: gtk_tree_drag_
2860 import: gtk.TreePath
2861 structWrap: GtkTreePath* TreePath
2862 #import: gtk.SelectionData
2863 #structWrap: GtkSelectionData* SelectionData
2864 #import: gtk.TreeDragDest
2865 #structWrap: GtkTreeDragDest* TreeDragDest
2866 import: gtk.TreeModel
2867 structWrap: GtkTreeModel* TreeModel
2868 outFile: TreeDragSource
2870 file: GtkCellView.html
2873 prefix: gtk_cell_view_
2877 structWrap: GdkPixbuf* Pixbuf
2878 import: gtk.TreeModel
2879 structWrap: GtkTreeModel* TreeModel
2880 import: gtk.TreePath
2881 structWrap: GtkTreePath* TreePath
2882 #import: gtk.Requisition
2883 #structWrap: GtkRequisition* Requisition
2885 structWrap: GdkColor* Color
2887 structWrap: GList* ListG
2889 nocode: gtk_cell_view_new_with_text
2890 nocode: gtk_cell_view_new_with_markup
2894 * Creates a new GtkCellView widget, adds a GtkCellRendererText
2895 * to it, and makes its show text.
2896 * If markup is true the text can be marked up with the Pango text
2899 * the text to display in the cell view
2901 * A newly created GtkCellView widget.
2904 public this (char[] text, bit markup=true)
2908 // GtkWidget* gtk_cell_view_new_with_markup (const gchar *markup);
2909 this(cast(GtkCellView*)gtk_cell_view_new_with_markup(Str.toStringz(text)) );
2913 // GtkWidget* gtk_cell_view_new_with_text (const gchar *text);
2914 this(cast(GtkCellView*)gtk_cell_view_new_with_text(Str.toStringz(text)) );
2921 file: GtkIconView.html
2924 prefix: gtk_icon_view_
2926 import: gtk.TreeModel
2927 structWrap: GtkTreeModel* TreeModel
2928 import: gtk.TreePath
2929 structWrap: GtkTreePath* TreePath
2930 #import: gtk.TreePath*
2931 #structWrap: GtkTreePath** TreePath*
2932 #import: gtk.CellRenderer*
2933 #structWrap: GtkCellRenderer** CellRenderer*
2934 import: gtk.CellRenderer
2935 structWrap: GtkCellRenderer* CellRenderer
2937 structWrap: GList* ListG
2938 #import: gtk.TargetEntry
2939 #structWrap: GtkTargetEntry* TargetEntry
2940 #import: gtk.IconViewDropPosition
2941 #structWrap: GtkIconViewDropPosition* IconViewDropPosition
2943 structWrap: GdkPixmap* Pixmap
2946 file: GtkTreeSortable.html
2947 struct: GtkTreeSortable
2949 prefix: gtk_tree_sortable_
2951 #import: gtk.SortType
2952 #structWrap: GtkSortType* SortType
2953 outFile: TreeSortable
2955 file: GtkTreeModelSort.html
2956 struct: GtkTreeModelSort
2957 class: TreeModelSort
2959 prefix: gtk_tree_model_sort_
2961 import: gtk.TreeModel
2962 structWrap: GtkTreeModel* TreeModel
2963 import: gtk.TreePath
2964 structWrap: GtkTreePath* TreePath
2965 import: gtk.TreeIter
2966 structWrap: GtkTreeIter* TreeIter
2967 outFile: TreeModelSort
2969 file: GtkTreeModelFilter.html
2970 struct: GtkTreeModelFilter
2971 class: TreeModelFilter
2972 prefix: gtk_tree_model_filter_
2974 import: gtk.TreeModel
2975 structWrap: GtkTreeModel* TreeModel
2976 import: gtk.TreePath
2977 structWrap: GtkTreePath* TreePath
2978 #import: gobject.Type
2979 #structWrap: GType* Type
2980 import: gtk.TreeIter
2981 structWrap: GtkTreeIter* TreeIter
2982 outFile: TreeModelFilter
2984 file: GtkCellLayout.html
2985 struct: GtkCellLayout
2988 prefix: gtk_cell_layout_
2991 import: gtk.CellRenderer
2992 structWrap: GtkCellRenderer* CellRenderer
2994 interface: CellLayoutIF
2995 outFile: CellLayoutT
2997 file: GtkCellRenderer.html
2998 struct: GtkCellRenderer
3000 prefix: gtk_cell_renderer_
3004 structWrap: GtkWidget* Widget
3005 import: gdk.Rectangle
3006 structWrap: GdkRectangle* Rectangle
3008 structWrap: GdkWindow* Window
3010 structWrap: GdkEvent* Event
3011 import: gtk.CellEditable
3012 structWrap: GtkCellEditable* CellEditable
3013 outFile: CellRenderer
3015 file: GtkCellEditable.html
3016 struct: GtkCellEditable
3018 prefix: gtk_cell_editable_
3021 structWrap: GdkEvent* Event
3022 outFile: CellEditable
3024 file: GtkCellRendererCombo.html
3025 struct: GtkCellRenderer
3026 realStruct: GtkCellRendererCombo
3027 class: CellRendererCombo
3028 prefix: gtk_cell_renderer_combo_
3030 import: gtk.CellRenderer
3031 structWrap: GtkCellRenderer* CellRenderer
3032 outFile: CellRendererCombo
3034 file: GtkCellRendererPixbuf.html
3035 struct: GtkCellRenderer
3036 realStruct: GtkCellRendererPixbuf
3037 class: CellRendererPixbuf
3038 prefix: gtk_cell_renderer_pixbuf_
3040 import: gtk.CellRenderer
3041 structWrap: GtkCellRenderer* CellRenderer
3042 outFile: CellRendererPixbuf
3044 file: GtkCellRendererProgress.html
3045 struct: GtkCellRenderer
3046 realStruct: GtkCellRendererProgress
3047 class: CellRendererProgress
3048 prefix: gtk_cell_renderer_progress_
3050 import: gtk.CellRenderer
3051 structWrap: GtkCellRenderer* CellRenderer
3052 outFile: CellRendererProgress
3054 file: GtkCellRendererText.html
3055 struct: GtkCellRenderer
3056 realStruct: GtkCellRendererText
3057 class: CellRendererText
3058 prefix: gtk_cell_renderer_text_
3061 import: gtk.CellRenderer
3062 structWrap: GtkCellRenderer* CellRenderer
3063 outFile: CellRendererText
3065 file: GtkCellRendererToggle.html
3066 struct: GtkCellRenderer
3067 realStruct: GtkCellRendererToggle
3068 class: CellRendererToggle
3069 prefix: gtk_cell_renderer_toggle_
3072 import: gtk.CellRenderer
3073 structWrap: GtkCellRenderer* CellRenderer
3074 outFile: CellRendererToggle
3080 * TreeNode interface
3082 public interface TreeNode
3084 char[] getNodeValue(int column);
3090 file: GtkListStore.html
3091 struct: GtkListStore
3093 extend: GtkTreeModel
3094 prefix: gtk_list_store_
3096 import: gtk.TreeModel
3098 #import: gobject.Type
3099 #structWrap: GType* Type
3100 import: gtk.TreeIter
3101 structWrap: GtkTreeIter* TreeIter
3102 import: gobject.Value
3103 structWrap: GValue* Value
3106 nocode: gtk_list_store_set
3111 * Non-vararg creation function. Used primarily by language bindings.
3113 * number of columns in the list store
3115 * an array of GType types for the columns, from first to last
3117 * a new GtkListStore
3119 public this (GType[] types)
3121 // GtkListStore* gtk_list_store_newv (gint n_columns, GType *types);
3122 this(cast(GtkListStore*)gtk_list_store_newv(types.length, cast(GType*)(types.ptr)) );
3126 * Creates a top level iteractor.
3127 * I don't think lists have but the top level iteractor
3129 TreeIter createIter()
3131 GtkTreeIter* iter = new GtkTreeIter;
3132 gtk_list_store_append(getListStoreStruct(), iter);
3133 return new TreeIter(iter);
3137 * sets the values for one row
3138 * @param iter the row iteractor
3139 * @param columns an arrays with the columns to set
3140 * @param values an arrays with the values
3142 void set(TreeIter iter, int [] columns, char*[] values)
3144 for ( int i=0 ; i<columns.length && i<values.length; i++ )
3146 //Value v = new Value(values[i]);
3147 //gtk_list_store_set(obj(), iter.getIter(), columns[i], v.getV(),-1);
3150 iter.getTreeIterStruct(),
3156 void set(TreeIter iter, int [] columns, char[][] values)
3158 for ( int i=0 ; i<columns.length && i<values.length; i++ )
3160 //Value v = new Value(values[i]);
3161 //gtk_list_store_set(obj(), iter.getIter(), columns[i], v.getV(),-1);
3164 iter.getTreeIterStruct(),
3166 Str.toStringz(values[i]),-1);
3170 void setValue(TreeIter iter, int column, char[] value)
3172 Value v = new Value(value);
3173 gtk_list_store_set_value(gtkListStore, iter.getTreeIterStruct(), column, v.getValueStruct());
3174 //gtk_list_store_set_value(obj(), iter.getIter(), column, (GValue*)cChar(value));
3177 void setValue(TreeIter iter, int column, int value)
3179 Value v = new Value(value);
3180 gtk_list_store_set_value(gtkListStore, iter.getTreeIterStruct(), column, v.getValueStruct());
3186 file: GtkTreeStore.html
3187 struct: GtkTreeStore
3189 extend: GtkTreeModel
3190 prefix: gtk_tree_store_
3193 #import: gobject.Type
3194 #structWrap: GType* Type
3195 import: gtk.TreeIter
3196 structWrap: GtkTreeIter* TreeIter
3197 import: gobject.Value
3198 structWrap: GValue* Value
3199 import: gtk.TreeNode
3201 import: gobject.Value;
3203 import: gtk.TreeModel
3205 nocode: gtk_tree_store_set
3210 * Non-vararg creation function. Used primarily by language bindings.
3212 * number of columns in the list store
3214 * an array of GType types for the columns, from first to last
3216 * a new GtkListStore
3218 public this (GType[] types)
3220 // GtkListStore* gtk_list_store_newv (gint n_columns, GType *types);
3221 this(cast(GtkTreeStore*)gtk_tree_store_newv(
3222 types.length, cast(GType*)(types.ptr))
3229 * Creates a top level iteractor.
3230 * I don't think lists have but the top level iteractor
3232 TreeIter createIter(TreeIter parent=null)
3234 GtkTreeIter* iter = new GtkTreeIter;
3235 gtk_tree_store_append(getTreeStoreStruct(), iter, (parent is null) ? null : parent.getTreeIterStruct());
3236 return new TreeIter(iter);
3240 * Sets one value into one cells.
3241 * @param iter the tree iteractor, effectivly the row
3242 * @param column to column number to set
3243 * @param value the value
3244 * \todo confirm we need to destroy the Value instance
3246 void setValue(TreeIter iter, int column, char[] value)
3248 gtk_tree_store_set(gtkTreeStore, iter.getTreeIterStruct(), column, Str.toStringz(value) , -1);
3251 void setValue(TreeIter iter, int column, int value)
3253 gtk_tree_store_set(gtkTreeStore, iter.getTreeIterStruct(), column, (new Value(value)).getValueStruct() , -1);
3259 * \todo confirm we need to destroy the Value instance
3261 void setValue(TreeIter iter, int column, Pixbuf pixbuf)
3263 Value v = new Value(pixbuf);
3264 gtk_tree_store_set_value(gtkTreeStore, iter.getTreeIterStruct(), column, v.getValueStruct());
3269 * sets the values for one row
3270 * @param iter the row iteractor
3271 * @param columns an arrays with the columns to set
3272 * @param values an arrays with the values
3274 void set(TreeIter iter, int [] columns, char*[] values)
3276 for ( int i=0 ; i<columns.length && i<values.length; i++ )
3278 //Value v = new Value(values[i]);
3279 //gtk_list_store_set(obj(), iter.getIter(), columns[i], v.getV(),-1);
3282 iter.getTreeIterStruct(),
3288 void set(TreeIter iter, int [] columns, char[][] values)
3290 for ( int i=0 ; i<columns.length && i<values.length; i++ )
3292 //Value v = new Value(values[i]);
3293 //gtk_list_store_set(obj(), iter.getIter(), columns[i], v.getV(),-1);
3296 iter.getTreeIterStruct(),
3298 Str.toStringz(values[i]),-1);
3303 * Sets an iteractor values from a tree node.
3304 * This is the way to add a new row to the tree,
3305 * the iteractor is either a top level iteractor created from createIter()
3306 * or a nested iteractor created from append()
3307 * @param iter the iteractor to set
3308 * @param treeNode the tree node
3312 void set(TreeIter iter, TreeNode treeNode)
3316 for ( int i=0 ; i<treeNode.columnCount() ; i++ )
3318 //printf(">>>>>>>>>>>>> requesting value for %d\n",i);
3320 char[] value = treeNode.getNodeValue(i);
3321 if ( value is null )
3330 set(iter, cols, vals);
3335 * Creates and prepends a new row to tree_store. If parent is non-NULL, then it will prepend
3336 * the new row before the first child of parent, otherwise it will prepend a row
3337 * to the top level. iter will be changed to point to this new row. The row
3338 * will be empty after this function is called. To fill in values, you need to
3339 * call gtk_tree_store_set() or gtk_tree_store_set_value().
3341 * A valid GtkTreeIter, or NULL
3343 public TreeIter prepend(TreeIter parent)
3345 TreeIter iter = new TreeIter();
3346 // void gtk_tree_store_prepend (GtkTreeStore *tree_store, GtkTreeIter *iter, GtkTreeIter *parent);
3347 gtk_tree_store_prepend(gtkTreeStore, iter.getTreeIterStruct(), (parent is null) ? null : parent.getTreeIterStruct());
3352 * Creates and appends a new row to tree_store. If parent is non-NULL, then it will append the
3353 * new row after the last child of parent, otherwise it will append a row to
3354 * the top level. iter will be changed to point to this new row. The row will
3355 * be empty after this function is called. To fill in values, you need to call
3356 * gtk_tree_store_set() or gtk_tree_store_set_value().
3358 * A valid GtkTreeIter, or NULL
3360 public TreeIter append(TreeIter parent)
3362 TreeIter iter = new TreeIter();
3363 // void gtk_tree_store_append (GtkTreeStore *tree_store, GtkTreeIter *iter, GtkTreeIter *parent);
3364 gtk_tree_store_append(gtkTreeStore,
3365 iter.getTreeIterStruct(),
3366 (parent is null) ? null : parent.getTreeIterStruct());
3374 ###########################################################
3375 ### Menus, Combo Box, Toolbar #############################
3376 ###########################################################
3378 file: GtkComboBox.html
3382 implements: CellLayoutIF
3383 import: atk.ObjectAtk
3384 structWrap: AtkObject* ObjectAtk
3385 prefix: gtk_combo_box_
3387 #noprefix: gtk_combo_box_new_text
3388 #noprefix: gtk_combo_box_append_text
3389 #noprefix: gtk_combo_box_insert_text
3390 #noprefix: gtk_combo_box_prepend_text
3391 #noprefix: gtk_combo_box_remove_text
3393 import: gtk.TreeModel
3394 structWrap: GtkTreeModel* TreeModel
3395 import: gtk.TreeIter
3396 structWrap: GtkTreeIter* TreeIter
3397 import: gtk.CellRenderer
3398 import: gtk.CellLayoutIF
3399 import: gtk.CellLayoutT
3401 nocode: gtk_combo_box_new
3402 nocode:gtk_combo_box_new_text
3406 private int count = 0;
3407 public int maxCount = 0;
3410 // add the CellLayout capabilities
3411 mixin CellLayoutT!(GtkComboBox);
3414 * Creates a new empty GtkComboBox.
3415 * If text is true then
3416 * constructs a new text combo box, which is a
3417 * GtkComboBox just displaying strings. If you use this function to create
3418 * a text combo box, you should only manipulate its data source with the
3419 * following convenience functions: gtk_combo_box_append_text(),
3420 * gtk_combo_box_insert_text(), gtk_combo_box_prepend_text() and
3421 * gtk_combo_box_remove_text().
3423 * A new GtkComboBox.
3426 public this (bit text=true)
3430 // GtkWidget* gtk_combo_box_new_text (void);
3431 this(cast(GtkComboBox*)gtk_combo_box_new_text() );
3435 // GtkWidget* gtk_combo_box_new (void);
3436 this(cast(GtkComboBox*)gtk_combo_box_new() );
3440 public void setActiveText(char[] text, bool insert=false)
3442 int currActive = getActive();
3446 while ( !found && active==getActive)
3448 found = text==getActiveText();
3460 //setActive(currActive);
3467 int getIndex(char[] text)
3469 TreeIter iter = new TreeIter();
3470 TreeModel model = getModel();
3471 iter.setModel(model);
3475 if ( model.getIterFirst(iter) )
3477 while ( !end && iter !is null && !found )
3479 found = iter.getValueString(0) == text;
3482 end = !model.iterNext(iter);
3491 return end ? -1 : index;
3494 void prependOrReplaceText(char[] text)
3496 int index = getIndex(text);
3502 else if ( index == -1 )
3512 #struct: GtkComboBox
3513 #class: ComboBoxText
3514 #import: atk.ObjectAtk
3515 #structWrap: AtkObject* ObjectAtk
3516 #filterIn: gtk_combo_box_new_text
3517 #filterIn: gtk_combo_box_append_text
3518 #filterIn: gtk_combo_box_insert_text
3519 #filterIn: gtk_combo_box_prepend_text
3520 #filterIn: gtk_combo_box_remove_text
3522 #outFile: ComboBoxText
3524 file: GtkComboBoxEntry.html
3526 struct: GtkComboBoxEntry
3527 class: ComboBoxEntry
3528 implements: CellLayoutIF
3529 prefix: gtk_combo_box_entry_
3530 #noprefix: gtk_combo_box_entry_new_text
3531 #noprefix: gtk_combo_box_append_text
3532 #noprefix: gtk_combo_box_insert_text
3533 #noprefix: gtk_combo_box_prepend_text
3534 #noprefix: gtk_combo_box_remove_text
3535 import: gtk.TreeModel
3536 structWrap: GtkTreeModel* TreeModel
3538 import: gtk.CellRenderer
3539 import: gtk.CellLayoutIF
3540 import: gtk.CellLayoutT
3542 nocode: gtk_combo_box_entry_new
3543 nocode: gtk_combo_box_entry_new_text
3547 mixin CellLayoutT!(GtkComboBoxEntry);
3549 * Creates a new GtkComboBoxEntry which has a GtkEntry as child. After
3550 * construction, you should set a model using gtk_combo_box_set_model() and a
3551 * text_column * using gtk_combo_box_entry_set_text_column().
3553 * A new GtkComboBoxEntry.
3556 public this (bit text=true)
3560 // GtkWidget* gtk_combo_box_entry_new_text (void);
3561 this(cast(GtkComboBoxEntry*)gtk_combo_box_entry_new_text() );
3565 // GtkWidget* gtk_combo_box_entry_new (void);
3566 this(cast(GtkComboBoxEntry*)gtk_combo_box_entry_new() );
3571 outFile: ComboBoxEntry
3574 #struct: GtkComboBoxEntry
3575 #class: ComboBoxEntryText
3576 #filterIn: gtk_combo_box_entry_new_text
3577 #filterIn: gtk_combo_box_append_text
3578 #filterIn: gtk_combo_box_insert_text
3579 #filterIn: gtk_combo_box_prepend_text
3580 #filterIn: gtk_combo_box_remove_text
3582 #outFile: ComboBoxEntryText
3591 structWrap: GtkWidget* Widget
3593 structWrap: GdkScreen* Screen
3594 import: gtk.AccelGroup
3595 structWrap: GtkAccelGroup* AccelGroup
3597 structWrap: GList* ListG
3598 import: gtk.MenuItem
3601 public void append(Widget widget)
3603 super.append(widget);
3607 * Popups up this menu
3608 * @param button ??? you can pass a button number here
3609 * @param activateTime ??? you can pass the time from an event here
3611 void popup(guint button, guint32 activateTime)
3613 popup(null, null, null, null, button, activateTime);
3617 * Creates and append a submenu to this menu.
3618 * This menu item that actualy has the sub menu is also created.
3619 * @param label the sub menu item label
3620 * @return the new menu
3622 Menu appendSubmenu(char[] label)
3624 MenuItem item = new MenuItem(label);
3626 Menu submenu = new Menu();
3627 item.setSubmenu(submenu);
3631 void appendSubmenu(char[] label, Menu submenu)
3633 MenuItem item = new MenuItem(label);
3635 item.setSubmenu(submenu);
3638 Menu prependSubmenu(char[] label)
3640 MenuItem item = new MenuItem(label);
3642 Menu submenu = new Menu();
3643 item.setSubmenu(submenu);
3651 file: GtkMenuBar.html
3654 prefix: gtk_menu_bar_
3657 structWrap: GtkWidget* Widget
3659 import: gtk.MenuItem;
3660 structWrap: GtkMenu* Menu
3661 structWrap: GtkMenuItem* MenuItem
3663 Menu append(char[] label, bool rightJustify=false)
3665 MenuItem item = new MenuItem(label);
3667 item.setRightJustified(rightJustify);
3668 Menu menu= new Menu();
3669 item.setSubmenu(menu);
3673 public void append(Widget widget)
3675 super.append(widget);
3680 file: GtkMenuItem.html
3683 prefix: gtk_menu_item_
3687 structWrap: GtkWidget* Widget
3688 # method conflict with parent method
3689 nocode: gtk_menu_item_activate
3690 nocode: gtk_menu_item_new_with_label
3691 nocode: gtk_menu_item_new_with_mnemonic
3692 # replace the method
3693 # TODO create a method rename instead of replacing the entire code
3696 /** store the action code passed in by the applcation */
3697 private char[] actionLabel;
3699 /** Gets the application set action code */
3700 public char[] getActionName()
3702 if ( actionLabel is null )
3710 * Creates a new menu item with a label and a listener and a action.
3711 * used for backward compatibily with DUI.
3713 this(char[] label, void delegate(MenuItem)dlg, char[] action)
3716 this.actionLabel = action;
3723 * Creates a new Item associated with a "activate" delegate and with a action code
3725 public this(void delegate(MenuItem) dlg, char[] label, char[] action, bit mnemonic=true)
3727 this(label, mnemonic);
3728 this.actionLabel = action;
3733 * Creates a new Item associated with a "activate" delegate
3735 public this(void delegate(MenuItem) dlg, char[] label, bit mnemonic=true)
3737 this(label, mnemonic);
3742 * Creates a new GtkMenuItem whose child is a GtkLabel.
3743 * If mnemonic is true the label
3744 * will be created using gtk_label_new_with_mnemonic(), so underscores
3745 * in label indicate the mnemonic for the menu item.
3747 * the text for the label
3749 * the newly created GtkMenuItem
3751 public this (char[] label, bit mnemonic=true)
3755 // GtkWidget* gtk_menu_item_new_with_mnemonic (const gchar *label);
3756 this(cast(GtkMenuItem*)gtk_menu_item_new_with_mnemonic(Str.toStringz(label)) );
3760 // GtkWidget* gtk_menu_item_new_with_label (const gchar *label);
3761 this(cast(GtkMenuItem*)gtk_menu_item_new_with_label(Str.toStringz(label)) );
3767 * Emits the "activate" signal on the given item
3771 public void itemActivate()
3773 // void gtk_menu_item_activate (GtkMenuItem *menu_item);
3774 gtk_menu_item_activate(gtkMenuItem);
3780 file: GtkMenuShell.html
3781 struct: GtkMenuShell
3783 prefix: gtk_menu_shell_
3786 structWrap: GtkWidget* Widget
3789 file: GtkImageMenuItem.html
3790 struct: GtkImageMenuItem
3791 class: ImageMenuItem
3792 prefix: gtk_image_menu_item_
3796 structWrap: GtkWidget* Widget
3797 import: gtk.AccelGroup
3798 structWrap: GtkAccelGroup* AccelGroup
3800 nocode: gtk_image_menu_item_new_with_label
3801 nocode: gtk_image_menu_item_new_with_mnemonic
3805 * Creates a new GtkImageMenuItem containing a label.
3806 * If mnemonic it true the label
3807 * will be created using gtk_label_new_with_mnemonic(), so underscores
3808 * in label indicate the mnemonic for the menu item.
3810 * the text of the menu item.
3812 * a new GtkImageMenuItem.
3814 public this (char[] label, bit mnemonic=true)
3818 // GtkWidget* gtk_image_menu_item_new_with_mnemonic (const gchar *label);
3819 this(cast(GtkImageMenuItem*)gtk_image_menu_item_new_with_mnemonic(Str.toStringz(label)) );
3823 // GtkWidget* gtk_image_menu_item_new_with_label (const gchar *label);
3824 this(cast(GtkImageMenuItem*)gtk_image_menu_item_new_with_label(Str.toStringz(label)) );
3829 outFile: ImageMenuItem
3831 file: GtkRadioMenuItem.html
3832 struct: GtkRadioMenuItem
3833 class: RadioMenuItem
3834 prefix: gtk_radio_menu_item_
3838 structWrap: GSList* ListSG
3840 nocode: gtk_radio_menu_item_new_with_label
3841 nocode: gtk_radio_menu_item_new_with_mnemonic
3842 nocode: gtk_radio_menu_item_new_with_mnemonic_from_widget
3843 nocode: gtk_radio_menu_item_new_with_label_from_widget
3847 * Creates a new GtkRadioMenuItem whose child is a simple GtkLabel.
3848 * The new GtkRadioMenuItem is added to the same group as group.
3849 * If mnemonic is true the label will be
3850 * created using gtk_label_new_with_mnemonic(), so underscores in label
3851 * indicate the mnemonic for the menu item.
3853 * an existing GtkRadioMenuItem
3855 * the text for the label
3857 * The new GtkRadioMenuItem
3860 public this (RadioMenuItem radioMenuItem, char[] label, bit mnemonic=true)
3864 // GtkWidget* gtk_radio_menu_item_new_with_mnemonic_from_widget (GtkRadioMenuItem *group, const gchar *label);
3865 this(cast(GtkRadioMenuItem*)gtk_radio_menu_item_new_with_mnemonic_from_widget(
3866 radioMenuItem.getRadioMenuItemStruct(), Str.toStringz(label)) );
3870 // GtkWidget* gtk_radio_menu_item_new_with_label_from_widget (GtkRadioMenuItem *group, const gchar *label);
3871 this(cast(GtkRadioMenuItem*)gtk_radio_menu_item_new_with_label_from_widget(
3872 radioMenuItem.getRadioMenuItemStruct(), Str.toStringz(label)) );
3877 * Creates a new GtkRadioMenuItem containing a label. T
3878 * The new GtkRadioMenuItem is added to the same group as group.
3880 * An existing GtkRadioMenuItem
3882 * the text of the button, with an underscore in front of the
3883 * mnemonic character
3885 * The new GtkRadioMenuItem
3888 public this (char[] label)
3893 * Creates a new GtkRadioMenuItem whose child is a simple GtkLabel.
3894 * If mnemonic is true the label
3895 * will be created using gtk_label_new_with_mnemonic(), so underscores
3896 * in label indicate the mnemonic for the menu item.
3898 * the group to which the radio menu item is to be attached
3900 * the text for the label
3902 * a new GtkRadioMenuItem
3904 public this (ListSG group, char[] label, bit mnemonic=true)
3908 // GtkWidget* gtk_radio_menu_item_new_with_mnemonic (GSList *group, const gchar *label);
3909 this(cast(GtkRadioMenuItem*)gtk_radio_menu_item_new_with_mnemonic(
3910 group is null ? null : group.getListSGStruct(), Str.toStringz(label)) );
3914 // GtkWidget* gtk_radio_menu_item_new_with_label (GSList *group, const gchar *label);
3915 this(cast(GtkRadioMenuItem*)gtk_radio_menu_item_new_with_label(
3916 group is null ? null : group.getListSGStruct(), Str.toStringz(label)) );
3920 outFile: RadioMenuItem
3922 file: GtkCheckMenuItem.html
3923 struct: GtkCheckMenuItem
3924 class: CheckMenuItem
3925 prefix: gtk_check_menu_item_
3929 nocode: gtk_check_menu_item_new_with_label
3930 nocode: gtk_check_menu_item_new_with_mnemonic
3934 * Creates a new GtkCheckMenuItem with a label.
3935 * If mnemonic it true the label
3936 * will be created using gtk_label_new_with_mnemonic(), so underscores
3937 * in label indicate the mnemonic for the menu item.
3939 * the string to use for the label.
3941 * a new GtkCheckMenuItem.
3943 public this (char[] label, bit mnemonic=true)
3947 // GtkWidget* gtk_check_menu_item_new_with_mnemonic (const gchar *label);
3948 this(cast(GtkCheckMenuItem*)gtk_check_menu_item_new_with_mnemonic(Str.toStringz(label)) );
3952 // GtkWidget* gtk_check_menu_item_new_with_label (const gchar *label);
3953 this(cast(GtkCheckMenuItem*)gtk_check_menu_item_new_with_label(Str.toStringz(label)) );
3958 outFile: CheckMenuItem
3960 file: GtkSeparatorMenuItem.html
3961 struct: GtkSeparatorMenuItem
3962 class: SeparatorMenuItem
3963 prefix: gtk_separator_menu_item_
3965 outFile: SeparatorMenuItem
3967 file: GtkTearoffMenuItem.html
3968 struct: GtkTearoffMenuItem
3969 class: TearoffMenuItem
3970 prefix: gtk_tearoff_menu_item_
3972 outFile: TearoffMenuItem
3974 file: GtkToolbar.html
3977 prefix: gtk_toolbar_
3982 import: gtk.ToolItem
3983 structWrap: GtkWidget* Widget
3984 nocode: gtk_toolbar_get_style
3988 * Retrieves whether the toolbar has text, icons, or both . See
3989 * gtk_toolbar_set_style().
3993 * the current style of toolbar
3995 public GtkToolbarStyle toolbarGetStyle()
3997 // GtkToolbarStyle gtk_toolbar_get_style (GtkToolbar *toolbar);
3998 return gtk_toolbar_get_style(gtkToolbar);
4001 public void insert (ToolItem toolItem, int pos=-1)
4003 gtk_toolbar_insert(gtkToolbar, toolItem.getToolItemStruct(), pos);
4006 public Widget insertStock(StockID stockId, char[] tooltipText, char[] tooltipPrivateText, GtkSignalFunc callback, void* userData, int position)
4008 return insertStock(getId(stockId), tooltipText, tooltipPrivateText, callback, userData, position);
4011 public Widget insertStock(char[] stockId, char[] tooltipText, char[] tooltipPrivateText, int position)
4013 return insertStock(stockId, tooltipText, tooltipPrivateText, null, null, position);
4016 public Widget insertStock(StockID stockId, char[] tooltipText, char[] tooltipPrivateText, int position)
4018 return insertStock(getId(stockId), tooltipText, tooltipPrivateText, null, null, position);
4021 Button insertButton(StockID stockID,
4022 char[] tooltipText, char[] tooltipPrivateText,
4025 Button button = new Button(
4026 cast(GtkButton*)gtk_toolbar_insert_stock(
4028 Str.toStringz(StockDesc[stockID]),
4029 Str.toStringz(tooltipText),
4030 Str.toStringz(tooltipPrivateText),
4040 file: GtkToolItem.html
4043 prefix: gtk_tool_item_
4046 import: gtk.Tooltips
4047 structWrap: GtkTooltips* Tooltips
4049 structWrap: GtkWidget* Widget
4053 * Sets this widget tooltip
4054 * @param tipText the tooltip
4055 * @param tipPrivate a private text
4057 void setTooltip(char[] tipText, char[] tipPrivate)
4059 Tooltips tt = new Tooltips();
4060 tt.setTip(this, tipText, tipPrivate);
4067 file: GtkSeparatorToolItem.html
4068 struct: GtkSeparatorToolItem
4069 ctorStruct: GtkToolItem
4070 class: SeparatorToolItem
4071 prefix: gtk_separator_tool_item_
4073 import: gtk.ToolItem
4074 structWrap: GtkToolItem* ToolItem
4075 outFile: SeparatorToolItem
4077 file: GtkToolButton.html
4078 struct: GtkToolButton
4079 ctorStruct: GtkToolItem
4081 prefix: gtk_tool_button_
4084 import: gtk.ToolItem
4085 #structWrap: GtkToolItem* ToolItem
4087 structWrap: GtkWidget* Widget
4090 /** An arbitrary string to be used by the application */
4091 private char[] action;
4093 public void setActionName(char[] action)
4095 this.action = action.dup;
4098 public char[] getActionName()
4103 public this (StockID stockID)
4105 this(StockDesc[stockID]);
4113 file: GtkMenuToolButton.html
4114 struct: GtkMenuToolButton
4115 ctorStruct: GtkToolItem
4116 class: MenuToolButton
4117 prefix: gtk_menu_tool_button_
4120 import: gtk.ToolItem
4121 structWrap: GtkToolItem* ToolItem
4123 structWrap: GtkWidget* Widget
4124 import: gtk.Tooltips
4125 structWrap: GtkTooltips* Tooltips
4129 nocode: gtk_menu_tool_button_new
4130 nocode: gtk_menu_tool_button_new_from_stock
4131 nocode: gtk_menu_tool_button_get_menu
4135 * Creates a new GtkMenuToolButton using icon_widget as icon and
4138 * a widget that will be used as icon widget, or NULL
4140 * a string that will be used as label, or NULL
4142 * the new GtkMenuToolButton
4145 public this(Widget iconWidget, char[] label)
4147 // GtkToolItem* gtk_menu_tool_button_new (GtkWidget *icon_widget, const gchar *label);
4148 this( cast(GtkMenuToolButton*)gtk_menu_tool_button_new(
4149 (iconWidget is null) ? null : iconWidget.getWidgetStruct(),
4150 Str.toStringz(label))
4155 * Creates a new GtkMenuToolButton.
4156 * The new GtkMenuToolButton will contain an icon and label from
4157 * the stock item indicated by stock_id.
4159 * the name of a stock item
4161 * the new GtkMenuToolButton
4164 public this(StockID stockId)
4166 // GtkToolItem* gtk_menu_tool_button_new_from_stock (const gchar *stock_id);
4168 cast(GtkMenuToolButton*)gtk_menu_tool_button_new_from_stock(
4169 Str.toStringz(StockDesc[stockId]))
4174 * Gets the GtkMenu associated with GtkMenuToolButton.
4176 * a GtkMenuToolButton
4178 * the GtkMenu associated with GtkMenuToolButton
4181 public Menu getMenu()
4183 // GtkWidget* gtk_menu_tool_button_get_menu (GtkMenuToolButton *button);
4184 return new Menu( cast(GtkMenu*)gtk_menu_tool_button_get_menu(gtkMenuToolButton) );
4188 * Sets the toolTip for the arrow
4193 public void setArrowTooltip(char[] tipText, char[] tipPrivate)
4195 Tooltips tooltips = new Tooltips();
4196 gtk_menu_tool_button_set_arrow_tooltip(
4198 (tooltips is null) ? null : tooltips.getTooltipsStruct(),
4199 Str.toStringz(tipText),
4200 Str.toStringz(tipPrivate)
4206 outFile: MenuToolButton
4208 file: GtkToggleToolButton.html
4209 struct: GtkToggleToolButton
4210 ctorStruct: GtkToolItem
4211 class: ToggleToolButton
4212 prefix: gtk_toggle_tool_button_
4215 import: gtk.ToolItem
4216 structWrap: GtkToolItem* ToolItem
4217 outFile: ToggleToolButton
4219 file: GtkRadioToolButton.html
4220 struct: GtkRadioToolButton
4221 ctorStruct: GtkToolItem
4222 class: RadioToolButton
4223 prefix: gtk_radio_tool_button_
4226 import: gtk.ToolItem
4227 structWrap: GtkToolItem* ToolItem
4229 structWrap: GSList* ListSG
4230 outFile: RadioToolButton
4232 ###########################################################
4233 ### Action-based menus and toolbars #######################
4234 ###########################################################
4236 file: GtkUIManager.html
4237 struct: GtkUIManager
4239 prefix: gtk_ui_manager_
4242 import: gtk.ActionGroup
4243 structWrap: GtkActionGroup* ActionGroup
4245 structWrap: GList* ListG
4246 import: gtk.AccelGroup
4247 structWrap: GtkAccelGroup* AccelGroup
4249 structWrap: GtkWidget* Widget
4251 structWrap: GSList* ListSG
4253 structWrap: GtkAction* Action
4256 file: GtkActionGroup.html
4257 struct: GtkActionGroup
4259 prefix: gtk_action_group_
4263 structWrap: GtkAction* Action
4265 structWrap: GList* ListG
4266 #import: gtk.ActionEntry
4267 #structWrap: GtkActionEntry* ActionEntry
4268 #import: gtk.ToggleActionEntry
4269 #structWrap: GtkToggleActionEntry* ToggleActionEntry
4270 #import: gtk.RadioActionEntry
4271 #structWrap: GtkRadioActionEntry* RadioActionEntry
4272 outFile: ActionGroup
4274 file: GtkAction.html
4281 structWrap: GtkWidget* Widget
4283 structWrap: GSList* ListSG
4284 import: gobject.Closure
4285 structWrap: GClosure* Closure
4286 import: gtk.AccelGroup
4287 structWrap: GtkAccelGroup* AccelGroup
4290 file: GtkToggleAction.html
4291 struct: GtkToggleAction
4293 prefix: gtk_toggle_action_
4296 outFile: ToggleAction
4298 file: GtkRadioAction.html
4299 struct: GtkRadioAction
4301 prefix: gtk_radio_action_
4305 structWrap: GSList* ListSG
4306 outFile: RadioAction
4308 ###########################################################
4309 ### Selectors (File/Font/Color/Input Devices) ############
4310 ###########################################################
4312 file: GtkColorButton.html
4313 struct: GtkColorButton
4315 prefix: gtk_color_button_
4319 structWrap: GdkColor* Color
4320 outFile: ColorButton
4322 file: GtkColorSelection.html
4323 struct: GtkColorSelection
4324 class: ColorSelection
4325 prefix: gtk_color_selection_
4329 structWrap: GdkColor* Color
4330 outFile: ColorSelection
4332 file: GtkColorSelectionDialog.html
4333 struct: GtkColorSelectionDialog
4334 class: ColorSelectionDialog
4335 prefix: gtk_color_selection_dialog_
4338 outFile: ColorSelectionDialog
4340 file: GtkFileSelection.html
4341 struct: GtkFileSelection
4342 class: FileSelection
4343 prefix: gtk_file_selection_
4346 outFile: FileSelection
4348 file: GtkFileChooser.html
4349 struct: GtkFileChooser
4351 prefix: gtk_file_chooser_
4355 structWrap: GtkWindow* Window
4357 structWrap: GSList* ListSG
4359 structWrap: GtkWidget* Widget
4360 import: gtk.FileFilter
4361 structWrap: GtkFileFilter* FileFilter
4362 outFile: FileChooser
4364 file: GtkFileChooserButton.html
4365 struct: GtkFileChooserButton
4366 class: FileChooserButton
4367 prefix: gtk_file_chooser_button_
4371 structWrap: GtkWidget* Widget
4372 import: glib.ListSG;
4374 import: gtk.FileFilter;
4375 import: gtk.FileChooser;
4379 private FileChooser fileChooser;
4381 public FileChooser getFileChooser()
4383 if ( fileChooser is null )
4385 fileChooser = new FileChooser(cast(GtkFileChooser*)getFileChooserButtonStruct());
4390 outFile: FileChooserButton
4392 file: GtkFileChooserDialog.html
4393 struct: GtkFileChooserDialog
4394 class: FileChooserDialog
4395 prefix: gtk_file_chooser_dialog_
4399 structWrap: GtkWindow* Window
4400 import: glib.ListSG;
4402 import: gtk.FileFilter;
4403 import: gtk.FileChooser;
4405 nocode: gtk_file_chooser_dialog_new
4406 nocode: gtk_file_chooser_dialog_new_with_backend
4410 private FileChooser fileChooser;
4412 public FileChooser getFileChooser()
4414 if ( fileChooser is null )
4416 fileChooser = new FileChooser(cast(GtkFileChooser*)getFileChooserDialogStruct());
4422 * Creates a new GtkFileChooserDialog. This function is analogous to
4423 * gtk_dialog_new_with_buttons().
4425 * Title of the dialog, or NULL
4427 * Transient parent of the dialog, or NULL
4429 * Open or save mode for the dialog
4430 * first_button_text:
4431 * stock ID or text to go in the first button, or NULL
4433 * response ID for the first button, then additional (button, id) pairs, ending with NULL
4435 * a new GtkFileChooserDialog
4438 this(char[] title, Window parent, FileChooserAction action, char[][] buttonsText=null, ResponseType[] responses=null)
4440 if ( buttonsText is null )
4442 buttonsText ~= "OK";
4443 buttonsText ~= "Cancel";
4445 if ( responses is null )
4447 responses ~= ResponseType.GTK_RESPONSE_OK;
4448 responses ~= ResponseType.GTK_RESPONSE_CANCEL;
4452 cast(GtkFileChooserDialog*)gtk_file_chooser_dialog_new(
4453 Str.toStringz(title),
4454 parent.getWindowStruct(),
4458 addButtons(buttonsText, responses);
4462 * Creates a new GtkFileChooserDialog with a specified backend. This is
4463 * especially useful if you use gtk_file_chooser_set_local_only() to allow
4464 * non-local files and you use a more expressive vfs, such as gnome-vfs,
4467 * Title of the dialog, or NULL
4469 * Transient parent of the dialog, or NULL
4471 * Open or save mode for the dialog
4473 * The name of the specific filesystem backend to use.
4474 * first_button_text:
4475 * stock ID or text to go in the first button, or NULL
4477 * response ID for the first button, then additional (button, id) pairs, ending with NULL
4479 * a new GtkFileChooserDialog
4482 * GtkFileChooser, GtkDialog
4484 public this (char[] title, Window parent, GtkFileChooserAction action, char[] backend, char[][] buttonsText=null, ResponseType[] responses=null)
4486 // GtkWidget* gtk_file_chooser_dialog_new_with_backend (const gchar *title, GtkWindow *parent, GtkFileChooserAction action, const gchar *backend, const gchar *first_button_text, ...);
4488 cast(GtkFileChooserDialog*)gtk_file_chooser_dialog_new_with_backend(
4489 Str.toStringz(title),
4490 parent.getWindowStruct(),
4492 Str.toStringz(backend),
4496 if ( buttonsText is null )
4498 buttonsText ~= "OK";
4499 buttonsText ~= "Cancel";
4501 if ( responses is null )
4503 responses ~= ResponseType.GTK_RESPONSE_OK;
4504 responses ~= ResponseType.GTK_RESPONSE_CANCEL;
4507 addButtons(buttonsText, responses);
4510 // this(char[] title, Window parent, FileChooserAction action, StockID[] buttons=null, ResponseType[] responses=null)
4512 // if ( buttons is null )
4514 // buttons ~= STOCK_OK;
4515 // buttons ~= STOCK_CANCEL;
4517 // if ( responses is null )
4519 // responses ~= ResponseType.GTK_RESPONSE_OK;
4520 // responses ~= ResponseType.GTK_RESPONSE_CANCEL;
4523 // this(gtk_file_chooser_dialog_new(
4524 // title.toStringz(),
4525 // parent.getWindowStruct(),
4529 // addButtons(buttons, responses);
4533 outFile: FileChooserDialog
4535 file: GtkFileChooserWidget.html
4536 struct: GtkFileChooserWidget
4537 class: FileChooserWidget
4538 prefix: gtk_file_chooser_widget_
4541 import: glib.ListSG;
4543 import: gtk.FileFilter;
4544 import: gtk.FileChooser;
4547 private FileChooser fileChooser;
4549 public FileChooser getFileChooser()
4551 if ( fileChooser is null )
4553 fileChooser = new FileChooser(cast(GtkFileChooser*)getFileChooserWidgetStruct());
4558 outFile: FileChooserWidget
4560 file: gtk-gtkfilefilter.html
4561 struct: GtkFileFilter
4563 prefix: gtk_file_filter_
4568 file: GtkFontButton.html
4569 struct: GtkFontButton
4571 prefix: gtk_font_button_
4576 file: GtkFontSelection.html
4577 struct: GtkFontSelection
4578 class: FontSelection
4579 prefix: gtk_font_selection_
4583 structWrap: GdkFont* Font
4584 outFile: FontSelection
4586 file: GtkFontSelectionDialog.html
4587 struct: GtkFontSelectionDialog
4588 class: FontSelectionDialog
4589 prefix: gtk_font_selection_dialog_
4593 structWrap: GdkFont* Font
4594 outFile: FontSelectionDialog
4596 file: GtkInputDialog.html
4597 struct: GtkInputDialog
4599 prefix: gtk_input_dialog_
4601 outFile: InputDialog
4603 ###########################################################
4604 ### Layout Containers #####################################
4605 ###########################################################
4607 file: GtkAlignment.html
4608 struct: GtkAlignment
4610 prefix: gtk_alignment_
4615 public static Alignment center(Widget widget)
4617 Alignment a = new Alignment(0.5, 0.5, 0, 0);
4622 public static Alignment north(Widget widget)
4624 Alignment a = new Alignment(0.5, 0.0, 0, 0);
4629 public static Alignment south(Widget widget)
4631 Alignment a = new Alignment(0.5, 1.0, 0, 0);
4636 public static Alignment east(Widget widget)
4638 Alignment a = new Alignment(1.0, 0.5, 0, 0);
4643 public static Alignment west(Widget widget)
4645 Alignment a = new Alignment(0.0, 0.5, 0, 0);
4653 file: GtkAspectFrame.html
4654 struct: GtkAspectFrame
4656 prefix: gtk_aspect_frame_
4659 outFile: AspectFrame
4675 file: GtkHButtonBox.html
4676 struct: GtkHButtonBox
4678 prefix: gtk_hbutton_box_
4682 * Creates a new HButtonBox and sets comon parameters
4684 static ButtonBox createActionBox()
4686 ButtonBox bBox = new HButtonBox();
4687 bBox.setLayout(ButtonBoxStyle.END);
4688 bBox.setBorderWidth(5);
4696 file: GtkVButtonBox.html
4697 struct: GtkVButtonBox
4699 prefix: gtk_vbutton_box_
4703 * Creates a new vertical button box and sets standart values for it's comon parameters
4704 * @return a new vertical button box
4706 static ButtonBox createActionBox()
4708 ButtonBox bBox = new VButtonBox();
4709 bBox.setLayout(ButtonBoxStyle.START);
4710 bBox.setBorderWidth(5);
4723 structWrap: GtkWidget* Widget
4726 file: GtkHPaned.html
4731 structWrap: GtkWidget* Widget
4736 * Creates a new HPaned and adds two widgets as it's children
4740 this(Widget child1, Widget child2)
4750 file: GtkVPaned.html
4759 * Creates a new HPaned and adds two widgets as it's children
4763 this(Widget child1, Widget child2)
4773 file: GtkLayout.html
4778 import: gtk.Adjustment
4779 structWrap: GtkAdjustment* Adjustment
4781 structWrap: GtkWidget* Widget
4784 file: GtkNotebook.html
4787 prefix: gtk_notebook_
4792 structWrap: GtkWidget* Widget
4794 /** The GtkNotebookTab is not documented */
4795 public enum GtkNotebookTab
4797 GTK_NOTEBOOK_TAB_FIRST,
4798 GTK_NOTEBOOK_TAB_LAST
4800 alias GtkNotebookTab NotebookTab;
4803 * Append a page with a widget and a text for a label
4805 public int appendPage(Widget child, char[] tabLabel)
4807 return appendPage(child, new Label(tabLabel));
4810 void setCurrentPage(Widget child)
4812 gtk_notebook_set_current_page(gtkNotebook,gtk_notebook_page_num(gtkNotebook, child.getWidgetStruct()));
4824 structWrap: GtkWidget* Widget
4828 nocode: gtk_table_new
4837 public AttachOptions defaultXOption = AttachOptions.SHRINK;
4838 public AttachOptions defaultYOption = AttachOptions.SHRINK;
4841 * Removes all children and resizes the table to 1,1
4850 * Used to create a new table widget. An initial size must be given by
4851 * specifying how many rows and columns the table should have, although
4852 * this can be changed later with gtk_table_resize(). rows and columns
4853 * must both be in the range 0 .. 65535.
4855 * The number of rows the new table should have.
4857 * The number of columns the new table should have.
4859 * If set to TRUE, all table cells are resized to the size of the cell
4860 * containing the largest widget.
4862 * A pointer to the the newly created table widget.
4864 public this (uint rows, uint columns, int homogeneous)
4866 // GtkWidget* gtk_table_new (guint rows, guint columns, gboolean homogeneous);
4867 this(cast(GtkTable*)gtk_table_new(rows, columns, homogeneous) );
4876 * Attach a new widget creating a new row if necessary
4878 void attach(Widget child)
4880 attach(child, col, col + 1, row, row + 1,
4881 defaultXOption, defaultYOption,
4882 getDefaultColSpacing(), getDefaultRowSpacing());
4895 file: GtkExpander.html
4898 prefix: gtk_expander_
4902 structWrap: GtkWidget* Widget
4904 nocode: gtk_expander_new
4905 nocode: gtk_expander_new_with_mnemonic
4909 * Creates a new expander using label as the text of the label.
4910 * If mnemonic os true
4911 * If characters in label are preceded by an underscore, they are underlined.
4912 * If you need a literal underscore character in a label, use '__' (two
4913 * underscores). The first underlined character represents a keyboard
4914 * accelerator called a mnemonic.
4916 * the text of the label
4918 * a new GtkExpander widget.
4921 public this (char[] label, bit mnemonic=true)
4925 // GtkWidget* gtk_expander_new_with_mnemonic (const gchar *label);
4926 this(cast(GtkExpander*)gtk_expander_new_with_mnemonic(Str.toStringz(label)) );
4930 // GtkWidget* gtk_expander_new (const gchar *label);
4931 this(cast(GtkExpander*)gtk_expander_new(Str.toStringz(label)) );
4938 ###########################################################
4939 ### Ornaments #############################################
4940 ###########################################################
4949 structWrap: GtkWidget* Widget
4952 * Creates frame with label and set it's child widget
4954 public this(Widget widget, char[] label)
4963 file: GtkHSeparator.html
4964 struct: GtkHSeparator
4966 prefix: gtk_hseparator_
4970 file: GtkVSeparator.html
4971 struct: GtkVSeparator
4973 prefix: gtk_vseparator_
4977 ###########################################################
4978 ### Scrolling #############################################
4979 ###########################################################
4981 file: GtkHScrollbar.html
4982 struct: GtkHScrollbar
4984 prefix: gtk_hscrollbar_
4986 import: gtk.Adjustment
4987 structWrap: GtkAdjustment* Adjustment
4990 file: GtkVScrollbar.html
4991 struct: GtkVScrollbar
4993 prefix: gtk_vscrollbar_
4995 import: gtk.Adjustment
4996 structWrap: GtkAdjustment* Adjustment
4999 file: GtkScrolledWindow.html
5000 struct: GtkScrolledWindow
5001 class: ScrolledWindow
5002 prefix: gtk_scrolled_window_
5005 structWrap: GtkWidget* Widget
5006 import: gtk.Adjustment
5007 structWrap: GtkAdjustment* Adjustment
5010 nocode: gtk_scrolled_window_new
5018 public this(Widget widget)
5021 addWithViewport(widget);
5025 * Creates a new scrolled window. The two arguments are the scrolled
5026 * window's adjustments; these will be shared with the scrollbars and the
5027 * child widget to keep the bars in sync with the child. Usually you want
5028 * to pass NULL for the adjustments, which will cause the scrolled window
5029 * to create them for you.
5031 * Horizontal adjustment.
5033 * Vertical adjustment.
5035 * New scrolled window.
5037 public this (Adjustment hadjustment, Adjustment vadjustment)
5039 // GtkWidget* gtk_scrolled_window_new (GtkAdjustment *hadjustment, GtkAdjustment *vadjustment);
5040 this(cast(GtkScrolledWindow*)gtk_scrolled_window_new(
5041 hadjustment is null ? null : hadjustment.getAdjustmentStruct(),
5042 vadjustment is null ? null : vadjustment.getAdjustmentStruct())
5047 * Creates a new Scrolled window and set the policy type
5048 * @param hPolicy the horizontal policy
5049 * @param vPolicy the vertical policy
5051 this(PolicyType hPolicy, PolicyType vPolicy)
5054 setPolicy(hPolicy, vPolicy);
5057 outFile: ScrolledWindow
5059 ###########################################################
5060 ### Miscellaneous #########################################
5061 ###########################################################
5063 file: GtkAdjustment.html
5064 struct: GtkAdjustment
5066 prefix: gtk_adjustment_
5068 import: gtk.ObjectGtk
5069 structWrap: GtkObject* ObjectGtk
5079 file: GtkCalendar.html
5082 prefix: gtk_calendar_
5086 file: GtkDrawingArea.html
5087 struct: GtkDrawingArea
5089 prefix: gtk_drawing_area_
5094 * Create a new DrawingArea and sets the SizeRequest
5100 this(int width, int height)
5103 setSizeRequest(width, height);
5108 outFile: DrawingArea
5110 file: GtkEventBox.html
5113 prefix: gtk_event_box_
5117 file: GtkHandleBox.html
5118 struct: GtkHandleBox
5120 prefix: gtk_handle_box_
5124 file: GtkIMContextSimple.html
5125 struct: GtkIMContextSimple
5126 class: IMContextSimple
5127 prefix: gtk_im_context_simple_
5129 import: gtk.IMContext
5130 structWrap: GtkIMContext* IMContext
5131 outFile: IMContextSimple
5133 file: GtkIMMulticontext.html
5134 struct: GtkIMMulticontext
5135 class: IMMulticontext
5136 prefix: gtk_im_multicontext_
5138 import: gtk.IMContext
5139 structWrap: GtkIMContext* IMContext
5140 import: gtk.MenuShell
5141 structWrap: GtkMenuShell* MenuShell
5142 outFile: IMMulticontext
5144 file: GtkSizeGroup.html
5145 struct: GtkSizeGroup
5147 prefix: gtk_size_group_
5150 structWrap: GtkWidget* Widget
5153 file: GtkTooltips.html
5156 prefix: gtk_tooltips_
5160 structWrap: GtkWidget* Widget
5161 #import: gtk.TooltipsData
5162 #structWrap: GtkTooltipsData* TooltipsData
5164 structWrap: GtkWindow* Window
5167 file: GtkViewport.html
5170 prefix: gtk_viewport_
5172 import: gtk.Adjustment
5173 structWrap: GtkAdjustment* Adjustment
5176 file: GtkAccessible.html
5177 struct: GtkAccessible
5179 prefix: gtk_accessible_
5183 ###########################################################
5184 ### Abstract Base Classes #################################
5185 ###########################################################
5193 structWrap: GtkWidget* Widget
5200 structWrap: GtkWidget* Widget
5203 #import: gtk.PackType
5204 #structWrap: GtkPackType* PackType
5207 file: GtkButtonBox.html
5208 struct: GtkButtonBox
5210 prefix: gtk_button_box_
5213 structWrap: GtkWidget* Widget
5215 import: gtk.HButtonBox
5216 import: gtk.VButtonBox
5218 static ButtonBox createActionBox(
5219 void delegate(Button) onClicked,
5228 bBox = VButtonBox.createActionBox();
5232 bBox = HButtonBox.createActionBox();
5236 for( int i=0 ; i<stocks.length && i<actions.length ; i++)
5238 button = new Button(stocks[i]);
5239 bBox.packEnd(button, false, false, 7);
5240 button.setActionName(actions[i]);
5241 button.addOnClicked(onClicked);
5246 static ButtonBox createOkBox(void delegate(Button) onClicked)
5248 static StockID[] stocks = [StockID.OK];
5250 actions ~= "action.ok";
5251 return createActionBox(onClicked, stocks, actions);
5254 static ButtonBox createOkCancelBox(void delegate(Button) onClicked)
5256 static StockID[] stocks = [StockID.OK, StockID.CANCEL];
5258 actions ~= "action.ok";
5259 actions ~= "action.cancel";
5260 return createActionBox(onClicked, stocks, actions);
5265 file: GtkContainer.html
5266 struct: GtkContainer
5268 structWrap: GtkContainerClass* Container
5269 structWrap: GtkWidget* Widget
5271 import: gtk.Adjustment
5272 structWrap: GtkAdjustment* Adjustment
5273 prefix: gtk_container_
5276 structWrap: GList* ListG
5277 import: gobject.Value
5278 structWrap: GValue* Value
5279 #import: gdk.EventExpose
5280 #structWrap: GdkEventExpose* EventExpose
5281 #import: gobject.ParamSpec
5282 #structWrap: GParamSpec* ParamSpec
5283 #import: g.ObjectClass
5284 #structWrap: GObjectClass* ObjectClass
5289 * Removes all widgets from the container
5293 ListG children = new ListG(gtk_container_get_children(getContainerStruct()));
5294 for ( int i=children.length()-1 ; i>=0 ; i-- )
5296 gtk_container_remove(getContainerStruct(), cast(GtkWidget*)children.nthData(i));
5317 file: GtkObject.html
5325 public static char[] getId(StockID id)
5327 return StockDesc[id];
5339 structWrap: GtkWidget* Widget
5343 public void add(Widget child1, Widget child2)
5357 import: gtk.Adjustment
5358 structWrap: GtkAdjustment* Adjustment
5368 file: GtkScrollbar.html
5369 struct: GtkScrollbar
5371 prefix: gtk_scrollbar_
5375 file: GtkSeparator.html
5376 struct: GtkSeparator
5378 prefix: gtk_separator
5382 file: GtkWidget.html
5386 import: atk.ObjectAtk
5387 structWrap: AtkObject* ObjectAtk
5390 # This function is exactly the same as calling g_object_ref(), and exists mostly for historical reasons.
5391 noprefix: gtk_widget_ref
5392 import: gdk.Rectangle
5393 structWrap: GdkRectangle* Rectangle
5394 #import: gtk.Requisition
5395 #structWrap: GtkRequisition* Requisition
5396 #import: gtk.Allocation
5397 #structWrap: GtkAllocation* Allocation
5398 import: gtk.AccelGroup
5399 structWrap: GtkAccelGroup* AccelGroup
5401 structWrap: GList* ListG
5403 structWrap: GdkEvent* Event
5405 structWrap: GdkWindow* Window
5406 import: gdk.Colormap
5407 structWrap: GdkColormap* Colormap
5409 structWrap: GdkVisual* Visual
5411 structWrap: GtkStyle* Style
5413 structWrap: GdkBitmap* Bitmap
5415 structWrap: GtkRcStyle* RcStyle
5417 structWrap: GdkColor* Color
5419 structWrap: GdkPixbuf* Pixbuf
5420 import: gtk.Adjustment
5421 structWrap: GtkAdjustment* Adjustment
5422 #import: gtk.WidgetClass
5423 #structWrap: GtkWidgetClass* WidgetClass
5424 #import: g.ParamSpec
5425 #structWrap: GParamSpec* ParamSpec
5427 structWrap: GdkRegion* Region
5428 import: gobject.Value
5429 structWrap: GValue* Value
5430 import: gtk.Settings
5431 structWrap: GtkSettings* Settings
5432 import: gtk.Clipboard
5433 structWrap: GtkClipboard* Clipboard
5435 structWrap: GdkDisplay* Display
5437 structWrap: GdkScreen* Screen
5441 import: pango.PgLayout
5442 structWrap: PangoLayout* PgLayout
5443 import: pango.PgContext
5444 structWrap: PangoContext* PgContext
5445 import: pango.PgFontDescription
5446 structWrap: PangoFontDescription* PgFontDescription
5447 import: gdk.Drawable
5448 import: gtk.Tooltips
5452 public int getWidth()
5455 gtk_widget_get_size_request(gtkWidget, &width, null);
5458 public int getHeight()
5461 gtk_widget_get_size_request(gtkWidget, null, &height);
5466 * Gets the drawable for this widget
5468 * The drawable for this widget
5470 Drawable getDrawable()
5473 // ubyte *p = cast(ubyte*)getStruct();
5475 // for ( int i=0 ; i<120 ; i+=4 )
5477 // printf("(%d) %X %x %x %x %x\n", i,p,*(p+0), *(p+1), *(p+2), *(p+3));
5481 // int* pt =cast(int*)getStruct();
5483 // printf("pt=%X strcut=%X\n", pt, getStruct());
5484 // printf("*pt=%X\n", *pt);
5486 // printf("pt+52=%X strcut.window=%X\n", pt, getWidgetStruct().window);
5487 // printf("*pt+52=%X\n", *pt);
5489 // //return new Drawable(cast(GdkDrawable*)(getWidgetStruct().window));
5490 int* pt =cast(int*)getStruct();
5492 return new Drawable(cast(GdkDrawable*)(*pt));
5496 * Gets the Window for this widget
5498 * The window for this widget
5503 // ubyte *p = cast(ubyte*)getStruct();
5505 // for ( int i=0 ; i<120 ; i+=4 )
5507 // printf("(%d) %X %x %x %x %x\n", i,p,*(p+0), *(p+1), *(p+2), *(p+3));
5511 // int* pt =cast(int*)getStruct();
5513 // printf("pt=%X strcut=%X\n", pt, getStruct());
5514 // printf("*pt=%X\n", *pt);
5516 // printf("pt+52=%X strcut.window=%X\n", pt, getWidgetStruct().window);
5517 // printf("*pt+52=%X\n", *pt);
5519 // //return new Drawable(cast(GdkDrawable*)(getWidgetStruct().window));
5520 int* pt =cast(int*)getStruct();
5522 return new Window(cast(GdkWindow*)(*pt));
5529 * @param cursor the new cursor
5530 * \bug the cursor changes to the parent widget also
5532 void setCursor(Cursor cursor)
5534 int* pt =cast(int*)getStruct();
5536 gdk_window_set_cursor(cast(GdkWindow*)(*pt), cursor.getCursorStruct());
5540 * Resets the cursor.
5541 * don't know if this is implemented by GTK+. Seems that it's not
5544 public void resetCursor()
5546 int* pt =cast(int*)getStruct();
5548 gdk_window_set_cursor(cast(GdkWindow*)(*pt), null);
5552 * Modifies the font for this widget.
5553 * This just calls modifyFont(new PgFontDescription(PgFontDescription.fromString(family ~ " " ~ size)));
5555 public void modifyFont(char[] family, int size)
5557 if ( size < 0 ) size = -size; // hack to workaround leds bug - TO BE REMOVED
5558 modifyFont(new PgFontDescription(
5559 PgFontDescription.fromString(
5560 family ~ " " ~ std.string.toString(size))));
5564 * Sets this widget tooltip
5565 * @param tipText the tooltip
5566 * @param tipPrivate a private text
5568 void setTooltip(char[] tipText, char[] tipPrivate)
5570 Tooltips tt = new Tooltips();
5571 tt.setTip(this, tipText, tipPrivate);
5580 file: GtkIMContext.html
5581 struct: GtkIMContext
5583 prefix: gtk_im_context_
5587 structWrap: GdkWindow* Window
5588 #import: gtk.EventKey
5589 #structWrap: GdkEventKey* EventKey
5590 import: gdk.Rectangle
5591 structWrap: GdkRectangle* Rectangle
5594 ###########################################################
5595 ### Cross-process Embedding ###############################
5596 ###########################################################
5604 structWrap: GdkDisplay* Display
5607 file: GtkSocket.html
5614 ###########################################################
5615 ### Special-purpose features ##############################
5616 ###########################################################
5625 file: GtkGammaCurve.html
5626 struct: GtkGammaCurve
5628 prefix: gtk_gamma_curve_
5639 file: GtkHRuler.html
5646 file: GtkVRuler.html
5653 ###########################################################
5654 ### Deprecated ############################################
5655 ###########################################################
5657 #file: GtkCList.html
5664 #file: GtkCTree.html
5671 #file: GtkCombo.html
5678 file: GtkItemFactory.html
5679 struct: GtkItemFactory
5681 prefix: gtk_item_factory_
5683 noprefix: gtk_item_factory_create_menu_entries
5685 import: gtk.AccelGroup
5686 structWrap: GtkAccelGroup* AccelGroup
5688 structWrap: GtkWidget* Widget
5689 import: gtk.ItemFactory
5690 structWrap: GtkItemFactory* ItemFactory
5691 #import: gtk.ItemFactoryEntry
5692 #structWrap: GtkItemFactoryEntry* ItemFactoryEntry
5693 outFile: ItemFactory
5702 #file: GtkListItem.html
5709 #file: GtkOldEditable.html
5716 #file: GtkOptionMenu.html
5723 #file: GtkPixmap.html
5730 #file: GtkPreview.html
5744 #file: gtkTipsQuery.html
5758 #file: GtkTreeItem.html
5765 file: GtkProgress.html
5768 prefix: gtk_progress_
5771 import: gtk.Adjustment
5772 structWrap: GtkAdjustment* Adjustment