WebGadget() - "file://"

Mac OSX specific forum
User avatar
J. Baker
Addict
Addict
Posts: 2178
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

WebGadget() - "file://"

Post by J. Baker »

Unable to load html files in the webgadget.
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef

Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT


Even the vine knows it surroundings but the man with eyes does not.
jesperbrannmark
Enthusiast
Enthusiast
Posts: 536
Joined: Mon Feb 16, 2009 10:42 am
Location: sweden
Contact:

Re: WebGadget() - "file://"

Post by jesperbrannmark »

But.... without testing this..... Isn't this exactly how the Purebasic Help works? Isn't that a webgadget with a local file?
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: WebGadget() - "file://"

Post by IdeasVacuum »

...on Windows the Help files are Microsoft .chm (Compiled HTML). They are displayed by the default Windows chm viewer.

Try passing the full path of the file to the WebGadget, excluding "file://"
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Fred
Administrator
Administrator
Posts: 16617
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: WebGadget() - "file://"

Post by Fred »

Yes, the help on OS X use the webgadget() with local files
jesperbrannmark
Enthusiast
Enthusiast
Posts: 536
Joined: Mon Feb 16, 2009 10:42 am
Location: sweden
Contact:

Re: WebGadget() - "file://"

Post by jesperbrannmark »

Code: Select all

OpenWindow(0,0,0,640,480,"")
WebGadget(0,0,0,640,480,"file://"+GetTemporaryDirectory()+"output.html")
Repeat
Until WaitWindowEvent()=#PB_Event_CloseWindow
this works fine for me...
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: WebGadget() - "file://"

Post by IdeasVacuum »

...could the issue be the files themselves? Perhaps they are HTML5 and the webgadget cannot interpret them?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
J. Baker
Addict
Addict
Posts: 2178
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Re: WebGadget() - "file://"

Post by J. Baker »

Yeah, it was a HTML5 file.
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef

Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT


Even the vine knows it surroundings but the man with eyes does not.
collectordave
Addict
Addict
Posts: 1309
Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal

Re: WebGadget() - "file://"

Post by collectordave »

Having the same trouble with local files.

The web gadget displays them correctly in the windows version (win xp and win 7.0) but not on the mac.

Is the HTML 5 issue only on the mac?

CD
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
Wolfram
Enthusiast
Enthusiast
Posts: 567
Joined: Thu May 30, 2013 4:39 pm

Re: WebGadget() - "file://"

Post by Wolfram »

Maybe a problem with the path.
macOS Catalina 10.15.7
collectordave
Addict
Addict
Posts: 1309
Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal

Re: WebGadget() - "file://"

Post by collectordave »

Found the problem.

The file I was attempting to load had spaces in. Changed all these to %20 and It worked.

CD
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
Wolfram
Enthusiast
Enthusiast
Posts: 567
Joined: Thu May 30, 2013 4:39 pm

Re: WebGadget() - "file://"

Post by Wolfram »

Thats what I mean...
You can try the URLEncoder(URL$ [, Format]) to encode the path to a URL.
macOS Catalina 10.15.7
collectordave
Addict
Addict
Posts: 1309
Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal

Re: WebGadget() - "file://"

Post by collectordave »

URLencoder worked first time. No problems on either platform now.

Must be getting old used that before and forgot.

Thanks for replies.

CD
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
Post Reply