objective c - How can I make an NSTextField that has focus redraw itself? -
i've subclassed , defined own custom nsformatter , nstextfield classes in order display smpte time code values (hh:mm:ss:ff
). when user selects use drop-frame fps value, format changes hh:mm:ss;ff
(semi-colon @ end). have working except 1 final hurdle.
when changing format, nstextfield focus not update it's display until it's focus lost. here screenshot illustrate:
i have tried sending nstextfield setneedsdisplay
message when format changed, sending display
message. nothing seems work far, , text field focus refuses update/redraw until loses focus.
any suggestions of need make happen?
i did manage solve problem now. may bit of hack, ended doing retrieving nstextfield
's field editor currenteditor
, sending object posted notification when format changes.
with field editor had replacecharactersinrange:withstring:
change last ":" ";" , vice-versa. though may not optimal, works perfectly.
in fact, i've posted solution github else might find useful. https://github.com/cfloisand/smpteformatter
Comments
Post a Comment