[4.20 Bêta 4] Webgadget et DownloadStart et DownloadEnd

Archive.
nico
Messages : 3702
Inscription : ven. 13/févr./2004 0:57

[4.20 Bêta 4] Webgadget et DownloadStart et DownloadEnd

Message par nico »

Essayer ce code suivant, il se passe des trucs bizarre, on a deux events DownloadStart et DownloadEnd une avec l'ancienne page et une autre avec la nouvelle, c'est pas normal!!??

Code : Tout sélectionner

  If OpenWindow(0,0,0,600,400,"WebGadget",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
    CreateGadgetList(WindowID(0))
    WebGadget(0,10,10,580,280,"about:blank")
    ButtonGadget(1,100,300,200,20,"Go Forum")
    
    Repeat 
    event= WaitWindowEvent()
    Select event
        Case  #PB_Event_Gadget
            Select EventGadget()
                Case 0
                    Select EventType()
                        Case #PB_EventType_DownloadStart 
                            Debug "DownloadStart"
                            Url.s= GetGadgetText(0)
                            Debug Url  ;???

                            
                        Case #PB_EventType_DownloadEnd 
                            Debug "DownloadEnd"
                            Url.s= GetGadgetText(0)
                            Debug Url  ;???
                    EndSelect 
                    
                Case 1
                    SetGadgetText(0,"http://www.purebasic.com")
           EndSelect 
         Case #PB_Event_CloseWindow
            Quit=1
    EndSelect   
    Until Quit=1
  EndIf