for a project I need a webgadget that shows a site, which is built by myself.
See the example:
Code: Select all
Define html$
html$ + "<html>"
html$ + "</head>"
html$ + "<body>"
html$ + "<pre>" ; ####!!!!####
html$ + "<code>" ; ######
html$ + "<i><p>Test</p></i>"
html$ + "<p> 2. <b>Zeile</b> angefuegt<p>"
html$ + "<p>Versuche <a href='http://www.purebasic.com/' target='_blank'>PureBasic</a> zu erreichen.<p>"
html$ + "<code>" ; ######
html$ + "</pre>" ; ####!!!!####
html$ + "</body>"
html$ + "</html>"
; this part because the flag >#PB_Web_HtmlCode< is not available on Mac OS
CreateFile( 0, GetCurrentDirectory() + "test.html" )
WriteString( 0, html$, #PB_UTF8)
CloseFile( 0 )
If OpenWindow(0, 0, 0, 600, 300, "WebGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
URL$ = "file://" + GetCurrentDirectory() + "test.html"
; URL$ = "http://www.purebasic.com"
Debug URL$
CompilerIf #PB_Compiler_Unicode
AsciiURL$ = Space(Len(URL$))
PokeS(@AsciiURL$, URL$, -1, #PB_Ascii)
URL$ = AsciiURL$
CompilerEndIf
WebGadget(0, 10, 10, 580, 280, URL$)
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIfTwo possibilities should enter: either the standard browser will start and show the linked site, or the link I clicked on will be shown within the webgadget. I prefer the first option.
But if I change the url (comment out the corresponding line), all will work well.
Any idea? Can someone help?


