You can select or switch a theme in the painter or scripts easily, but to turn off the theme (to not use any theme), you may need to do a little bit work, especially at runtime.
To turn off the theme:
-
At design time: remove the
ApplyThememethod from the scripts first, then select "Do Not Use Themes" for the theme settings in the PowerBuilder painter, and then restart the application for the change to take effect. -
At runtime, use this workaround if you want to dynamically turn off the theme: create a custom theme that has {“drawing”:false} for every control type, and use this theme in the
ApplyThememethod.For example, to turn off the theme for all types of controls/objects, simply replace "drawing":true with "drawing":false in all occurrences in the theme file.
For another example, to turn off the theme for a specific window and all buttons and static texts in that window, use [windowname]$[controltype] to qualify the controls/objects of the same type in that window:
"w_1": { "drawing":false, ... } "w_1$commandbutton": { "drawing":false, ... } "w_1$statictext": { "drawing":false, ... }
Important
Before switching between themes or turning off the theme
through the ApplyTheme method, it is the best practice
to prompt end users to reopen the current window, in order to
refresh the UI correctly.


