Page 1 of 1

Sierra & PB 5.60: Cannot disable EditorGadget

Posted: Mon May 22, 2017 5:21 am
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?

Re: Sierra & PB 5.60: Cannot disable EditorGadget

Posted: Mon May 22, 2017 7:21 am
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)