|
From: Kevin A. <al...@se...> - 2002-02-13 21:38:58
|
I've been thinking about redoing the general dialog interface so that rather
than creating a dialog and then getting all of the elements via methods such
as:
dlg.accepted()
The return value would always be a dictionary with named parameters for all
the options {'accepted':1, 'returned':'Ok'}, something like that. You can
look at the dialogs.py sample to see how method calls are currently used. We
can already do dialog one-liners for the simplest dialogs as this shell
session shows:
>>> from PythonCardPrototype import dialog
>>> dialog.AlertDialog(None, 'a message', 'a title')
But this isn't possible with more complex dialogs. Using a dictionary return
value seems simpler and more Pythonic since the user doesn't have to
explicitly call ShowModal or Destroy and regardless of the dialog type the
result will always be a dictionary of name/value pairs.
It may cause issues where previously some dialog setup was done after
__init__, but I won't know until I dig a little deeper. The ModalDialog
class (dialog.py) in PythonCard already hides ShowModal and Destroy, but
still requires the use of methods after the dialog returns to get results.
GenericDialog (dialognew.py) hides less and would also need to be upgraded.
Opinions?
ka
|