Package mrv :: Module interface :: Class iChoiceDialog
[hide private]
[frames] | no frames]

Class iChoiceDialog

source code

object --+    
         |    
 Interface --+
             |
            iChoiceDialog

Interface allowing access to a simple confirm dialog allowing the user to pick between a selection of choices, one of which he has to confirm

Note: for convenience, this interface contains a brief implementation as a basis for subclasses, using standard input and standard ouput for communication

Instance Methods [hide private]
 
__init__(self, *args, **kwargs)
Allow the user to pick a choice
source code
 
choice(self)
Make the choice
source code

Inherited from Interface: supports

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, *args, **kwargs)
(Constructor)

source code 
Allow the user to pick a choice
Parameters:
  • kwargs -
    • t/title: optional title of the choice box, quickly saying what this choice is about
    • m/message: message to be shown, informing the user in detail what the choice is about
    • c/choices: single item or list of items identifying the choices if used as string
    • dc/defaultChoice: choice in set of choices to be used as default choice, default is first choice
    • cc/cancelChoice: choice in set of choices to be used if the dialog is cancelled using esc, default is last choice
Overrides: object.__init__

Note: all paramaters exist in a short and a long version for convenience, given in the form short/long

choice(self)

source code 
Make the choice
Returns:
name of the choice made by the user, the type shall equal the type given as button names

Note: this implementation always returns the default choice