Page 2 of 2
Posted: Wed Mar 23, 2005 9:00 pm
by blueznl
Posted: Thu Mar 24, 2005 2:13 am
by goomoo
There is still a problem.
The WindowEvent() function eat all events that can't pass events anymore,
for example:
Code: Select all
Procedure DoEvents()
While WindowEvent():Wend
EndProcedure
OpenWindow(1,0,0,320,240,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"asdf")
CreateGadgetList(WindowID())
ButtonGadget(1,5,5,180,25,"Click me to get a msgbox!")
ListViewGadget(2,5,35,300,200)
fileNum.l=OpenFile(#PB_Any,"filelist.txt")
aline.s=ReadString()
While aline
AddGadgetItem(2,-1,aline)
aline=ReadString()
DoEvents()
Wend
Repeat
event.l=WaitWindowEvent()
If EventGadgetID()=1 And EventType()=#PB_EventType_LeftClick
; while file loading not finished,this line doesn't work
MessageRequester("asfsafd","asdfsadfa")
EndIf
Until event=#PB_Event_CloseWindow
Posted: Thu Mar 24, 2005 2:24 am
by goomoo
Or else wirte all events process in a funciton separatly,like this:
Code: Select all
Procedure processEvents(event.l)
If EventGadgetID()=1 And EventType()=#PB_EventType_LeftClick
MessageRequester("asfsafd","asdfsadfa")
EndIf
If event=#PB_Event_CloseWindow
End
EndIf
EndProcedure
OpenWindow(1,0,0,320,240,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"asdf")
CreateGadgetList(WindowID())
ButtonGadget(1,5,5,180,25,"Click me to get a msgbox!")
ListViewGadget(2,5,35,300,200)
fileNum.l=OpenFile(#PB_Any,"filelist.txt")
aline.s=ReadString()
While aline
AddGadgetItem(2,-1,aline)
aline=ReadString()
processEvents(WindowEvent())
Wend
CloseFile(fileNum)
Repeat
event.l=WaitWindowEvent()
processEvents(event)
Until event=#PB_Event_CloseWindow
Posted: Sun Aug 14, 2005 8:38 pm
by SimpleMind
Me too, Freak.
Posted: Mon Aug 15, 2005 12:25 am
by Ziltch
Have you tried Hiding the treegadget first?
Code: Select all
HideGadget(#Tree_Gadget, #True)
Update TreeGadget code ...
HideGadget(#Tree_Gadget, #False)
I found that most of the delay I was facing in updating TreeGadgets was in the redrawing.
Posted: Mon Aug 15, 2005 12:41 pm
by Num3
You can put this inside your loop, it will refresh the GUI:
Code: Select all
UpdateWindow_(WindowID(#your_window_number))
Delay(1)