Page 1 of 1

WebViewGadget and DialogXML library

Posted: Fri Dec 29, 2023 11:16 pm
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.

Re: WebViewGadget and DialogXML library

Posted: Sat Dec 30, 2023 5:49 am
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

Re: WebViewGadget and DialogXML library

Posted: Sat Dec 30, 2023 6:30 am
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:

Re: WebViewGadget and DialogXML library

Posted: Sat Dec 30, 2023 9:42 am
by Fred
I will add it, thanks

Re: WebViewGadget and DialogXML library

Posted: Sat Dec 30, 2023 3:17 pm
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: