[Gtk-sharp-list] Label PopulatePopup

underdog10 at netcourrier.com underdog10 at netcourrier.com
Mon Jul 11 17:35:20 EDT 2005


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 a statusbar, same for the image.
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:");
statuslabelconnexion.ButtonPressEvent += new ButtonPressEventHandler                 (OnLabelButtonPressEvent);
statuslabelconnexion.PopulatePopup += new PopulatePopupHandler (PopupPopupConnexion); 
statusbar.PackStart(statuslabelconnexion, 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)



More information about the Gtk-sharp-list mailing list