I'm running into a problem trying to control an NSTextView from code. Here
is a truncated view of my controller class:
class DictManager( Foundation.NSObject, AppKit.NSTableDataSource ):
commentary = objc.IBOutlet( 'commentary' )
definition = objc.IBOutlet( 'definition' )
def toggle_word_inspector( self ):
if self.word_inspector_enabled:
self.word_inspector_enabled = enabled = 0
else:
self.word_inspector_enabled = enabled = 1
self.definition.setEditable_( enabled )
self.commentary.setEditable_( enabled )
Note that both commentary and definition are NSTextView objects. I created
the form in IB, dragged the two objects to the form, created outlets for the
class named as above, and connected them. When I click a line in an
NSTableView in the same form, toggle_word_inspector() is called. When it
reaches the first setEditable line, it raises an
NSInternalInconsistencyError.
Note that I run into the same problem if I use some other method from the
NSTextView class as well, such as isEditable().
Anyone seen this before?
steve
--
|