[Gambas-user] Making an app gtk/qt switchable

Bruce Steers bsteers4 at gmail.com
Sun Nov 15 02:58:53 CET 2020


Thanks Tony , yes I'm heading this way maybe just the app relaunching
itself, i've a few apps do that for various reasons.
I was anware of just using an env command before starting an app, that
little titbit had escaped me :)

I'm looking at the Application.Restart property now.
Does anybody here have any resources using this property?

I've seen it set in the gambas3 ide code but not seen how the setting is
used afterwards?
hoping it might perform a nicer restart than i might.


On Sat, 14 Nov 2020 at 22:05, Tony Morehen <tmorehen at ajm-software.com>
wrote:

> 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 ]----
>
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20201115/0b7885b6/attachment.htm>


More information about the User mailing list