Re: Context Menu for GtkTreeView without losing the selection?

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

 



1. Connect your "button-press-event" signal handler "before" default gtk
callback
2. Return TRUE from your callback when you decided that popup menu
should appear - this will prevent selection changing

To get menu at clicking on the header you should connect to
button-press-event for header widget. For default widget you could
get_button() for GtkTreeViewColumn, either pack your own widget and
connect signal handler to it.

Ð ÐÐÐ, 25/04/2011 Ð 15:03 +0700, Lothar Scholz ÐÐÑÐÑ:
> Hello Gtk-list,
> 
> I want to add a context menu on a tree in multiple selection mode.
> Using a signal handler like this:
> 
> g_signal_connect(G_OBJECT(widget), "button_release_event", G_CALLBACK(context_menu_handler), view);
> 
> and then showing the menu via gtk_menu_popup does unfortunately
> unselect all rows except the one under the mouse (on right mouse
> button press).
> 
> How can i change this and offer a context menu for
> multiple items?
> 
> Also how can i add a context menu on the column view header?
> 
-- 
Andrew E. Makeev <andrew@xxxxxxxx>
Solvo Logistic

_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list



[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux