Changing schemes on the fly (like TestaSkin)
Posted: Wed Apr 19, 2006 19:14
I would like to create an application where the look/skin can easily be changed. The application TestaSkin does this so I know it is possible.
My understanding of TestaSkin is that it creates .layout files where each widget is specified in a scheme-less manner: Button rather than TaharezLook/Button or WindowsLook/Button. For each scheme available (Horror1, Marti, TaharezLook and WindowsLook) there is a correspoding alias file (WidgetAliasesMarti.scheme for example). The application loads every scheme available and then loads one alias file, the alias file to determine which look to "activate".
Is this approach compatible with the soon to come version 0.5? And what of the Falagard system. Is there another method made available such as setFalagardScheme("scheme name")? I'm slightly confused as to how to proceed and how to effectively use the Falagard system versus the hard coded scheme/widget approach.
The FalagardDemo1 loads the VanillaSkin.scheme which specifies, among many others, WindowType="Vanilla/Titlebar" as well as TargetType="Falagard/Titlebar". Then it creates a static image with the scheme/widget syntax winMgr.createWindow("Vanilla/StaticImage"), seemingly forcing this scheme. Finally it loads the VanillaWindows.layout, which specifies widgets in the scheme/widget syntax such as <Window Type="Vanilla/StaticImage" Name="root">. The only difference with other layouts seems to be the TargetType="Falagard/Titlebar" bit.
My understanding of TestaSkin is that it creates .layout files where each widget is specified in a scheme-less manner: Button rather than TaharezLook/Button or WindowsLook/Button. For each scheme available (Horror1, Marti, TaharezLook and WindowsLook) there is a correspoding alias file (WidgetAliasesMarti.scheme for example). The application loads every scheme available and then loads one alias file, the alias file to determine which look to "activate".
Is this approach compatible with the soon to come version 0.5? And what of the Falagard system. Is there another method made available such as setFalagardScheme("scheme name")? I'm slightly confused as to how to proceed and how to effectively use the Falagard system versus the hard coded scheme/widget approach.
The FalagardDemo1 loads the VanillaSkin.scheme which specifies, among many others, WindowType="Vanilla/Titlebar" as well as TargetType="Falagard/Titlebar". Then it creates a static image with the scheme/widget syntax winMgr.createWindow("Vanilla/StaticImage"), seemingly forcing this scheme. Finally it loads the VanillaWindows.layout, which specifies widgets in the scheme/widget syntax such as <Window Type="Vanilla/StaticImage" Name="root">. The only difference with other layouts seems to be the TargetType="Falagard/Titlebar" bit.