From 2efbf0e96a5f92cccdacac58d530879c4374b478 Mon Sep 17 00:00:00 2001 From: John Luke Date: Sat, 10 May 2003 02:51:23 +0000 Subject: [PATCH] Add first draft for Tooltips.xml svn path=/trunk/gtk-sharp/; revision=14434 --- doc/ChangeLog | 4 ++ doc/en/Gtk/Tooltips.xml | 97 ++++++++++++++++++++++++++++++++--------- 2 files changed, 81 insertions(+), 20 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index f64e257e7..61e638b78 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2003-05-09 John Luke + + * en/Gtk/ToolTips.xml: Add first draft, example. + 2003-05-08 Lee Mallabone * en/Gtk/*.xml: diff --git a/doc/en/Gtk/Tooltips.xml b/doc/en/Gtk/Tooltips.xml index a8ff6fac7..e9623c520 100644 --- a/doc/en/Gtk/Tooltips.xml +++ b/doc/en/Gtk/Tooltips.xml @@ -7,8 +7,62 @@ Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - To be added - To be added + Add Tooltips to your widgets. + + 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 in a toolbar. + An individual tooltip belongs to a group of tooltips. + A group is created by calling the constructor . + Every tooltip in the group can then be turned off with and on with . + To assign a tip to a particular , is used. + Note: Tooltips can only be set on widgets which have their own X window. + To add a tooltip to a that does not have its own , place the widget inside a and add a tooltip to that instead. + The default appearance of all tooltips in a program is determined by the current Gtk theme that the user has selected. + + +using Gtk; +using GtkSharp; + +class ToolTipsExample +{ + static void Main() + { + + Application.Init(); + + Window win = new Window("Tooltips"); + Button load_button, save_button; + HBox hbox; + Tooltips button_bar_tips; + + button_bar_tips = new Tooltips (); + + // Create the buttons and pack them into a Gtk.HBox + hbox = new HBox (true, 2); + win.Add(hbox); + + load_button = new Button ("Load a file"); + hbox.Add(load_button); + + save_button = new Button ("Save a file"); + hbox.Add(save_button); + + // Add the tips + button_bar_tips.SetTip (load_button, + "Load a new document into this window", + "longer explanation"); + + button_bar_tips.SetTip (save_button, + "Saves the current document to a file", + "longer explanation"); + + win.ShowAll(); + Application.Run(); + } +} + + + Gtk.Object @@ -31,8 +85,8 @@ - To be added - To be added + Allows the user to see your tooltips as they navigate your application. + Allows the user to see your tooltips as they navigate your application. @@ -43,8 +97,9 @@ - To be added - To be added + Causes all tooltips in the tooltips group to become inactive. + Causes all tooltips in the tooltips group to become inactive. + Any widgets that have tips associated with that group will no longer display their tips until they are enabled again with . @@ -55,8 +110,9 @@ - To be added - To be added + Ensures that the window used for displaying the given tooltip is created. + Ensures that the window used for displaying the given tooltip is created. + (Applications should never have to call this function, since Gtk# takes care of this.) @@ -71,11 +127,11 @@ - To be added - To be added: an object of type 'Gtk.Widget' - To be added: an object of type 'string' - To be added: an object of type 'string' - To be added + Adds a tooltip containing the specified message to the specified . + an object of type + an object of type + an object of type + Adds a tooltip containing the specified message to the specified . @@ -112,9 +168,10 @@ - To be added - To be added: an object of type 'Gtk.Tooltips' - To be added + Creates an empty group of tooltips. + an object of type + Creates an empty group of tooltips. This function initializes a structure. + Without at least one such structure, you can not add individual tips to your application. @@ -124,8 +181,8 @@ System.UInt32 - The GLib Type for Gtk.Tooltips - The GLib Type for the Gtk.Tooltips class. + The for + The for the class. @@ -139,11 +196,11 @@ Internal constructor GLib type for the type - Creates a new instance of Tooltips, using the GLib-provided type + Creates a new instance of , using the GLib-provided type This is a constructor used by derivative types of that would have their own GLib type assigned to it. This is not typically used by C# code. - \ No newline at end of file +