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

For example, you have to:

1) Create a class named "MyLabel" in your project.
2) Use "INHERITS Label".

But you have to use it manually, and you won't see it in the IDE toolbox.

If you want that, you have to create a component, as explained in the link 
provide by nospam x 3.

Regards,

-- 
Benoît Minisini

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to