Re: Is Gtk2::Label clickable?



* Vasya Leushin <basileus newmail ru>:

Hi,

In my Gtk2-Perl app , I need to have something looking like Gtk2::Label,
but functioning like Gtk2::ToggleButton. Is it possible with Gtk2::Label
itself? I didn't find anything helpful in my docs. Please, help.

Since a Gtk2::Label inherits from the Gtk2::Widget class, just connect a
callback to the button-press-event, and check the Gtk2::Gdk::Event that
is passed to that callback.

I do not understand why you wish to use a label instead of a button,
though...

Ciao,
 Emmanuele.

-- 
Emmanuele Bassi (Zefram)                 [ http://www.emmanuelebassi.net ]
GnuPG Key fingerprint = 4DD0 C90D 4070 F071 5738  08BD 8ECC DB8F A432 0FF4



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]