[Lazarus] Showing selection on drawing under Cocoa

C Western l at c-m-w.me.uk
Sat Oct 19 13:04:10 CEST 2019


On 17/10/2019 08:09, C Western via lazarus wrote:
> On 17/10/2019 03:44, Dmitry Boyarintsev via lazarus wrote:
>> On Wed, Oct 16, 2019 at 4:33 PM C Western via lazarus 
>> <lazarus at lists.lazarus-ide.org 
>> <mailto:lazarus at lists.lazarus-ide.org>> wrote:
>>
>>     Am I missing something? How does the Cocoa toolkit expect this to
>>     be done?
>>
>> I'm see 3 ways of doing that.
>> 1) you just invalidate the needed rectangle lines (or the entire 
>> selected area) and do xor drawing  on paint event.
>
> I hadn't thought of that possibility at all - thank you! (It obviously 
> requires some work on the paint handler, but this is likely to be the 
> most straightforward.)
>
>
Sadly this doesn't work on Cocoa; it works fine under windows, but for 
Cocoa (and all the other widgetsets I tried) calling invalidate erases 
the contents of the rectangle, and I couldn't find any way to turn off 
this behavior. Unless this is possible, I will have to try a transparent 
window.

Colin




More information about the lazarus mailing list