Where is my Event ???

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Skipsy.

Hi,

The following line are supposed to display something as soon as
the window is moved :

Repeat
EVT_WIND.l = WaitWindowEvent()
If EVT_WIND = #PB_Event_MoveWindow
Gosub Display
EndIf
If EVT_WIND = #PB_Event_CloseWindow ; Bouton 'fermer'
Quit = 1
EndIf
Until Quit = 1
End

Nothing happens.... 'Display' Subroutine works fine (if I move
the gosub out of the If-EndIf.

Something I misunderstood ???
;-)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tinman.
Originally posted by Skipsy

Something I misunderstood ???
You will probably need to include something to handle the repaint event. This tells your program to redraw whatever you have in the window.

If EVT_WIND = #PB_Event_Repaint
Gosub Display
EndIf



--
It's not minimalist - I'm increasing efficiency by reducing input effort.
(Win98first ed. + all updates, PB3.51, Ed3.53)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Skipsy.

Works fine now thanks but... well, I don't understand something
anyway :
I have replaced the #PB_Event_Repaint by #PB_Event_MoveWindow
again and set a "breakpoint" just before the 'Gosub' instruction.

Nothing happens when I drag the window everywhere on the screen !!!
Obviously it does not detect the move or "MoveWindow" means
something else (?)

WW
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tinman.
Originally posted by Skipsy

Nothing happens when I drag the window everywhere on the screen !!!
Obviously it does not detect the move or "MoveWindow" means
something else (?)
I have the same here, but I have never used the MoveWindow event before so I am not sure if there is anything special you need to do, or if I done something wrong in the code.


--
It's not minimalist - I'm increasing efficiency by reducing input effort.
(Win98first ed. + all updates, PB3.51, Ed3.53)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

See here for the correct method:

viewtopic.php?t=2575
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by plouf.

Seems tha move is only catchable inside a callback
dunno why

Christos
Post Reply