[Gambas-user] Making an app gtk/qt switchable
Tony Morehen
tmorehen at ajm-software.com
Sat Nov 14 23:04:00 CET 2020
One way would be to use a two stage approach to starting your programs.
The first stage would be a stub program, and could be written in gambas
or even a bash script. It would run the second stage program, compiled
with gb.gui, with the appropriate environment variable set.
The launcher program could be written generically, looking at arg[0] to
get the name of the second stage program to run ie launcher is named
gbApp.gambas and stage 2 is gbApp1.gambas
gbApp, at its simplest:
Shell "GB_GUI=" & Application.Args[1] & " " &
Replace(Application.Args[0],".gambas","1.gambas")
On 2020-11-14 2:34 p.m., Bruce Steers wrote:
> Greetings all.
> I'm trying to set an arg/option in my app to choose gui system.
>
> I've added an arg --gui with options gtk gtk3 qt4 or qt5.
>
> It has a Startup.module before FMain where the arg is read
> then..
> Env["GB_GUI"] = "gb." & LCase(sGuiArg)
>
> But it don't work :(
>
> so i thought i could use Component.Load("gb." & LCase(sGuiArg))
> which i guess i could if i could remove the default bg.gui component
> in the IDE but i can't, gotta have one of them.
> Loading the component gives a segmentation 11 fault.
> And there does not seem to be a Component.Unload() option.
>
> I'm out of ideas...
> Is it even possible to do?
> Cheers
> BruceS
>
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20201114/31f233f7/attachment.htm>
More information about the User
mailing list