Re: "clicked" signal on a selected row in a TreeView



I'm doing this in gnomeicu (CVS HEAD), and it works with one minor
problem... it calls the menu, then changes the selection... so at start,
nothing's selected.. i click on A.. no menu.. i click on B, menu comes
up for A.. i click row C, i get a menu like i clicked on B.. i click on
C again, i get C... i tried changing the signal in glade to be "After",
but then no menu whatsoever...

Ideas?

Thanks!

Jeremy Wise
GnomeICU Team

On Mon, 2002-07-01 at 23:04, James M. Cape wrote:
On Sat, 2002-06-29 at 14:41, Tilman Sauerbeck wrote:
Hi all,
in my app, I have a GtkTreeView widget with which I'd like to do the following:
If the user clicks the right mouse button on a selected row, a popup menu appears.

Now my problem is to catch that "clicked" signal, as I don't know to which widget I have to set the 
signal handler to.
I tried to connect it to the TreeView, the TreeModel and even the TreeStore :)

Any hint is greatly appreciated.

Regards,
Tilman

For what you want to do (context menu), the previous answer of
button_press_event was the best solution.

However, for the peanut gallery who may be reading, in general,
GtkTreeSelection's "changed" signal is the way to go when you want to do
things when a GtkTreeView's selection has changed.

(IIRC, the function(s) are):

sel = gtk_tree_view_get_selection (view);
g_signal_connect (sel, "changed", some_func, user_data);

Peace,

    Jim Cape
    http://ignore-your.tv/

    "No cause, no God, no abstract idea can justify the mass
     slaughter of innocents."
        -- Edward Said

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
-- 




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