[Gambas-devel] Creating a Control

John Leake jleake at ...741...
Mon Sep 8 15:56:43 CEST 2014


Hi Tobi,

Thank you for the response. Please do not forget I am a complete newbie
to Gambas and just trying to get bye following the docs without
bothering anyone.

>> Start
>> -----
>> 1) create a new project and set its project type to 'Graphical
>> application' and check the option 'Component programming'.
>>
> 
> No, you are not programming a component here. A component is a shared
> library which you can plug into the interpreter to add functionality.
> You don't do that here (yet?), you're just experimenting in an ordinary
> project, not a component project.

The docs say create a new project and mark its type as component. They
also say that component controls are just ordinary projects.

What should I do instead of 1) ?

> It's very natural that it is not there: your MyToggleButton is a class in
> your first project.

Again from a newbies perspective I have made a new component.  Perhaps
it should be found by Gambas (at least as a locally created new
component) where my new projects can make use of it and also where it
can be combined with additional new local controls to create more
aggregated controls.

One way of achieving this would be to have a publish function that
copies or moves the new code into the correct place for it to be picked
up along with all the existing/native controls.

> cannot be found. Your custom controls are local to your project, so to say.

How can I use my new local control an new projects ?

> If you want to use it in other projects, you can
>  - create a component, install it and plug it in (Project -> Properties ->
>    Components),

Sorry I cannot find instruction for this.

w.r.t. 5) From the docs "Each control must have an icon that will be
displayed
in the IDE control tool box.".

Shouldn't the default be images from the original control ?

Best regards,
John




More information about the Devel mailing list