Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I googled for something, and it seems you can put a tooltip on a TreeView, see tooltips on treeview workaround . Since the perldoc for Gtk2::Ex::SimpleList says you can make a SimpleList from a Treeview (or derive the parent Treeview), you may be able to use that fact, to put the tooltips on the underlying TreeView. I guess one of the things on their to-do list, is to make tooltips more easily integrated into the TreeView widget. You might also ask on the gtk2-perl maillist.

You can add a tooltip to the entire SimpleList widget, as shown below, so you might be able to somehow connect mouse motion to the nearest entry, and modify the tip-text dynamically.....but I'm just brainstorming.

Also remember, that there is a difference between Gtk2::Tooltips and Gtk2::ToolTip.

#!/usr/bin/perl use warnings; use strict; use Data::Dumper; use Gtk2 '-init'; use Gtk2::SimpleList; use constant TRUE => 1; use constant FALSE => 0; my $categories = Gtk2::SimpleList->new ('Categories' => 'text'); $categories->set_headers_visible(FALSE); @{$categories->{data}} = qw/Meat Beer Pizza Pasta Soda Juice Rabbitfoo +d/; $categories->set_has_tooltip(TRUE); # NOTE: thought this might help (n +ope) my $path = Gtk2::TreePath->new_from_indices(0); my $tooltips = Gtk2::Tooltips->new; #my $tip = Gtk2::Tooltip->new; $tooltips->set_tip($categories,"tooltip test", $path); $tooltips->enable; my $window = Gtk2::Window->new; $window->set_title ('SimpleList examples'); $window->signal_connect (delete_event => sub {Gtk2->main_quit; TRUE}); $window->set_default_size (800,600); $window->add($categories); $window->show_all; Gtk2->main;

I'm not really a human, but I play one on earth. Cogito ergo sum a bum

In reply to Re: Gtk2 Treeview/Simplelist and set_tooltip_row() by zentara
in thread Gtk2 Treeview/Simplelist and set_tooltip_row() by jettero

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others rifling through the Monastery: (3)
    As of 2018-06-24 01:37 GMT
    Find Nodes?
      Voting Booth?
      Should cpanminus be part of the standard Perl release?

      Results (126 votes). Check out past polls.