[Gtk-sharp-list] TreeView context menu.

Pablo Baena pbaena@uol.com.ar
21 Feb 2003 01:57:22 +0000


--=-SIL6/H+55w0vlSk573ke
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

>From memory, I think Popup is a signal/event not a method to show a
popup menu.

Take a look at the Gtk reference for the description of the arguments.

Pablo

On Wed, 2003-02-19 at 21:30, Řyvind Hvamstad wrote:

> 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?
> 
> _______________________________________________
> Gtk-sharp-list maillist  -  Gtk-sharp-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

-- 
Pablo Baena <pbaena@uol.com.ar>

--=-SIL6/H+55w0vlSk573ke
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/1.1.7">
</HEAD>
<BODY>
>From memory, I think Popup is a signal/event not a method to show a popup menu.<BR>
<BR>
Take a look at the Gtk reference for the description of the arguments.<BR>
<BR>
Pablo<BR>
<BR>
On Wed, 2003-02-19 at 21:30, &#216;yvind Hvamstad wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE><FONT COLOR="#737373" SIZE="3"><I>On Wed, 2003-02-19 at 14:31, Pablo Baena wrote:
&gt; Make the TreeView widget catch the button_press_event signal. The
&gt; handler method would look like this:
&gt; 
&gt; 
&gt; private void OnTreeViewButtonPressEvent (object o, ButtonPressEventArgs args)
&gt; {
&gt; 	Gdk.EventButton eventbutton = args.Event;
&gt;                                                                            
&gt; 	if (eventbutton.button == 3)
&gt; 		// make the popup display
&gt; }
&gt; 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?

_______________________________________________
Gtk-sharp-list maillist  -  Gtk-sharp-list@lists.ximian.com</FONT>
<A HREF="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list"><FONT SIZE="3">http://lists.ximian.com/mailman/listinfo/gtk-sharp-list</I></FONT></A></PRE>
</BLOCKQUOTE>
<PRE><TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
-- <BR>
Pablo Baena &lt;<A HREF="mailto:pbaena@uol.com.ar">pbaena@uol.com.ar</A>&gt;
</TD>
</TR>
</TABLE>
</PRE>
</BODY>
</HTML>

--=-SIL6/H+55w0vlSk573ke--