[Dev] XML for CPIA

Phillip J. Eby pje at telecommunity.com
Wed Aug 10 14:38:38 PDT 2005


At 02:19 PM 8/10/2005 -0700, Alec Flett wrote:

>>from somewhere.cpia_templates import Menu, MenuItem
>>
>>Menu("FileMenu", _('File'), [
>>     Menu("NewMenu", _('New...'), [
>>         MenuItem("NewMessageItem", _("Message"), ...),
>>         MenuItem("NewNoteItem",    _("Note"), ...),
>>     ])
>>]).install(parcel)
>Wow. If you can explain a little more about how to do this, I'll throw 
>away all of my XmlForCpia work - seriously :)
>
>do you mean that "Menu" is just a template wrapper around the Menu class, 
>or that we're somehow making the Menu class also implement this template class?
>
>i.e. is this something like, in somewhere.cpia_templates:
>
>from osaf.framework import Blocks
>Menu = template(Blocks.Menu)?

You could do it that way, although I think what you'd want is to have a 
'template' classmethod on Item that created template instances.  Then 
somewhere.cpia_templates would be defined more like:

     Menu = Blocks.Menu.template

etc.






More information about the Dev mailing list