[Zope] Registering just an icon not constructor

Loren Stafford lstaffor@dynalogic.com
Mon, 6 Mar 2000 07:57:38 -0800


There was a thread on this here about 2 weeks ago titled "object icons".
There is a "deprecated" way of doing it, but the thread got off track
without a real answer (the "right" way). The "deprecated"  (the
old-fashioned) way is documented in the old Product API and is used by
ZScheduler. It works like this:

In __init__.py module:

# use the old method to set the icon for the ZSchedule object
misc_ = { 'ZScheduleIcon': ImageFile('www/ZSchedule.gif', globals()) }

In class definition.

class ZSchedule(ZCatalog.ZCatalog):
  """ An event Schedule. This is also a container. """
  meta_type = 'ZSchedule'
  icon='misc_/ZScheduler/ZScheduleIcon'

-- HTH
-- Loren


----- Original Message -----
From: Shalabh Chaturvedi <shalabh@pspl.co.in>
To: zope <Zope@zope.org>
Sent: March 06, 2000 05:25 AM
Subject: [Zope] Registering just an icon not constructor


> In my python product I have a class (IssueFollowup), which I don't want to
> register using registerClass because I want instances to be added only
> through instances of another class (Issue).
>
> I have the necessary code in class Issue that creates and adds objects of
class
> IssueFollowup to the folder in context.
>
> 1. Is this ok ? (Seems to work but are there any possible pitfalls)
>
> 2. IssueFollowup objects appear in the Contents tab but without any icons.
>     How can I register an icon without having IssueFollowup pollute the
drop
>     down list ?
>
> Thanks,
> Shalabh
>