[Gtk-sharp-list] TreeView context menu.

Řyvind Hvamstad oyvind@hvamstad.net
19 Feb 2003 22:30:20 +0100


On Wed, 2003-02-19 at 14:31, Pablo Baena wrote:
> Make the TreeView widget catch the button_press_event signal. The
> handler method would look like this:
> 
> 
> private void OnTreeViewButtonPressEvent (object o, ButtonPressEventArgs args)
> {
> 	Gdk.EventButton eventbutton = args.Event;
>                                                                            
> 	if (eventbutton.button == 3)
> 		// make the popup display
> }
> I guess this is all you need, I didn't even work with TreeView.

That works, thanks...

Now I can't seem to make out what to do in order to Make Menu.Popup()
work. I try to do this:

System.IntPtr data = new System.IntPtr();
treeViewMenu.Popup(null. null, new Gtk.MenuPositionFunc(PosFunc), data,
0, 1);

But it only return without anything happening, I guess that the two
first parameters are optional, and since I'm doing a popup I don't need
those, The next is somewhat uncertain, But according to the source it is
a Delegate. The two next puzzels me! The last I found in a doc
somewhere, it's supposed to popdown the menu when I release the mouse
button. Can anyone explain these parameters for me?