[Mindwrapper] 'text' in Choice presenter as a controller
Status: Alpha
Brought to you by:
donnal
From: Donnal W. <don...@ya...> - 2003-04-22 05:12:51
|
When a Choice presenter is used to enter data into a Text cell, the list of choices is determined by the 'choices' parameter for the cell in the *abstraction layer* like so: def Assemble(self): self.Add(node=mw.Text, name='sex', choices=['Unknown', 'Male', 'Female']) But when a Choice presenter is used to control other aspects of the user-interface (with no direct connection to the abstraction layer) it might be more appropriate to define the list of choices via some parameter in the *presentation layer*. The logical name would seem to be 'choices', but the Choice presenter is one of the few presenters that would need this parameter, and when it does, the 'text' parameter would never be used in that situation. So here is my suggestion. Would it seem too awkward to use the 'text' parameter for a list of choices? def Assemble(self, db=al.AL(), pt=al.PtInfo()): self.Add( node = self.ListBySelector, text = ['Sort list by last name', 'Sort list by first name', 'Sort list by bed number', 'Sort list by time of birth'], size = (200, -1), margin = 10, ref = [db.sortby, db.ptlist]) class ListBySelector(mw.Choice): ... Any problems with this syntax? Cheers ===== Donnal Walter Arkansas Children's Hospital |