Page 1 of 1

Problem: Listicon and webgadget with #PB_Web_HtmlCode

Posted: Sat Mar 29, 2008 1:13 pm
by omit59
Having trouble with webgadget, check this:

Code: Select all

If OpenWindow(0, 0, 0, 320, 300, "ListIconGadgets", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
  ListIconGadget(0,  10,  25, 300, 100, "Column 1", 100)
  For b = 0 To 10
    AddGadgetItem(0, b, "Row " + Str(b))
  Next
    
  WebGadget(1,10,140,300,150,"")
    
  Repeat
    event = WaitWindowEvent()
    event_gadget = EventGadget()
      
    If event = #PB_Event_Gadget And event_gadget = 0
      SetGadgetItemText(1, #PB_Web_HtmlCode , "Row " + Str(GetGadgetState(0)))
    EndIf
    
  Until event = #PB_Event_CloseWindow
EndIf
Run this code and use listicon, it works ok with mouse and keyboard.
Then click webgadget with mouse left button, and after that listicon doesn't act normally anymore! It doesn't get activated, and keyboard isn't working.

So, is anyone else having same problem, or is this just me?

Timo

Posted: Sat Mar 29, 2008 9:00 pm
by Sparkie
It's not just you omit59...same problem here. I'll dig a little to see if I can figure out what's happening before mentioning the "b" word. ;)

Posted: Sat Mar 29, 2008 10:47 pm
by Sparkie
Please don't ask me to explain why....I'll just end up hurting myself :P

Code: Select all

If OpenWindow(0, 0, 0, 320, 300, "ListIconGadgets", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0)) 
  ListIconGadget(0,  10,  25, 300, 100, "Column 1", 100) 
  For b = 0 To 10 
    AddGadgetItem(0, b, "Row " + Str(b)) 
  Next 
  
  WebGadget(1,10,140,300,150,"about:blank") 
  
  Repeat 
    event = WaitWindowEvent() 
    event_gadget = EventGadget() 
    
    If event = #PB_Event_Gadget And event_gadget = 0 
      SetGadgetText(1, "about:blank")
      doit = 1
    EndIf 
    
    If EventType() = #PB_EventType_DownloadEnd And doit
      SetGadgetItemText(1, #PB_Web_HtmlCode, "Row " + Str(GetGadgetState(0))) 
      doit = 0 
    EndIf 
    
  Until event = #PB_Event_CloseWindow 
EndIf 

Posted: Sun Mar 30, 2008 9:19 am
by omit59
@Sparkie,

I'm using webgadget (which is not so clever) for my program , but it helps so much when using different colors and fonts (printing too).

So this will be a big help for me, thank You very much!

Timo