[Gambas-user] Control class missing a name and type property. ;)

Rob sourceforge-raindog2 at ...94...
Tue Aug 26 17:59:47 CEST 2003


On Tuesday 26 August 2003 10:10, R Onstenk wrote:
> When I put a control on a form it's background is transparent.
> (textlabel) When I set a background color on it it shows nice
> but then I decide it must be the same as the form. How to set
> background transparent again?

Gambas uses Qt for all its controls, and Qt doesn't support 
transparent labels.  There are a number of workarounds for C++ 
programmers in Qt but we don't know yet whether any of them will 
be suitable for inclusion in Gambas.  What looks like 
transparency when you initially place the control is just an 
illusion caused by the form background being the same color as 
the control background.

> When I can use For Each how do I determine which control I
> have. In my example the ctrl should have at least a name
> property. It should have also a property which provide the
> Class or Type of the control.

I agree, Gambas is missing those two properties in a big way.  As 
a workaround you can use the Tag property to store whatever 
identifying information you need.  Unfortunately, this is about 
the third or fourth workaround that uses the Tag property... 
pretty soon Benoit's gonna have to make Tag a variant so we can 
store user-defined classes in there, with all the stuff we're 
jamming into that one property ;)

Now, ContainerChildren is a collection so maybe there's a way to 
somehow get a list of keys out of it (they should be strings) 
and maybe those keys will be useful in identifying controls.  I 
haven't figured out how to do that though.

Neither of those problems has prevented me from doing what I need 
to do with Gambas, thus far.

Rob





More information about the User mailing list