/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

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