[Gtk-sharp-list] Label PopulatePopup

underdog10 at netcourrier.com underdog10 at netcourrier.com
Tue Jul 12 17:13:47 EDT 2005


Hi,

I have test it, and i find that on Win32 this code is not compiling with MS csc. When using mono 1.1.x, it does compile but don't work on Win32.
In both the code is not working using Sharpdevelop.
I have no idea how this could happen since it is the code?
When comiling from cygwin using Makefile. It does compile and work.

Also i try our test.cs and you are right it is working.

I get it to work only when i get this warning.

(<unknown>:1600): GLib-CRITICAL **: g_convert: assertion `str != NULL' failed

Thanks

----Message d'origine----
>Sujet: Re: [Gtk-sharp-list] Label PopulatePopup
>De: Fredrik Nilsson <jymdman at home.se>
>A: underdog10 at netcourrier.com
>Date: Tue, 12 Jul 2005 14:48:54 +0200
>
>Hi,
>
>The attached file work for me with mono 1.1.8 and gtk-sharp from svn
>on my suse 9.3 box.
>
>Compile with:   mcs test.cs -pkg:gtk-sharp-2.0 -define:DEBUG
>
>
>/Fredrik
>
>tis 2005-07-12 klockan 14:26 +0200 skrev underdog10 at netcourrier.com:
>> 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  -  Gtk-sharp-list at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
>> 
>
>

-------------------------------------------------------------
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