If I create a webgadget with no constants I get scroll bars fine but if I add #PB_Web_NavigationCallback then they vanish. I can't find anything in the docs to add to OR'd constants to put them back again.
Run this to see what I mean, it's the example out of the docs with just the constant added
If OpenWindow(0, 0, 0, 600, 300, "WebGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
WebGadget(0, 10, 10, 580, 280, "http://www.purebasic.com", #PB_Web_NavigationCallback)
; Note: if you want to use a local file, change last parameter to "file://" + path + filename
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Paul Dwyer
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
pdwyer wrote:If I create a webgadget with no constants I get scroll bars fine but if I add #PB_Web_NavigationCallback then they vanish. I can't find anything in the docs to add to OR'd constants to put them back again.
Run this to see what I mean, it's the example out of the docs with just the constant added
If OpenWindow(0, 0, 0, 600, 300, "WebGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
WebGadget(0, 10, 10, 580, 280, "http://www.purebasic.com", #PB_Web_NavigationCallback)
; Note: if you want to use a local file, change last parameter to "file://" + path + filename
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
#PB__Web_NavigationCallback isn't a flag used in creating the web-gadget, it's used as a gadget attribute:
If OpenWindow(0, 0, 0, 600, 300, "WebGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
WebGadget(0, 10, 10, 580, 280, "http://www.purebasic.com")
; Note: if you want to use a local file, change last parameter to "file://" + path + filename
SetGadgetAttribute(0, #PB__Web_NavigationCallback,@yourcallback())
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
That bit of code was copied and pasted and seemed to work, I didn't know it was wrong .
We'll I know how to disable the scroll bars then if I ever need to
Paul Dwyer
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
I'd consider it a feature actually, but it looks like it works for any none 0 in the flags section, which makes me think its loading up mozilla instead.
I'm building an app in a browser and it needs to call itself since some "pages" are in sqlite. With the navigationcallback I can have a dynamic page that is created based on a query of rows and catch when some one clicks on a row link and check if it's an "internal" one and process it and stream it back to the browser gadget (rather than have the browser attempt to connect somewhere). This saves me from having to have some sort of poor mans web server in my app
Had to figure out how all this nav callback thing worked though
Paul Dwyer
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein