sketchingpy.dialog_struct
Utilities for showing simple dialog boxes..
License:
BSD
1"""Utilities for showing simple dialog boxes.. 2 3License: 4 BSD 5""" 6 7import typing 8 9 10class DialogLayer: 11 """Facade which allows for simple dialog boxes.""" 12 13 def show_alert(self, message: str, callback: typing.Optional[typing.Callable[[], None]] = None): 14 """Show an alert dialog box. 15 16 Args: 17 callback: Method to invoke when the box closes. 18 message: The string to show the user. 19 """ 20 raise NotImplementedError('Use implementor.') 21 22 def show_prompt(self, message: str, 23 callback: typing.Optional[typing.Callable[[str], None]] = None): 24 """Get a string input from the user. 25 26 Args: 27 message: The message to display to the user within the dialog. 28 callback: Method to invoke when the box closes with a single string parameter provided 29 by the user. Not invoked if cancelled. 30 """ 31 raise NotImplementedError('Use implementor.') 32 33 def get_file_save_location(self, 34 callback: typing.Optional[typing.Callable[[str], None]] = None): 35 """Get either the filename or full location for saving a file. 36 37 Args: 38 callback: Method to invoke when the box closes with single string parameter which is the 39 filename or the path selected by the user. Not invoked if cancelled. 40 """ 41 raise NotImplementedError('Use implementor.') 42 43 def get_file_load_location(self, 44 callback: typing.Optional[typing.Callable[[str], None]] = None): 45 """Get either the filename or full location for opening a file. 46 47 Args: 48 callback: Method to invoke when the box closes with single string parameter which is the 49 filename or the path selected by the user. Not invoked if cancelled. 50 """ 51 raise NotImplementedError('Use implementor.')
class
DialogLayer:
11class DialogLayer: 12 """Facade which allows for simple dialog boxes.""" 13 14 def show_alert(self, message: str, callback: typing.Optional[typing.Callable[[], None]] = None): 15 """Show an alert dialog box. 16 17 Args: 18 callback: Method to invoke when the box closes. 19 message: The string to show the user. 20 """ 21 raise NotImplementedError('Use implementor.') 22 23 def show_prompt(self, message: str, 24 callback: typing.Optional[typing.Callable[[str], None]] = None): 25 """Get a string input from the user. 26 27 Args: 28 message: The message to display to the user within the dialog. 29 callback: Method to invoke when the box closes with a single string parameter provided 30 by the user. Not invoked if cancelled. 31 """ 32 raise NotImplementedError('Use implementor.') 33 34 def get_file_save_location(self, 35 callback: typing.Optional[typing.Callable[[str], None]] = None): 36 """Get either the filename or full location for saving a file. 37 38 Args: 39 callback: Method to invoke when the box closes with single string parameter which is the 40 filename or the path selected by the user. Not invoked if cancelled. 41 """ 42 raise NotImplementedError('Use implementor.') 43 44 def get_file_load_location(self, 45 callback: typing.Optional[typing.Callable[[str], None]] = None): 46 """Get either the filename or full location for opening a file. 47 48 Args: 49 callback: Method to invoke when the box closes with single string parameter which is the 50 filename or the path selected by the user. Not invoked if cancelled. 51 """ 52 raise NotImplementedError('Use implementor.')
Facade which allows for simple dialog boxes.
def
show_alert( self, message: str, callback: Optional[Callable[[], NoneType]] = None):
14 def show_alert(self, message: str, callback: typing.Optional[typing.Callable[[], None]] = None): 15 """Show an alert dialog box. 16 17 Args: 18 callback: Method to invoke when the box closes. 19 message: The string to show the user. 20 """ 21 raise NotImplementedError('Use implementor.')
Show an alert dialog box.
Arguments:
- callback: Method to invoke when the box closes.
- message: The string to show the user.
def
show_prompt( self, message: str, callback: Optional[Callable[[str], NoneType]] = None):
23 def show_prompt(self, message: str, 24 callback: typing.Optional[typing.Callable[[str], None]] = None): 25 """Get a string input from the user. 26 27 Args: 28 message: The message to display to the user within the dialog. 29 callback: Method to invoke when the box closes with a single string parameter provided 30 by the user. Not invoked if cancelled. 31 """ 32 raise NotImplementedError('Use implementor.')
Get a string input from the user.
Arguments:
- message: The message to display to the user within the dialog.
- callback: Method to invoke when the box closes with a single string parameter provided by the user. Not invoked if cancelled.
def
get_file_save_location(self, callback: Optional[Callable[[str], NoneType]] = None):
34 def get_file_save_location(self, 35 callback: typing.Optional[typing.Callable[[str], None]] = None): 36 """Get either the filename or full location for saving a file. 37 38 Args: 39 callback: Method to invoke when the box closes with single string parameter which is the 40 filename or the path selected by the user. Not invoked if cancelled. 41 """ 42 raise NotImplementedError('Use implementor.')
Get either the filename or full location for saving a file.
Arguments:
- callback: Method to invoke when the box closes with single string parameter which is the filename or the path selected by the user. Not invoked if cancelled.
def
get_file_load_location(self, callback: Optional[Callable[[str], NoneType]] = None):
44 def get_file_load_location(self, 45 callback: typing.Optional[typing.Callable[[str], None]] = None): 46 """Get either the filename or full location for opening a file. 47 48 Args: 49 callback: Method to invoke when the box closes with single string parameter which is the 50 filename or the path selected by the user. Not invoked if cancelled. 51 """ 52 raise NotImplementedError('Use implementor.')
Get either the filename or full location for opening a file.
Arguments:
- callback: Method to invoke when the box closes with single string parameter which is the filename or the path selected by the user. Not invoked if cancelled.