Hello,
I'm trying to make an Popup when right click is pressed on a Label.
As show in the code below, the label "statuslabelconnexion" is pack in an
EventBox, and the image to the StatusBar.
When discuting on the list, it appear that you need to set an eventbox to te
label before add event, but it does'nt work?
I have made two events but i don't received any!
Could you help, please?
private Gui()
{
/// Code...
statusbar = new Statusbar ();
statusbar.Push (1, "Ready.");
statusbar.Homogeneous = false;
Label statuslabelconnexion = new Label("Active Connection:");
EventBox ebox = new EventBox ();
ebox.Add (statuslabelconnexion);
ebox.ButtonPressEvent += OnLabelButtonPressEvent;
ebox.PopulatePopup += PopupPopupConnexion;
statusbar.PackStart(ebox, false, false, 0);
Gtk.Image image1 = new Gtk.Image(Stock.No, Gtk.IconSize.SmallToolbar);
statusbar.PackStart(image1, false, false, 0);
}
private void OnLabelButtonPressEvent(object o, ButtonPressEventArgs args)
{
Gdk.EventButton eb = args.Event;
#if ( DEBUG )
Console.WriteLine ("Button OnLabelButtonPressEvent click");
#endif
switch (args.Event.Button)
{
case 3:
PopupPopupConnexion2(args.Event);
break;
case 1:
#if ( DEBUG )
Console.WriteLine ("First OnLabelButtonPressEvent click");
#endif
break;
}
}
private void PopupPopupConnexion(object o, PopulatePopupArgs args)
{
#if ( DEBUG )
Console.WriteLine ("In PopupPopupConnexion!");
#endif
PopupPopupConnexion2(null);
}
private void PopupPopupConnexion2 (EventButton ev)
{
#if ( DEBUG )
Console.WriteLine ("In PopupPopupConnexion2!");
#endif
}
-------------------------------------------------------------
NetCourrier, votre bureau virtuel sur Internet : Mail, Agenda, Clubs, Toolbar...
Web/Wap : www.netcourrier.com
Téléphone/Fax : 08 92 69 00 21 (0,34 TTC/min)
Minitel: 3615 NETCOURRIER (0,16 TTC/min)
_______________________________________________
Gtk-sharp-list maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list