Restored from previous forum. Originally posted by cor.
What's a good place for checking mouse events in the WaitWindowEvent loop and what type of mouse command can be used?
WaitWindowEvent loop
Repeat
Select WaitWindowEvent()
Case #PB_EventMenu
Case #PB_EventRepaint
Case #WM_CLOSE ; #PB_EventCloseWindow
Quit = 1
EndSelect
Until Quit = 1
EndIf
End
Registered user of PB
C. de Visser
Author of Super Guitar Chord Finder
http://www.ready4music.com
What's a good place for checking mouse events?
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Manolo.
Regards,
Manolo
[url]mailto:vpardo@infonegocio.com[/url]
This is the best position:What's a good place for checking mouse events in the WaitWindowEvent loop and what type of mouse command can be used?
Code: Select all
TextGadget (12, 10, #WindowHeight-50, 250, 24, "PureBasic - Gadget demonstration")
Repeat
EventID.l = WaitWindowEvent()
SetGadgetText(12, "x: "+Str(WindowMouseX())+", y: "+Str(WindowMouseY()))
If EventID = #WM_KEYUP Or EventID = #WM_KEYDOWN
SetGadgetText(12, "Key: "+Str(EventwParam()))
EndIf
If EventID = #PB_EventGadget
Select EventGadgetID()
Manolo
[url]mailto:vpardo@infonegocio.com[/url]