Page 1 of 1
					
				Scroll bars vanish in web gadget
				Posted: Fri Jul 25, 2008 4:03 pm
				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
 
			 
			
					
				Re: Scroll bars vanish in web gadget
				Posted: Fri Jul 25, 2008 4:17 pm
				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
 
			 
			
					
				
				Posted: Fri Jul 25, 2008 4:23 pm
				by pdwyer
				Oh   
 
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  

 
			 
			
					
				
				Posted: Fri Jul 25, 2008 5:26 pm
				by .:M:.
				Lol, as luck would have it, i need it 
Thanx.
 
			 
			
					
				
				Posted: Fri Jul 25, 2008 11:26 pm
				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
			 
			
					
				
				Posted: Sat Jul 26, 2008 3:19 am
				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 
