Scroll bars vanish in web gadget

Just starting out? Need help? Post your questions and find answers here.
User avatar
pdwyer
Addict
Addict
Posts: 2813
Joined: Tue May 08, 2007 1:27 pm
Location: Chiba, Japan

Scroll bars vanish in web gadget

Post by pdwyer »

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

Code: Select all

  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
User avatar
Demivec
Addict
Addict
Posts: 4282
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: Scroll bars vanish in web gadget

Post by Demivec »

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

Code: Select all

  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:

Code: Select all

   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
User avatar
pdwyer
Addict
Addict
Posts: 2813
Joined: Tue May 08, 2007 1:27 pm
Location: Chiba, Japan

Post by pdwyer »

Oh :oops:

That bit of code was copied and pasted and seemed to work, I didn't know it was wrong :oops: .

We'll I know how to disable the scroll bars then if I ever need to 8)
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
.:M:.
New User
New User
Posts: 7
Joined: Sun Jul 20, 2008 7:34 am

Post by .:M:. »

Lol, as luck would have it, i need it :-)

Thanx.
User avatar
idle
Always Here
Always Here
Posts: 6045
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Post by idle »

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.

#PB_Web_Mozilla = 1
User avatar
pdwyer
Addict
Addict
Posts: 2813
Joined: Tue May 08, 2007 1:27 pm
Location: Chiba, Japan

Post by pdwyer »

I was working off this for those that want/need a little more info http://www.purebasic.fr/english/viewtop ... oncallback

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
Post Reply