Page 2 of 2

Re: EditorGadGet

Posted: Mon Jul 28, 2014 5:01 pm
by Danilo
Yes, or CocoaMessage(0,GadgetID(0),"display") to force display update.

Re: EditorGadGet

Posted: Mon Jul 28, 2014 7:54 pm
by spacebuddy
Zooming text in and out is very complicated, to complicated for my head :oops:

if I zoom 0.5 a few times then set it back to 1 not zooming back properly :shock:

Re: EditorGadGet

Posted: Mon Jul 28, 2014 8:13 pm
by Danilo
Zooming with 1 does nothing. If you zoom with 0.5 for 3 times, you need to zoom with 2.0 for 3 times to go back.

For absolute Zoom values, use this, and see documentation for it:

Code: Select all

    w = GadgetWidth(0)
    h = GadgetHeight(0)
    SmallerZoom.f = 1.0 ; 1.0 = 100%
                        ; 2.0 = 2 times smaller (half size)
                        ; 0.5 = 2 times bigger (double size)
                        ; -1.0 = 100% size, and mirrored/switched
    size.NSSize
    size\width = w * SmallerZoom
    size\height = h * SmallerZoom
    CocoaMessage(0,GadgetID(0),"setBoundsSize:@",@size)
    CocoaMessage(0,GadgetID(0),"display")