WebViewGadget and DialogXML library

Just starting out? Need help? Post your questions and find answers here.
boddhi
Enthusiast
Enthusiast
Posts: 524
Joined: Mon Nov 15, 2010 9:53 pm

WebViewGadget and DialogXML library

Post by boddhi »

Hello,

Silly question: Is it possible to create a WebViewGadget with the DialogXML lib?
Has this feature also been included in version 6.10b1?

Thanks.
If my English syntax and lexicon are incorrect, please bear with Google translate and DeepL. They rarely agree with each other!
Except on this sentence...
wombats
Enthusiast
Enthusiast
Posts: 720
Joined: Thu Dec 29, 2011 5:03 pm

Re: WebViewGadget and DialogXML library

Post by wombats »

It didn't work when I tried "webview" in the XML.

You can add it manually to a dialog with a little bit of work:

Code: Select all

#Dialog = 0
#XML = 0

Procedure OnContainerResized()
  ResizeGadget(1, #PB_Ignore, #PB_Ignore, GadgetWidth(0), GadgetHeight(0))
EndProcedure

XML$ = "<window id='#PB_Any' name='test' text='test' minwidth='320' minheight='240' flags='#PB_Window_ScreenCentered | #PB_Window_SystemMenu | #PB_Window_SizeGadget'>" +
       "  <container id='0' flags='#PB_Container_BorderLess'/>" +
       "</window>"

If ParseXML(#XML, XML$) And XMLStatus(#XML) = #PB_XML_Success
  
  If CreateDialog(#Dialog) And OpenXMLDialog(#Dialog, #XML, "test")
    
    BindGadgetEvent(0, @OnContainerResized(), #PB_EventType_Resize)
    
    OpenGadgetList(0)
    WebViewGadget(1, 0, 0, 320, 240)
    CloseGadgetList()
    
    Define html$ = ~"<html><head></head><body><p style=\"color:blue;\">WebView</p></body></html>"
    
    SetGadgetText(1, html$)
    
    Repeat
      Event = WaitWindowEvent()
    Until Event = #PB_Event_CloseWindow 
    
  EndIf
  
EndIf
boddhi
Enthusiast
Enthusiast
Posts: 524
Joined: Mon Nov 15, 2010 9:53 pm

Re: WebViewGadget and DialogXML library

Post by boddhi »

@wombats

Thanks for your response .
I know your tip :wink:
wombats wrote: It didn't work when I tried "webview" in the XML.
Unfortunately, I tried too with no result. :wink:

I had hope/I'm still hoping that a member of the team will come and tell us that this was planned before the final release. :mrgreen:
If my English syntax and lexicon are incorrect, please bear with Google translate and DeepL. They rarely agree with each other!
Except on this sentence...
Fred
Administrator
Administrator
Posts: 18351
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: WebViewGadget and DialogXML library

Post by Fred »

I will add it, thanks
boddhi
Enthusiast
Enthusiast
Posts: 524
Joined: Mon Nov 15, 2010 9:53 pm

Re: WebViewGadget and DialogXML library

Post by boddhi »

Fred wrote: Sat Dec 30, 2023 9:42 am I will add it, thanks
Disclaimer : Message for adults and children over 6 years

Somebody lied to me? Does Santa really exist? :mrgreen:

Merci Fred et l'équipe.
Excellentes fêtes de fin d'année. :wink:
If my English syntax and lexicon are incorrect, please bear with Google translate and DeepL. They rarely agree with each other!
Except on this sentence...
Post Reply