Addressing several objects on a form in 1 line of code
Posted
#1
(In Topic #365)
Trainee
I have this code:
Code (gambas)
- Separator1.Foreground = Color.Green
- Separator2.Foreground = Color.Green
- Separator3.Foreground = Color.Green
If it were VB5, I'd solve this problem easily:
Code (gambas)
But sadly this doesn't seem to work on Gambas…
Is there a way to call all the objects on the form with the same name but a different number?
Your help is much appreciated.
Posted
Regular

annisu said
…Is there a way to call all the objects on the form with the same name but a different number?
Yes, you probably need to use a Control Group.
Take a look at Quin's answer in this thread:-
https://forum.gambas.one/viewtopic.php?t=664
Edit: I just tried this code based on Quin's:-
…which works fine. However, I couldn't see any change when I tried to set the foreground, but that may be a separate problem.
Posted
Guru

Posted
Expert

Gambas sometimes has a property (Foreground) listed in the panel for a control (Separator) that has no effect.
I've come up against this a few times.
If there is no 'hook' in the underlying QT object for the property then neither setting it manually or using SetObject will work.
Also: In my example that Stevedee linked to there is an error
The line to control elements of a Lable should read TextLable as below.
Cheers - Quin.
I code therefore I am
I code therefore I am
Posted
Regular

Code (gambas)
- .
- .
- SetSeparatorColors( Color.Green )
- .
- .
- '========================================================
- Separator1.Foreground = ArgColor
- Separator2.Foreground = ArgColor
- Separator3.Foreground = ArgColor
- '========================================================
.... and carry a big stick!
Posted
Enthusiast

https://forum.gambas.one/viewtopic.php?f=4&t=650&sid=6fc41c5bb40bb6ce399a798aaac43ad7
Posted
Regular

Personally I use Arch and the latest update to Gambas QT4 is no longer part of Gambas. Currently it's Gambas 3.14.3. Another problem is some older programs that used strictly QT4 will no longer work with the latest version of Gambas. So my suggestion is to base your programs on GTK and not QT.
Posted
Enthusiast

So it is back to QT for now at least
Posted
Enthusiast

grayghost4 said
I am a new gambas user … I changed my program to GTk and had to change a few things … but the printer no longer prints ? I just get a blank page.
So it is back to QT for now at least
So I tried again and the reason the print was a blank page is because the printing coradanates are different
QT using 1200 dpi on my printer … But GTK uses 70 dpi on the same printer so everything was printing off of the page
Why would they uses such different values for the same printer ???
1 guest and 0 members have just viewed this.

