Code: Select all
PostEvent(Event [, Window, Object [, Type [, Data]])
Can I use #PB_Ignore for this?
Code: Select all
PostEvent(#MyCustomEvent, #PB_Ignore, #PB_Ignore, #PB_Ignore, 300)
Markus
Code: Select all
PostEvent(Event [, Window, Object [, Type [, Data]])
Code: Select all
PostEvent(#MyCustomEvent, #PB_Ignore, #PB_Ignore, #PB_Ignore, 300)
Code: Select all
;-TOP
Enumeration #PB_Event_FirstCustomValue
#MyEvent_Data
EndEnumeration
Enumeration Windows
#Main
EndEnumeration
Enumeration Gadgets
EndEnumeration
Enumeration Status
#MainStatusBar
EndEnumeration
Procedure Main()
#MainStyle = #PB_Window_SystemMenu | #PB_Window_MaximizeGadget | #PB_Window_MinimizeGadget
If OpenWindow(#Main, #PB_Ignore, #PB_Ignore, 800, 600, "Window" , #MainStyle)
Debug "Constant #PB_Ignore = " + #PB_Ignore
PostEvent(#MyEvent_Data, #PB_Ignore, #PB_Ignore, #PB_Ignore, 300)
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
Case #MyEvent_Data
Debug "Window = " + EventWindow()
Debug "Gadget = " + EventGadget()
Debug "Type = " + EventType()
Debug "Data = " + EventData()
EndSelect
ForEver
EndIf
EndProcedure : Main()
Code: Select all
;-TOP
Enumeration #PB_Event_FirstCustomValue
#MyEvent_Data
EndEnumeration
Enumeration Windows
#Main
EndEnumeration
Enumeration Gadgets
EndEnumeration
Enumeration Status
#MainStatusBar
EndEnumeration
Procedure Main()
#MainStyle = #PB_Window_SystemMenu | #PB_Window_MaximizeGadget | #PB_Window_MinimizeGadget
If OpenWindow(#Main, #PB_Ignore, #PB_Ignore, 800, 600, "Window" , #MainStyle)
Debug "Constant #PB_Ignore = " + #PB_Ignore
Debug "----------------------------------"
PostEvent(#MyEvent_Data, #PB_Ignore, #PB_Ignore, #PB_Ignore, 300)
PostEvent(#PB_Event_Gadget, 1, 10, 100, 1000)
AddWindowTimer(#Main, 999, 1000)
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
Case #PB_Event_Gadget
Debug "#PB_Event_Gadget"
Debug "Window = " + EventWindow()
Debug "Gadget (Object) = " + EventGadget()
Debug "Type = " + EventType()
Debug "Data = " + EventData()
Debug "Timer (Object) = " + EventTimer()
Debug "----------------------------------"
Case #PB_Event_Timer
Debug "#PB_Event_Timer"
Debug "Window = " + EventWindow()
Debug "Gadget (Object) = " + EventGadget()
Debug "Type = " + EventType()
Debug "Data = " + EventData()
Debug "Timer (Object) = " + EventTimer()
Debug "----------------------------------"
RemoveWindowTimer(#Main, 999)
Case #MyEvent_Data
Debug "#MyEvent_Data"
Debug "Window = " + EventWindow()
Debug "Gadget (Object) = " + EventGadget()
Debug "Type = " + EventType()
Debug "Data = " + EventData()
Debug "Timer (Object) = " + EventTimer()
Debug "----------------------------------"
EndSelect
ForEver
EndIf
EndProcedure : Main()