File: migrating-GtkTooltip.sgml

package info (click to toggle)
gtk%2B2.0 2.24.33-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie, trixie-proposed-updates, trixie-updates
  • size: 124,860 kB
  • sloc: ansic: 574,091; makefile: 5,171; sh: 4,618; xml: 1,193; python: 1,117; perl: 749; awk: 49; cpp: 34
file content (66 lines) | stat: -rw-r--r-- 2,286 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?xml version="1.0"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
]>
<chapter id="gtk-migrating-tooltips">

  <title>Migrating from GtkTooltips to GtkTooltip</title>

  <para>
    GTK+ 2.12 brings a completely new tooltip implementation which
    allows many things that were not possible with the old 
    #GtkTooltips interface. The new possibilities are explained
    in more detail in the section about #GtkTooltip. 
  </para>

  <para>
    A number of complications of the old API have been removed:
    <itemizedlist>

      <listitem><para>
        Tooltips can not be grouped anymore. The old tooltips
        API allowed this by using multiple #GtkTooltips objects.
        We believe that the timeout behaviour of the new tooltips 
        implementation is better and makes it unnecessary to use 
        grouping as a way to overcome shortcomings of the 
        fast-tooltips mode.
      </para></listitem>

      <listitem><para>
        Timeouts can not be set individually anymore. Instead
        there are settings #GtkSettings:gtk-tooltip-timeout, 
        #GtkSettings:gtk-tooltip-browse-timeout and
        #GtkSettings:gtk-tooltip-browse-mode-timeout to influence
        the behaviour of tooltips globally.
      </para></listitem>

    </itemizedlist>
  </para>

  <para>
    Here is an example of setting a tooltip on a widget with the old API:
    <informalexample><programlisting>
GtkTooltips *tooltips = gtk_tooltips_new ();     
gtk_tooltips_set_tip (tooltips, widget, "Some tips", NULL);
    </programlisting></informalexample>
  </para>
  <para>
    Using the new tooltips API, it is no longer necessary to create 
    an object:
    <informalexample><programlisting>
gtk_widget_set_tooltip_text (widget, "Some tips");
    </programlisting></informalexample>
  </para>
  <para>
    Similarly, setting a tooltip on a #GtkToolItem gets
    simplified from
    <informalexample><programlisting>
gtk_tool_item_set_tooltip (toolitem, toolbar->tooltips, "tool tip", NULL);
    </programlisting></informalexample>
    to
    <informalexample><programlisting>
gtk_tool_item_set_tooltip_text (toolitem, text);
    </programlisting></informalexample>
  </para>

</chapter>