Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Muppet, I was just going to link to that! Thanks again for your help. I think your code should also be here natively in a readmore code tag. Links have a way of aging out after a while.
# this is from muppet via http://mail.gnome.org/archives/gtk-perl-lis +t/2008-April/msg00087.html use strict; use Data::Dumper; use Gtk2 '-init'; use Gtk2::SimpleList; use constant TRUE => 1; use constant FALSE => 0; $categories = Gtk2::SimpleList->new ('Categories' => 'text'); $categories->set_headers_visible(FALSE); @{$categories->{data}} = qw/Meat Beer Pizza Pasta Soda Juice Rabbitfoo +d/; # This turns on the tooltip event monitoring in the widget... $categories->set_has_tooltip(TRUE); # Tooltip event monitoring causes the query-tooltip signal to be emitt +ed. $categories->signal_connect (query_tooltip => sub { my ($widget, $x, $y, $keyboard_mode, $tooltip) = @_; # First, find out where the pointer is: $path = $categories->get_path_at_pos ($x, $y); # If we're not pointed at a row, then return FALSE to say # "don't show a tip". return FALSE unless $path; # Otherwise, ask the TreeView to set up the tip's area according # to the row's rectangle. $categories->set_tooltip_row($tooltip, $path); # And then load it up with some meaningful text. This is much # more interesting when you have columns that aren't visible, # or the TreeView is too narrow to see all of your column. my $index = ($path->get_indices)[0]; $tooltip->set_text(${ $categories->{data} }[$index][0]); # Return true to say "show the tip". return TRUE; }); $window = Gtk2::Window->new; $window->set_title ('SimpleList examples'); $window->signal_connect (delete_event => sub {Gtk2->main_quit; TRUE}); $window->add($categories); $window->show_all; Gtk2->main;

-Paul


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

Title:
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!
  • 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
  • Outside of code tags, you may need to use entities for some characters:
            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?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others meditating upon the Monastery: (4)
    As of 2014-09-18 01:06 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      How do you remember the number of days in each month?











      Results (103 votes), past polls