Where to set Application.Theme?

New to Gambas? Post your questions here. No question is too silly or too simple.
Post Reply
JumpyVB
Posts: 75
Joined: Friday 11th September 2020 9:09am

Where to set Application.Theme?

Post by JumpyVB »

I can't find the right way to change the icon theme.
Here are the steps to reproduce the problem
1) New project > Graphical application
2) Add Button1 with Picture "icon:/small/floppy"
3) Try to set icon theme:
Public Sub Form_BeforeArrange()
  Application.Theme = "Gambas"
  ' Application.Theme = "Gambas-Mono"
  ' Application.Theme = "Adwaita"
  ' Application.Theme = "Papirus"
End
4) Yeat default theme from desktop environment is show on Button1 when application is run
wrongicon.png
wrongicon.png (19.22 KiB) Viewed 920 times
PS: I am running Linux Mint 21.1 Cinnamon 5.6.8
User avatar
thatbruce
Posts: 168
Joined: Saturday 4th September 2021 11:29pm

Re: Where to set Application.Theme?

Post by thatbruce »

It has to be done early, like in the main form _init or likewise.
BTW, you only get one shot, if you miss then you're stuck with whatever is loaded by default.
b
Have you ever noticed that software is never advertised using the adjective "spreadable".
JumpyVB
Posts: 75
Joined: Friday 11th September 2020 9:09am

Re: Where to set Application.Theme?

Post by JumpyVB »

Thank you.
Static Public Sub _init()
  Application.Theme = "Gambas"
  ' Application.Theme = "Gambas-Mono"
  ' Application.Theme = "Adwaita"
  ' Application.Theme = "Papirus"
End
Post Reply