class documentation

class Actionable(NSObject): (source)

View In Hierarchy

Wrap a Python no-argument function call in an NSObject with a doIt: method.

Method doIt_ Call the given callable; exposed as an IBAction in case you want IB to be able to see it.
Method initWithFunction_ Backwards compatibility initializer, creating this Actionable in the default ItemState.
Method initWithFunction_andState_ Remember the given callable, and the given menu state.
Method validateMenuItem_ Undocumented
Instance Variable _state Undocumented
Instance Variable _thunk Undocumented
@IBAction
def doIt_(self, sender: object): (source)

Call the given callable; exposed as an IBAction in case you want IB to be able to see it.

def initWithFunction_(self, thunk: Callable[[], None]) -> Actionable: (source)

Backwards compatibility initializer, creating this Actionable in the default ItemState.

def initWithFunction_andState_(self, thunk: Callable[[], None], state: ItemState) -> Actionable: (source)

Remember the given callable, and the given menu state.

Parameters
thunk:Callable[[], None]the callable to run in doIt_.
state:ItemStatethe initial state of the menu item presentation
Returns
ActionableUndocumented
def validateMenuItem_(self, item: NSMenuItem) -> bool: (source)

Undocumented

Undocumented

_thunk: Callable[[], object] = (source)

Undocumented