[Gambas-user] Problem with Lock method for DrawingArea class

Benoît Minisini g4mba5 at gmail.com
Mon Jun 22 23:07:06 CEST 2020

Le 05/06/2020 à 18:22, John Rose a écrit :
> This problem is difficult to explain, so please bear with me. The idea 
> behind my app is to allow the user to select a Desktop Window. This is 
> done by having the FSelectWindow form overlay (with Opacity=35, 
> Arrangement=Vertical) the available desktop. The Select_Window form 
> contains only one control (DrawingAreaDesktop with Expand=True). This 
> results in the Drawing AreaDesktop forming a semi-opaque layer over the 
> available desktop.
> If before you run my app, you close all windows except Gambas (but not 
> full screen) and Compile All, there are no compilation errors or 
> warnings. Then run my app and click on the Select button (in the FMain 
> form), you will see that all the desktop windows (i.e. only the Gambas 
> one) are shown in a semi-opaque 'mode'. If you now click on a point in 
> an empty area, a Message Box will be displayed saying "Try again:" & 
> "Did not click on window.": caused by lines 106-107 of Sub 
> DrawingAreaDesktop_MouseUp() event. If you click on the Ok button, then 
> (with the Lock command in line 104 commented out) the Mouse_Up event is 
> entered again: this is shown by examining the Console output. To prevent 
> (re-)entry to the Mouse_Up event coding when the user clicks the Message 
> Box Ok button, I tried to use the Lock method in line 104 to prevent 
> this (re-)entry. However, I then get an error window saying "Unknown 
> symbol in 'Lock' in class 'Drawing Area' at 
> FSelectWindow.DrawingAreaDesktop - MouseUp.104 (generated by line 135) .
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----

You can lock an object by using the static method "Object.Lock". There 
is no "Lock" method in the DrawingArea class.



Benoît Minisini

More information about the User mailing list