Skip to content

Instantly share code, notes, and snippets.

@david-hodgetts
Created December 6, 2013 09:34
Show Gist options
  • Save david-hodgetts/7821042 to your computer and use it in GitHub Desktop.
Save david-hodgetts/7821042 to your computer and use it in GitHub Desktop.
robofont script. Opens a textEditor allowing edition of CurrentFont().info.note
from vanilla import Window, SquareButton, TextEditor
import vanilla
import mojo
def onSubmit(sender):
CurrentFont().info.note = window.textEditor.get()
window.close()
if CurrentFont() is None:
vanilla.dialogs.message("there is no current font, operation aborted")
else:
window = Window((400, 400),"update info.note", minSize=(100, 100))
window.textEditor = TextEditor(posSize=(0, 0, 400, 300))
noteContent = CurrentFont().info.note or ""
window.textEditor.set(noteContent)
window.updateNoteButton = SquareButton(posSize=(0, 350, 100, 50), title="update", callback=onSubmit)
window.cancelButton = SquareButton(posSize=(110, 350, 100, 50), title="cancel", callback=lambda x: window.close())
window.open()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment