Sierra & PB 5.60: Cannot disable EditorGadget

Mac OSX specific forum
User avatar
kpeters58
Enthusiast
Enthusiast
Posts: 341
Joined: Tue Nov 22, 2011 5:11 pm
Location: Kelowna, BC, Canada

Sierra & PB 5.60: Cannot disable EditorGadget

Post by kpeters58 »

Cannot disable it under OS X - all I can do to fake that, is make it read-only, which works.

Is this a bug or known limitation?
PB 5.73 on Windows 10 & OS X High Sierra
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Sierra & PB 5.60: Cannot disable EditorGadget

Post by wilbert »

As far as I know it's a OS limitation.
All you can do is disable the ability to select text.
If you wish you can combine it with a filter.
The example code below assumes the EditorGadget is gadget number 0.

Code: Select all

    BlurFilter = CocoaMessage(0, 0, "CIFilter filterWithName:$", @"CIGaussianBlur")
    BlurRadius = CocoaMessage(0, 0, "NSNumber numberWithInt:", 2)
    CocoaMessage(0, BlurFilter, "setValue:", BlurRadius, "forKey:$", @"inputRadius")
    FilterArray = CocoaMessage(0, 0, "NSArray arrayWithObject:", BlurFilter)
    
    CocoaMessage(0, GadgetID(0), "setSelectable:", #NO)
    CocoaMessage(0, GadgetID(0), "setWantsLayer:", #YES)
    CocoaMessage(0, GadgetID(0), "setContentFilters:", FilterArray)
Windows (x64)
Raspberry Pi OS (Arm64)
Post Reply