PageRenderTime 18ms CodeModel.GetById 9ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 1ms

/src/wrappers/gtk/library/gtk_tooltips.e

http://github.com/tybor/Liberty
Specman e | 119 lines | 57 code | 24 blank | 38 comment | 2 complexity | 5c4bb2ebbf0a33851954dddd6bff91af MD5 | raw file
  1indexing
  2	description: "GtkToolItem: the base class of widgets that can be added to GtkToolbar."
  3	copyright: "[
  4					Copyright (C) 2007 Soluciones Informaticas Libres S.A.,
  5					eiffel-libraries team, GTK+ team
  6					
  7					This library is free software; you can redistribute it and/or
  8					modify it under the terms of the GNU Lesser General Public License
  9					as published by the Free Software Foundation; either version 2.1 of
 10					the License, or (at your option) any later version.
 11					
 12					This library is distributed in the hope that it will be useful, but
 13					WITHOUT ANY WARRANTY; without even the implied warranty of
 14					MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 15					Lesser General Public License for more details.
 16
 17					You should have received a copy of the GNU Lesser General Public
 18					License along with this library; if not, write to the Free Software
 19					Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 20					02110-1301 USA
 21			]"
 22
 23class GTK_TOOLTIPS
 24	-- Tooltips are the messages that appear next to a widget when the mouse
 25	-- pointer is held over it for a short amount of time. They are especially
 26	-- helpful for adding more verbose descriptions of things such as buttons
 27	-- in a toolbar.
 28	
 29	-- An individual tooltip belongs to a group of tooltips. A group is created
 30	-- with a creation call to make. Every tooltip in the group can then be
 31	-- turned off with a call to disable() and enabled with enable().
 32	
 33	-- The length of time the user must keep the mouse over a widget before the
 34	-- tip is shown, can be altered with set_delay(). This is set on a
 35	-- 'per group of tooltips' basis.
 36	
 37	-- To assign a tip to a particular GTK_WIDGET, set_tip() is used.
 38	
 39	-- Note:
 40	
 41	-- Tooltips can only be set on widgets which have their own X window and
 42	-- receive enter and leave events. To check if a widget has its own window
 43	-- use GTK_WIDGET_NO_WINDOW(). To add a tooltip to a widget that doesn't
 44	-- have its own window, place the widget inside a GTK_EVENT_BOX and add a
 45	-- tooltip to that instead.
 46	
 47	-- The default appearance of all tooltips in a program is determined by the
 48	-- current GTK+ theme that the user has selected.
 49	
 50	-- Information about the tooltip (if any) associated with an arbitrary
 51	-- widget can be retrieved using data_get().
 52
 53
 54inherit
 55	GTK_OBJECT
 56
 57insert
 58	GTK_TOOLTIPS_EXTERNALS
 59
 60creation make, from_external_pointer
 61
 62feature {} -- Creation
 63
 64	make is
 65			-- Creates an empty group of tooltips. This function initialises
 66			-- a GtkTooltips structure. Without at least one such structure,
 67			-- you can not add tips to your application.
 68		do
 69			from_external_pointer (gtk_tooltips_new)
 70		end
 71
 72feature -- Operations
 73
 74	enable is
 75			-- Allows the user to see your tooltips as they navigate your
 76			-- application.
 77		do
 78			gtk_tooltips_enable (handle)
 79		end
 80
 81	disable is
 82			-- Causes all tooltips in tooltips to become inactive. Any widgets
 83			-- that have tips associated with that group will no longer display
 84			-- their tips until they are enabled again with enable(). 
 85		do
 86			gtk_tooltips_disable (handle)
 87		end
 88
 89	set_delay (a_delay: INTEGER) is
 90			-- Sets the time between the user moving the mouse over a widget and
 91			-- the widget's tooltip appearing.
 92			-- 'a_delay' is in milliseconds
 93		obsolete
 94			"gtk_tooltips_set_delay is deprecated and should not be used in newly-written code."
 95		require
 96			a_delay >= 0
 97		do
 98			gtk_tooltips_set_delay (handle, a_delay)
 99		end
100
101	set_tip (a_widget: GTK_WIDGET; a_tip_text, a_tip_private: STRING) is
102			-- Adds a tooltip containing the message tip_text to the specified
103			-- GtkWidget.
104			-- 'a_widget': the GtkWidget you wish to associate the tip with.
105			-- 'a_tip_text': a string containing the tip itself.
106			-- 'a_tip_private': a string of any further information that may be
107			-- useful if the user gets stuck.
108		do
109			gtk_tooltips_set_tip (handle, a_widget.handle, a_tip_text.to_external,
110										 a_tip_private.to_external)
111		end
112
113feature -- size
114	struct_size: INTEGER is
115		external "C inline use <gtk/gtk.h>"
116		alias "sizeof(GtkTooltips)"
117		end
118
119end