[MonoDevelop] Can't get basic code to work

Sergio Hernandez hernandez.sergio.a at gmail.com
Wed Jul 25 19:33:06 EDT 2007


By the way, probably you want to try this so you clearly understand the order 
the events/signal occurs:

	protected virtual void OnButton1Clicked(object sender, System.EventArgs e){
		label1.Text = "Clicked";
		entry1.Text = "Clicked";}

	protected virtual void OnButton1Activated(object sender, System.EventArgs e){
		label1.Text = "Activated";
		entry1.Text = "Activated";}

	protected virtual void OnButton1Entered(object sender, System.EventArgs e){
		label1.Text = "Entered";
		entry1.Text = "Entered";}

	protected virtual void OnButton1Pressed(object sender, System.EventArgs e){
		label1.Text = "Pressed";
		entry1.Text = "Pressed";}

	protected virtual void OnButton1Released(object sender, System.EventArgs e){
		label1.Text = "Released";
		entry1.Text = "Released";}

	protected virtual void OnButton1Left(object sender, System.EventArgs e){
		label1.Text = "Left";
		entry1.Text = "Left";}

And don't forget to initialice the all the signals on Stetic.


On Wednesday 25 July 2007 13:40:38 Jeffrey Stedfast wrote:
> you probably want button.Clicked event, not Activated
>
> Jeff
>
> On Wed, 2007-07-25 at 12:23 -0700, George Lober wrote:
> > Hello,
> >
> > Sorry if this seems a bit idiotic guys but I can't even get through the
> > basic stuff.
> >
> > Using MonoDevelop/Stetic, I just have a basic window with a button,
> > label and entry widgets. I have the following attached to the button
> > buttonPressEvent:
> >
> >     protected virtual void onButtonPress (object o,
> > Gtk.ButtonPressEventArgs args)
> >     {
> >         label1.Text = "abcd";
> >         entry1.Text = "1234";
> >     }
> >
> > and this attached to the button Activated signal:
> >
> >     protected virtual void onActivated (object sender, System.EventArgs
> > e) {
> >         label1.Text = "abcd";
> >         entry1.Text = "1234";
> >     }
> >
> > When I run the app and click on the button, neither one of these is
> > working, the text does not show up in the label or the entry box. What
> > am I missing?
> >
> >
> > Thanks,
> > George
> > _______________________________________________
> > Monodevelop-list mailing list
> > Monodevelop-list at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/monodevelop-list
>
> _______________________________________________
> Monodevelop-list mailing list
> Monodevelop-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monodevelop-list




More information about the Monodevelop-list mailing list