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



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




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