I've no idea here...
[gtkD.git] / src / gtk / Tooltips.d
blob91ee0fe7238ef565808511d3edb6ba2f6eb8ab3a
1 /*
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
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = GtkTooltips.html
26 * outPack = gtk
27 * outFile = Tooltips
28 * strct = GtkTooltips
29 * realStrct=
30 * ctorStrct=
31 * clss = Tooltips
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gtk_tooltips_
40 * - gtk_
41 * omit structs:
42 * omit prefixes:
43 * omit code:
44 * imports:
45 * - glib.Str
46 * - gtk.Widget
47 * - gtk.Window
48 * structWrap:
49 * - GtkWidget* -> Widget
50 * - GtkWindow* -> Window
51 * local aliases:
54 module gtk.Tooltips;
56 private import gtk.gtktypes;
58 private import lib.gtk;
60 private import glib.Str;
61 private import gtk.Widget;
62 private import gtk.Window;
64 /**
65 * Description
66 * Tooltips are the messages that appear next to a widget when the mouse pointer is held over it for a short amount of time. They are especially helpful for adding more verbose descriptions of things such as buttons in a toolbar.
67 * An individual tooltip belongs to a group of tooltips. A group is created with a call to gtk_tooltips_new(). Every tooltip in the group can then be turned off with a call to gtk_tooltips_disable() and enabled with gtk_tooltips_enable().
68 * The length of time the user must keep the mouse over a widget before the tip is shown, can be altered with gtk_tooltips_set_delay(). This is set on a 'per group of tooltips' basis.
69 * To assign a tip to a particular GtkWidget, gtk_tooltips_set_tip() is used.
70 * Note
71 * Tooltips can only be set on widgets which have their own X window and
72 * receive enter and leave events.
73 * To check if a widget has its own window use GTK_WIDGET_NO_WINDOW().
74 * To add a tooltip to a widget that doesn't have its own window, place the
75 * widget inside a GtkEventBox and add a tooltip to that instead.
76 * The default appearance of all tooltips in a program is determined by the current GTK+ theme that the user has selected.
77 * Information about the tooltip (if any) associated with an arbitrary widget can be retrieved using gtk_tooltips_data_get().
78 * Example2.Adding tooltips to buttons.
79 * GtkWidget *load_button, *save_button, *hbox;
80 * GtkTooltips *button_bar_tips;
81 * button_bar_tips = gtk_tooltips_new ();
82 * /+* Create the buttons and pack them into a GtkHBox +/
83 * hbox = gtk_hbox_new (TRUE, 2);
84 * load_button = gtk_button_new_with_label ("Load a file");
85 * gtk_box_pack_start (GTK_BOX (hbox), load_button, TRUE, TRUE, 2);
86 * gtk_widget_show (load_button);
87 * save_button = gtk_button_new_with_label ("Save a file");
88 * gtk_box_pack_start (GTK_BOX (hbox), save_button, TRUE, TRUE, 2);
89 * gtk_widget_show (save_button);
90 * gtk_widget_show (hbox);
91 * /+* Add the tips +/
92 * gtk_tooltips_set_tip (GTK_TOOLTIPS (button_bar_tips), load_button,
93 * "Load a new document into this window",
94 * "Requests the filename of a document.
95 * This will then be loaded into the current
96 * window, replacing the contents of whatever
97 * is already loaded.");
98 * gtk_tooltips_set_tip (GTK_TOOLTIPS (button_bar_tips), save_button,
99 * "Saves the current document to a file",
100 * "If you have saved the document previously,
101 * then the new version will be saved over the
102 * old one. Otherwise, you will be prompted for
103 * a filename.");
105 private import gtk.ObjectGtk;
106 public class Tooltips : ObjectGtk
109 /** the main Gtk struct */
110 protected GtkTooltips* gtkTooltips;
113 public GtkTooltips* getTooltipsStruct()
115 return gtkTooltips;
119 /** the main Gtk struct as a void* */
120 protected void* getStruct()
122 return cast(void*)gtkTooltips;
126 * Sets our main struct and passes it to the parent class
128 public this (GtkTooltips* gtkTooltips)
130 super(cast(GtkObject*)gtkTooltips);
131 this.gtkTooltips = gtkTooltips;
140 * Creates an empty group of tooltips. This function initialises a GtkTooltips structure. Without at least one such structure, you can not add tips to your application.
141 * Returns:
142 * a new GtkTooltips group for you to use.
144 public this ()
146 // GtkTooltips* gtk_tooltips_new (void);
147 this(cast(GtkTooltips*)gtk_tooltips_new() );
151 * Allows the user to see your tooltips as they navigate your application.
152 * tooltips:
153 * a GtkTooltips.
155 public void enable()
157 // void gtk_tooltips_enable (GtkTooltips *tooltips);
158 gtk_tooltips_enable(gtkTooltips);
162 * Causes all tooltips in tooltips to become inactive. Any widgets that have tips associated with that group will no longer display their tips until they are enabled again with gtk_tooltips_enable().
163 * tooltips:
164 * a GtkTooltips.
166 public void disable()
168 // void gtk_tooltips_disable (GtkTooltips *tooltips);
169 gtk_tooltips_disable(gtkTooltips);
173 * Warning
174 * gtk_tooltips_set_delay is deprecated and should not be used in newly-written code.
175 * Sets the time between the user moving the mouse over a widget and the widget's tooltip appearing.
176 * tooltips:
177 * a GtkTooltips.
178 * delay:
179 * an integer value representing milliseconds.
181 public void setDelay(uint delay)
183 // void gtk_tooltips_set_delay (GtkTooltips *tooltips, guint delay);
184 gtk_tooltips_set_delay(gtkTooltips, delay);
188 * Adds a tooltip containing the message tip_text to the specified GtkWidget.
189 * tooltips:
190 * a GtkTooltips.
191 * widget:
192 * the GtkWidget you wish to associate the tip with.
193 * tip_text:
194 * a string containing the tip itself.
195 * tip_private:
196 * a string of any further information that may be useful if the user gets stuck.
198 public void setTip(Widget widget, char[] tipText, char[] tipPrivate)
200 // void gtk_tooltips_set_tip (GtkTooltips *tooltips, GtkWidget *widget, const gchar *tip_text, const gchar *tip_private);
201 gtk_tooltips_set_tip(gtkTooltips, (widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(tipText), Str.toStringz(tipPrivate));
205 * Retrieves any GtkTooltipsData previously associated with the given widget.
206 * widget:
207 * a GtkWidget.
208 * Returns:
209 * a GtkTooltipsData struct, or NULL if the widget has no tooltip.
211 public static GtkTooltipsData* dataGet(Widget widget)
213 // GtkTooltipsData* gtk_tooltips_data_get (GtkWidget *widget);
214 return gtk_tooltips_data_get((widget is null) ? null : widget.getWidgetStruct());
218 * Ensures that the window used for displaying the given tooltips is created.
219 * Applications should never have to call this function, since GTK+ takes
220 * care of this.
221 * tooltips:
222 * a GtkToolTips
224 public void forceWindow()
226 // void gtk_tooltips_force_window (GtkTooltips *tooltips);
227 gtk_tooltips_force_window(gtkTooltips);
231 * Determines the tooltips and the widget they belong to from the window in
232 * which they are displayed.
233 * This function is mostly intended for use by accessibility technologies;
234 * applications should have little use for it.
235 * tip_window:
236 * a GtkWindow
237 * tooltips:
238 * the return location for the tooltips which are displayed
239 * in tip_window, or NULL
240 * current_widget:
241 * the return location for the widget whose tooltips
242 * are displayed, or NULL
243 * Returns:
244 * TRUE if tip_window is displaying tooltips, otherwise FALSE.
245 * Since 2.4
246 * See Also
247 * GtkToolbar
248 * Create groups of widgets with their own tooltips.
249 * GtkTipsQuery
250 * Query tooltips to create context-sensitive help.
252 public static int getInfoFromTipWindow(Window tipWindow, GtkTooltips** tooltips, GtkWidget** currentWidget)
254 // gboolean gtk_tooltips_get_info_from_tip_window (GtkWindow *tip_window, GtkTooltips **tooltips, GtkWidget **current_widget);
255 return gtk_tooltips_get_info_from_tip_window((tipWindow is null) ? null : tipWindow.getWindowStruct(), tooltips, currentWidget);