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:

changing drop-frame format

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

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -