paragui-users
[Top][All Lists]
Advanced

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

Re: [paragui-users] Paragui redesign


From: Alexander Pipelka
Subject: Re: [paragui-users] Paragui redesign
Date: 07 May 2002 18:53:48 +0200

Am Die, 2002-05-07 um 18.20 schrieb Andrew Ford:
> 
> --- Alexander Pipelka <address@hidden> wrote:
> > 
> > By deleting a parent widget all child widget will
> > also be deleted.
> > 
> 
> The part that confuses me is what happens when that
> widget was declared locally.  The compiler compains
> then anyway about taking the address of a temporary,
> doesn't it?

If the widget is created static inside a function,... Right.
Widgets are usually created dynamically (e.g. in constructors).
Every widget gets registered in a list.

> > > So how do we pass specific attributes (or sets of
> > > attributes that share some context) back to the
> > > super-class for processing?  We obviously don't
> > want
> > > to do the full parsing in each widget (and users
> > would
> > > then hate laying out custom widgets).
> > 
> > Hmm,..
> > There is no need for every widget to parse all
> > possible attributes.
> > It should work like this:
> > 
> > PG_Widget::parseXMLAtts(...) {
> >     parse atts of PG_Widget
> > }
> > 
> > myclass::parseXMLAtts(...) {
> >     PG_Widget::parseXMLAtts(...)
> >     parse atts of myclass
> > }
> > 
> > mysubclass::parseXMLAtts(...) {
> >     myclass::parseXMLAtts(...)
> >     only parse atts of mysubclass
> > }
> 
> Is this going top-down?  What happens if mysubclass
> wants to do something different with one of
> PG_Widget's attributes, for instance?  Does a widget
> ever need to do this?  And if it's bottom-up, how do
> we pass numerous attributes back to the super-class
> without burdening the widget-writer.  Sorry if I don't
> understand what's going on here :)

Any widget has some fundamental attributes (like position).

These attributes are arranged hierarchically. Think about parsing the
layout of a PG_Image object.

PG_Widget parses the position of the object
PG_ThemeWidget parses the background attributes
PG_Image parses the image filename.

Why should PG_Image want to do something different with the position
attribute ?

Alex






reply via email to

[Prev in Thread] Current Thread [Next in Thread]