Floating EditorGadget
Posted: Sat Jul 22, 2006 8:39 pm
i want to use the EditorGadget in a second window to display
the results of random numbers produced by clicking on a Button
on the First main window many times.
the folowing lines will only print the result of the first click
i could not display more until i close the second window and re click
on the button, indeed i have no idea about how to manage this situation
and how to access gadgets (controls) on other window from within the
main window.
thanks for any help.
[/code]
the results of random numbers produced by clicking on a Button
on the First main window many times.
the folowing lines will only print the result of the first click
i could not display more until i close the second window and re click
on the button, indeed i have no idea about how to manage this situation
and how to access gadgets (controls) on other window from within the
main window.
thanks for any help.
Code: Select all
Procedure OpenNew(rnd.l)
OpenWindow(1,30,30,250,300,"window2",#PB_Window_SystemMenu | #PB_Window_MinimizeGadget)
CreateGadgetList(WindowID(1))
EditorGadget(9, 40, 40, 300, 150)
SetGadgetText(9,Str(Int(rnd)))
Repeat
ev=WaitWindowEvent()
If EventWindow()=1
If ev=#PB_Event_Gadget Or ev=#PB_Event_CloseWindow
If ev=#PB_Event_CloseWindow
CloseWindow(1)
ProcedureReturn
EndIf
EndIf
EndIf
ForEver
EndProcedure
If OpenWindow(0,0,0,300,300,"window1",#PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
ButtonGadget(1, 50, 50, 55, 35, "windows2" )
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_Event_Gadget
Select EventGadget()
Case 1 :
rnd.l=Random(100)
OpenNew(rnd)
EndSelect
EndSelect
Until Event = #PB_Event_CloseWindow
EndIf