Xojo - some pieces 4u
ready to use
Linux: GTK3 Style Controls Example 0.5.0
This example Xojo project shows how one can style Controls using CSS in Xojo-built Applications
Since 2017r2, Xojo uses GTK3 for Linux. The default GTK3 Controls are quite big. That makes a cross platform layout quite difficult. If you need the Controls to be smaller, this is possible with this customization.
This example is trying to just set a minimal amount of styles, so that Controls can be sized at Height=26 and look good on most Linux distributions
This is achieved in two steps: A global theme, and some tweaks for a couple of Controls.
How and where
- 1. App.Open -> modGTK3.InitGlobalGTK3Style()
- 2. Control.Open -> me.InitGTK3Control()
modGTK3 extends this Method for Controls. In this example project, it's called from Control Subclasses. Subclassing your Controls is highly recommended, as you get a single place for tweaks and workarounds for different XojoVersions or BuildTargets.
Many thanks to Jim McKay for digging in the deeper details providing the CSS live editor, which makes it so much more convenient to try different style adjustments.
The default GTK3 Controls are quite big - if you need them smaller, this is possible with this customization.
back to overview