[Zope] Icons not set right after Subclassing

Chris McDonough chrism@zope.com
Wed, 31 Jul 2002 15:05:16 -0400


Try to set an 'icon' property on the subclasses, eg.

SpecialHost(GenericHost):
    icon = 'some/directory/filename.gif'


----- Original Message -----
From: "VanL" <vlindberg@verio.net>
To: <zope@zope.org>
Sent: Wednesday, July 31, 2002 1:43 PM
Subject: [Zope] Icons not set right after Subclassing


> Hello,
>
> I have a Folderish Class "GenericHost".
>
> I then have some specializations of this host, declared as
>
> SpecialHost(GenericHost):
>     (Differences here)
>
> SpecialHost2(GenericHost):
>     (Differences)
>
>
> I then declare them in __init__ as follows:
>
>     context.registerClass(
>         Hosts.SpecialHost,
>         constructors = (Hosts.addSpecialHostForm,
> Hosts.manage_addSpecialHost),
>         icon = 'icons/SpecialHost.gif'
>         )
>     context.registerClass(
>         Hosts.SpecialHost2,
>         constructors = (Hosts.addSpecialHost2Form,
> Hosts.manage_addSpecialHost2),
>         icon = 'icons/SpecialHost2.gif'
>         )
>
> GenericHost is never registered.  However, the icon directive is
> ignored; they all get a plain folder icon.
> When I do register GenericHost and give it its own icon, then
everything
> then gets the GenericHost icon. Otherwise, everything works as
expected.
>
> I've tried the misc_ trick, but I can't get it to work.  Can
anyone tell
> me what I'm doing wrong?  It seems like a waste to repeat all of
the
> code just for the icons.
>
> TIA,
>
> VL
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>