Created
December 6, 2013 09:34
-
-
Save david-hodgetts/7821042 to your computer and use it in GitHub Desktop.
robofont script. Opens a textEditor allowing edition of CurrentFont().info.note
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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