Re: Dropdown menu on treeview



On Sun, 2006-09-10 at 11:09 +0200, Dieter Schicker wrote:
Hi,

I want to popup a dropdown menu when the user right clicks on a row in
the treeview but I can't find information about that in the docs.

There should be a FAQ on this, as it has been discussed on this very
mailing list some times already:

  http://mail.gnome.org/archives/gtk-perl-list/2004-July/msg00140.html
  http://mail.gnome.org/archives/gtk-perl-list/2003-December/msg00018.html
  http://mail.gnome.org/archives/gtk-perl-list/2004-July/msg00162.html

Use the "button-press-event" to catch the button, get the row/column
pair using Gtk2::TreeView::get_row_at_pos() using the event coordinates,
build a Gtk2::Menu and then use Gtk2::Menu::popup() on it.

Ciao,
 Emmanuele.

-- 
Emmanuele Bassi,  E: ebassi gmail com
W: http://www.emmanuelebassi.net
B: http://log.emmanuelebassi.net




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