[Gambas-user] Custom controls

Aaron Peachey alpeachey at ...626...
Sun Jan 17 06:05:09 CET 2010


Hi all,
I'm just learning Gambas and trying to do something simple (I thought) 
by making custom versions of controls.

For example, I want to inherit the Label and TextBox controls to add 
some new properties and methods.
As a basic example, in my program the labels for mandatory fields are a 
different font/colour to the non-mandatory field labels. To achieve this 
(in wxPython) I have simply inherited the Label control and added a new 
variable 'isMandatory' to pass to the constructor which is then used to 
determine the font/colour of the label.

I've searched everywhere trying to find out how to do this and come up 
with very little on how to do this. Can anyone point me in the right 
direction please?

Also, once I have created custom controls (one step at a time, i 
know...), can I get them into the Gambas GUI toolbox so I can drag them 
onto forms etc. or do I need to add them to their parents programatically?

thanks
Aaron




More information about the User mailing list