Lord wrote:On Linux, this doesn't work either.
I have tested your example and my example on Ubuntu 12.04 x64 with PB 4.61 x64 and they both work as described and expected. Tomorrow at work I also will test on an Ubuntu 12.04 x86 system with PB 4.61 and PB 5.00 Beta 2...
Update: I have tested both examples also on Ubuntu 12.04
x86 and they work as expected. Did you run checkinstall.sh on your Ubuntu installation to check if all dependancies are installed? Did you try your examples on Ubuntu running in a virtual machine? This could perhaps explain your problems. All my tests were done with Ubuntu x86 and x64 installations running natively on real hardware...
Lord wrote:And if you try this on Windows, you never can leave the Canvas.
That's correct. Windows and Linux seem to behave differently in this respect.
In Windows you have to change my posted example to
Code: Select all
OpenWindow(0, 10, 10, 400, 400, "Cursor is captured! Click button to leave!")
CanvasGadget(0, 5, 5, 390, 390, #PB_Canvas_Border)
SetGadgetAttribute(0, #PB_Canvas_Clip, #True)
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
Case #PB_Event_Gadget
If EventType() = #PB_EventType_LeftClick
SetGadgetAttribute(0, #PB_Canvas_Clip, #False)
EndIf
EndSelect
ForEver
in order to allow the cursor to leave the CanvasGadget after a left button click whereas in Linux this seems to work without the additional code...