[Gambas-user] Event of a runtime object

Rob sourceforge-raindog2 at ...94...
Thu Jan 8 01:33:04 CET 2004


On Wednesday 07 January 2004 19:13, -=FoX=- wrote:
>     ButtonB = NEW Button(PanelB)

How about
	ButtonB = NEW Button(PanelB) AS "ButtonB"

with all else the same.... I would have tested it except you 
didn't post enough to actually compile ;)

The following (placed in the class file of a startup form) does 
create a button at runtime and do something when you click 
it....

' Gambas class file
PUBLIC ButtonB AS Button

PUBLIC SUB Form_Open()

    buttonb = NEW button(ME) AS "ButtonB"
    buttonb.x = 10
    buttonb.y = 10
    buttonb.w = 80
    buttonb.h = 20
    buttonb.text = "foo"
    buttonb.show

END

PUBLIC SUB ButtonB_Click()
  
  Message.Info("foo")
  
END


Rob





More information about the User mailing list