[Gambas-user] How to soft depend on gambas3-gb-qt4-webkit

Benoît Minisini gambas at ...1...
Wed Dec 16 23:58:09 CET 2015


Le 16/12/2015 19:02, Geoffrey De Belie a écrit :
> Hi,
>
>
>
> I make use of the gambas3-gb-qt4-webkit component for showing Help
> pages (HTML).
>
>
>
> However, I would like to soft depend on this component. Pseudo-code:
>
>
>
> If componentIsInstalled("gambas3-gb-qt4-webkit") Then
>
> 'use it
>
> Else
>
> 'open the HTML pages in the default browser using xdg-open
>
> EndIf
>
>
>
> The reason I want to do this, is that I still would like to provide
> the GTK interface next to the Qt interface (using gb.gui).
>
> gambas3-gb-qt4-webkit depends on qt4, and if you depend on qt4 you
> can't have gb.gui for easy interface switching.
>
>
>
> A solution would be welcome.
>
>
>
> Kind regards,
>
> Geoffrey De Belie
>

Don't check the component in your project, and the first time you need 
it, load it dynamically with Component.Load(). If the method fails, note 
in a variable that you will have to use Desktop.Open().

Regards,

-- 
Benoît Minisini




More information about the User mailing list