nanogui: GUILib for C


Previous by date: 18 Dec 2000 22:06:22 -0000 Thread-safety, wrapping globals in structs, RTEMS, Kaben Nanlohy
Next by date: 18 Dec 2000 22:06:22 -0000 Re: propose low-level line draw?, Greg Haerr
Previous in thread: 18 Dec 2000 22:06:22 -0000 Re: GUILib for C, Kaben Nanlohy
Next in thread: 18 Dec 2000 22:06:22 -0000 Re: GUILib for C, Nick Papadonis

Subject: Re: GUILib for C
From: Alex Holden ####@####.####
Date: 18 Dec 2000 22:06:22 -0000
Message-Id: <Pine.LNX.4.04.10012182128580.870-100000@hyperspace.linuxhacker.org>

On Mon, 18 Dec 2000, Kaben Nanlohy wrote:
> After the first compile and run of demos w/nanowidgets, I wasn't able to
> muster much enthusiasm.  At the time the toolset had more problems than it
> does now (it dumped core if I blinked).  With all of its macro magic for
> object-orientedness, after several hours of plotting out program flow I
> sort of gave up trying to troubleshoot nanowidgets.

Ah, you spotted the obvious flaw- the reason the widget class stuff is so
clean and simple to use is because of the complex macros that do most of
the work for you behind the scenes, which can be a pain to debug if the
bug is in the macros...

> But my $0.02 worth:  if a widget set is going to be created from scratch,
> can we stick to C unions and structs and functions in implementing our
> classes?

It is based on structures and callbacks just like you'd expect; the macros
just hide the complexity from the programmer. My main complaint about them
is that it's not completely obvious how to use them and there isn't any
documentation, but it's actually quite elegant once you see how it works.
We could replace the macro generated object structures with explicitly
defined structures and replace the macros which do things like creating
and destroying objects, but it would require the programmer to write more
code. Swings and roundabouts. Remember the original C++ compiler was even
worse- instead of a few relatively simple C macros, it used a complex
preprocessor. Actually I think if I was to start again from scratch, I
probably would go the route of making things more explicit even though it
generates more work for the programmer, but that's just a personal
preference.

-- 
------- Alex Holden -------
http://www.linuxhacker.org/
 http://www.robogeeks.org/


Previous by date: 18 Dec 2000 22:06:22 -0000 Thread-safety, wrapping globals in structs, RTEMS, Kaben Nanlohy
Next by date: 18 Dec 2000 22:06:22 -0000 Re: propose low-level line draw?, Greg Haerr
Previous in thread: 18 Dec 2000 22:06:22 -0000 Re: GUILib for C, Kaben Nanlohy
Next in thread: 18 Dec 2000 22:06:22 -0000 Re: GUILib for C, Nick Papadonis


Powered by ezmlm-browse 0.20.