diff options
| author | Teddy Wing | 2015-12-24 19:44:03 -0800 |
|---|---|---|
| committer | Teddy Wing | 2015-12-24 19:44:03 -0800 |
| commit | 681661cb1d44dee4da510176f4271a0567010123 (patch) | |
| tree | 784a3677bc1dba791bd8bef455c785e6609c1c76 /preferences_window.py | |
| parent | 1391f70d79144518dda9d0294a9e8a8fc79904ff (diff) | |
| download | RoboFont-Equalize-Sidebearings-Key-681661cb1d44dee4da510176f4271a0567010123.tar.bz2 | |
preferences_window.py: Get rid of all the cruft from last commit
Remove the commented `NSFormatter` subclasses, and debug statements from
1391f70d79144518dda9d0294a9e8a8fc79904ff, and also rename our
single-letter variable.
Diffstat (limited to 'preferences_window.py')
| -rw-r--r-- | preferences_window.py | 52 |
1 files changed, 5 insertions, 47 deletions
diff --git a/preferences_window.py b/preferences_window.py index 4a9afa0..10dbf1b 100644 --- a/preferences_window.py +++ b/preferences_window.py @@ -1,47 +1,7 @@ -from Foundation import NSFormatter - import vanilla from preferences import Preferences -# from remote_pdb import RemotePdb - - -# class Booya4HotKeyFormatter(NSFormatter): -# -# def __new__(cls, *arg, **kwargs): -# self = cls.alloc().init() -# return self -# -# def stringForObjectValue_(self, obj): -# return str(obj) -# -# def getObjectValue_forString_errorDescription_(self, obj, string, error): -# return True -# -# def isPartialStringValid_newEditingString_errorDescription_( -# self, -# partial_string, -# new_string, -# error): -# if len(partial_string) > 1: -# return False -# -# return True - - # def isPartialStringValid_proposedSelectedRange_originalString_originalSelectedRange_errorDescription_( - # self, - # partial_string_ptr, - # proposed_sel_range_ptr, - # orig_string, - # orig_sel_range, - # error): - # if len(partial_string_ptr) > 1: - # return False - # - # return True - - class PreferencesWindow(object): @@ -52,22 +12,20 @@ class PreferencesWindow(object): self.w.activation_key_label = vanilla.TextBox( (10, 15, -10, 22), 'Short Key:') - # RemotePdb('127.0.0.1', 4444).set_trace() self.w.activation_key = vanilla.EditText( posSize=(82, 12, -10, 25), text=self.preferences.activation_key, - # formatter=Booya4HotKeyFormatter(), callback=self.edit_text_callback) self.w.open() def edit_text_callback(self, sender): - r = sender.get() + value = sender.get() - if len(r) > 1: - r = r[0] + if len(value) > 1: + value = value[0] - self.preferences.activation_key = r - self.w.activation_key.set(r) + self.preferences.activation_key = value + self.w.activation_key.set(value) PreferencesWindow() |
