paragui-users
[Top][All Lists]
Advanced

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

Re: [paragui-users] Layout and custom widgets.


From: Alexander Pipelka
Subject: Re: [paragui-users] Layout and custom widgets.
Date: 14 Jun 2002 17:10:02 +0200

Am Fre, 2002-06-14 um 14.27 schrieb Guillaume Schmid:
> Hello,
> I am thinking about programming a simple framework for the user
> interface of my application. I would like to customize a few widget (by
> inheritance, of course) and I would like to use the layout loader.
> 
> I did not see if there is a possibility to create some inherited widgets
> from the layout loader. I might have missed something, but by looking at
> the sources, I think that there might be a solution to my problem
> involving some modification of the loader.

True. The XML layout loader is a relict of some old code.
There was some discussion about this lately.
Unfortunately the current model isn't extensible.

> I am in no way a XML expert (in fact this is the first time I look into
> an xml library so I may have not understood everything and missed some
> important points), but I think that this loader would benefit from being
> separated into 2 parts.
> The first one would be the XML parsing stage, and the second one would
> be a factory class.
> 
> The factory class would have some methods to create a new widget and to
> set the right parameters. And the xml stage would only parse and call
> the appropriate methods.

Yeah. Andrew and i were talking about this some time ago.
This kind of model will make it into the development version (1.1.x).
Unfortunately, (again) my time is currently *very* limited. I have to
get this 1.0.2 release out of the door. :))

> An advantage of this is that it could be possible to inherit from the
> factory and extend it to create new widgets defined into the
> application.
> 
> A second adventage is that it would be possible to use the factory
> without the xml layer.

All i can say for now is:
- It's currently impossible with the 1.0.x (stable) branch.
- The factory thing will be in 1.1.x. But i have no idea how long it'll
take.

> In fact, I was thinking about this because I was told that the use of
> xml is rather slow and I am used to parse my data file with some simple
> custom grammar written with lex and yacc (and usually, it is fast). So
> naturally, I thought that it might be interesting to have a very simple
> and efficient layout loader written in a few lines of yacc. And that
> would remove some complexity of the layout loader due to parsing context
> checking.

I don't think that XML is slow. These layout definitions are rather
small (a few kb). It shouldn't be very time consuming to parse them.

> So, after all this blablabla, here is my question: Have I missed
> something ? Is there a way to create custom widget and about my
> suggestions ?

As said before.

Sorry.

Alex






reply via email to

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