opposite of #PB_Event_ActivateWindow?
opposite of #PB_Event_ActivateWindow?
I get a window event when window comes back into focus.
How do I know that I lost the focus?
How do I know that I lost the focus?
Re: opposite of #PB_Event_ActivateWindow?
-whoops, wrong platform.
cheers
cheers
Last edited by rsts on Fri Apr 15, 2011 8:54 am, edited 1 time in total.
Re: opposite of #PB_Event_ActivateWindow?
Code: Select all
OpenWindow(0, 200, 100, 200, 180, "Focus test")
Repeat
WindowEvent = WaitWindowEvent()
Select WindowEvent
Case #PB_Event_ActivateWindow
Debug "Window received focus"
Case #PB_Event_DeactivateWindow
Debug "Window lost focus"
Case #PB_Event_CloseWindow
Break
EndSelect
ForEver
Re: opposite of #PB_Event_ActivateWindow?
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
Re: opposite of #PB_Event_ActivateWindow?
I wondered the same thing. If not in 4.6 (which I'm not using yet), must be a lib.
cheers
Re: opposite of #PB_Event_ActivateWindow?
There is no #PB_Event_DeactivateWindow in 4.60.
Re: opposite of #PB_Event_ActivateWindow?
rsts wrote:I wondered the same thing. If not in 4.6 (which I'm not using yet), must be a lib.
cheers
Did you at least try my code example?eesau wrote:There is no #PB_Event_DeactivateWindow in 4.60.

I tested it in andLinux/Kubuntu 9.04 with PB 4.51 after having observed that
receiving the focus generated an event 7 and loosing the focus event 8 in the
PB event loop. Then I opened the structure viewer and found that
#PB_Event_ActivateWindow = 7
#PB_Event_DeactivateWindow = 8
And my example runs like a charme in PB 4.41, 4.51 and 4.60 Beta 2...

Click into the demo window (received focus is reported) and then click back
into the debugger window (lost focus is reported).
#PB_Event_DeactivateWindow is even displayed in the IDE's drop down list of
PB 4.41, 4.51 and 4.60 Beta 2...
Update: Works also like a charme in Xubuntu 10.04 LTS and PB 4.51.
Last edited by Shardik on Sat Apr 16, 2011 2:11 pm, edited 1 time in total.
Re: opposite of #PB_Event_ActivateWindow?
i did.. thats why i was wondering.Shardik wrote:Did you at least try my code example?

but since its an undocumented feature, its just experimental and can change any time. lets hope they make it available for all platforms soon though.
c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
Re: opposite of #PB_Event_ActivateWindow?
I did, but I only noticed this was for Linux! I tried with Windows version, and there is no such constant defined.Shardik wrote:Did you at least try my code example?eesau wrote:There is no #PB_Event_DeactivateWindow in 4.60.![]()
Re: opposite of #PB_Event_ActivateWindow?
Doesn't work on Windows.
As eesau said, there's no such constant.
Replacing it with 8 doesn't do anything. No event.
As eesau said, there's no such constant.
Replacing it with 8 doesn't do anything. No event.
Re: opposite of #PB_Event_ActivateWindow?
But under Windows you can use a callback.TomS wrote:Doesn't work on Windows.
PB 4.51 with Windows 7 Professional & Linux Mint Julia
Re: opposite of #PB_Event_ActivateWindow?
eesau wrote:There is no #PB_Event_DeactivateWindow in 4.60.
eesau,eesau wrote:I did, but I only noticed this was for Linux! I tried with Windows version, and there is no such constant defined.Shardik wrote:Did you at least try my code example?eesau wrote:There is no #PB_Event_DeactivateWindow in 4.60.![]()
in your first posting you didn't say anything about testing my code example
in Windows. Therefore your comment in this Linux subforum that there is no
#PB_Event_DeactivateWindow (without stating that you tested the Windows
version) was misleading and wrong...
@all,
I can confirm that #PB_Event_DeactivateWindow doesn't exist in the Mac version
neither. But for Linux users it should be OK to use that flag (although then the
code won't be cross-platform anymore). It would be nice if the PB devs would
make a statement whether this flag is planned to be implemented in the Windows
and Mac version and whether this flag may be used (it's displayed in the structure
viewer and the drop down list of the Linux version, so I consider it "documented")
or if it will be declared "deprecated" in future versions...