[email@example.com: Re: Zero Memory Widget Library]
- This was sent to me, I think it was meant for the whole list:
----- Forwarded message from thierryexcoffier <exco@...-lyon1.fr> -----
Date: Mon, 05 Jan 2004 12:07:10 -0000
From: "thierryexcoffier" <exco@...-lyon1.fr>
Subject: Re: Zero Memory Widget Library
--- In firstname.lastname@example.org, guy keren <choo@a...> wrote:
> On Mon, 15 Dec 2003, Shlomi Fish wrote:
> > Spotted on Freshmeat: the Zero Memory Widget Library:
> > http://www710.univ-lyon1.fr/~exco/ZMW/
> > A GUI library whose widgets are claimed to occupy a zero amount of
> > I did not quite understand how it works, but you may find it
> it's a fraud. it uses one global 'zmw' variable to hold what i would
> "the zmw root window", and uses it to point to a tree of widgets. so
> memory? not realy.
I am the author of the library.
Let me give some explanations.
The library does not store the widget tree.
There is really no memory used PER widget.
The 'zmw' variable contains a stack of widgets, so the
size required by the stack is proportionnal to
the widget tree depth.
The stack is used only when the virtual widget tree is traversed.
> and they also require the user to allocate memory, when there is a need
> for dynamic memory usage.
Most of the time the memory had yet been allocated.
For example if you want a text entry from the user:
With a classic library:
- You create the widget.
- You initialize the initial content.
- On user validation, you copy widget text content in application.
- If the application modifies the text, the widget must be updated
- Your application initialize text content.
- You define the widget editing the content.
- The user and the application modify content,
there nothing to do to synchronize values.
So, with the classic library the memory for the text content
is used in the application and in the widget.
With ZMW, the text content is only in the application.
> and you need to use static variables in various functions to get
Static variable are used to simplify the examples.
> odd library's limitations - which means at most one instance of a widget
> defined by a given variable. or will you find a way to overcome this
If you have a real application, static variable are not needed
the widgets automaticaly update applications data.
And another nice feature, it is possible to use the
same data for several widgets.
So it is trivial to have synchronized toggles or text entry
in the GUI.
If you want more informations on how it works, you can
take a look to:
Sincerely yours and happy year.
----- End forwarded message -----
Nadav Har'El | Monday, Jan 5 2004, 11 Tevet 5764
Phone: +972-53-790466, ICQ 13349191 |If Windows is the answer, you didn't
http://nadav.harel.org.il |understand the question.