[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Object Widgets



Struan Gray wrote:
> 
> Struan Gray, struan.gray@sljus.lu.se writes:
> 
> Whoops.  Bad formatting in my last post.
> 
> This:
> 
>     > objwidref = obj_new('object_widget') objwidref -> Start
> 
> Should read:
> 
>     > objwidref = obj_new('object_widget')
>     > objwidref -> Start
> 
> 
> Struan

I often do all sorts of things in the Start method.  Usually they are along the
lines of setting up variables (like window id's), that don't yet exist until a
subsidiary object is Started.  Also for drawing to widget_draw's, and similar
things which require the widgets already to have been started up. But it's not
just for widget issues. 

For instance, I have a color manager object which other object widgets inquire
for various colors to set themselves up.  Until this object is initialized, it
makes no sense to inquire things of it.  If there were only one object utilizing
it... no problem -- just make sure it's initted first.  But when many objects
being initted in many different places might be involved, this is *much*
easier.  

Another nice thing about having a standard method "Start" is that a controlling
class can automatically "Start" all of it's composited objects, without knowing
the details of what they're doing (be it widget or otherwise).  

JD

-- 
 J.D. Smith                             |*|      WORK: (607) 255-5842    
 Cornell University Dept. of Astronomy  |*|            (607) 255-6263
 304 Space Sciences Bldg.               |*|       FAX: (607) 255-5875 
 Ithaca, NY 14853                       |*|