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

Geoffrey De Belie computergeoffrey at ...3367...
Thu Dec 17 10:43:43 CET 2015


I get "invalid identifier WebView" when trying to run the software without gambas3-gb-qt4-webkit:

in the HelpBrowser class:
Private Sub GetView() As WebView
  
  Try Return tabBrowser[tabBrowser.Index].Children[0]
  
End

in the Main class meanwhile:
Public Sub OpenHelp()
    
    Component.Load("gb.gui.qt.webkit")
    HelpBrowser.Show()
    Catch
        Desktop.Open("./help/index.html")
    
End

Kind regards,
Geoffrey De Belie

 ---- On do, 17 dec 2015 09:57:48 +0100 Geoffrey De Belie <computergeoffrey at ...3367...> wrote ---- 
 > That works, thank you.
 > 
 > ---- On wo, 16 dec 2015 23:58:09 +0100 Benoît Minisini <gambas at ...1272......>wrote ---- 
 > 
 >  > 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