[Gambas-user] Control sizes with GTK get enlarged
Benoît Minisini
g4mba5 at gmail.com
Mon Jan 3 19:43:58 CET 2022
Le 03/01/2022 à 19:14, Bruce Steers a écrit :
>
> Yes. By default the size of controls is proportional to the font height.
>
> So if you run the IDE with QT and the project with GTK+, and if the
> GTK+
> font is bigger than the QT one, it happens.
>
> Regards,
>
>
> But my controls have no font and do not auto-resize for text (or anything)
> It it some sort of internal scaling factor that can be disabled?
> It's for a DrawingArea that writes (and rotates) an image, correct size
> was kinda needed. (although i figured a workaround)
>
> At runtime if i set the controls to be 128x128 they set that size.
>
> Will i have to set everything manually at runtime if i want to ensure
> required dimensions are met?
>
> Many thanks
> BruceS
>
That behaviour is defined by the virtual "Scaled" property of a Form.
If set, all controls dimensions are proportional to the font height.
(i.e. the IDE internally divides the pixel value by 'Desktop.Scale'
before saving the form).
If unset, all controls dimensions are absolute.
If you need absolute control dimensions when making GUI, there is 99%
chance that you make something wrong.
At runtime, you have the Move() / Resize() methods that are absolute,
and MoveScaled() / ResizeScaled() that are proportional to 'Desktop.Scale'.
Regards,
--
Benoît Minisini
More information about the User
mailing list