nanogui: Comments on NanoWidgets


Previous by date: 5 Oct 1999 23:46:10 -0000 Re: Comments on NanoWidgets, Vidar Hokstad
Next by date: 5 Oct 1999 23:46:10 -0000 Re: A small request, Robert J.Lawrence
Previous in thread: 5 Oct 1999 23:46:10 -0000 Re: Comments on NanoWidgets, Vidar Hokstad
Next in thread:

Subject: RE: Comments on NanoWidgets
From: Greg Haerr ####@####.####
Date: 5 Oct 1999 23:46:10 -0000
Message-Id: <01BF0F59.32A58EC0.greg@censoft.com>

: We don't specify them in NEW_NOBJECT() because not all objects are
: widgets. For instance NRENDER objects doesn't have any parent. It's easy
: easy enough to create a NEW_NWIDGET() too.

	Perhaps that's the answer.

: I agree in the cases where the same features are available. Currently,
: I haven't supported titles for radio buttons, but it might be good
: to add support for a title for them.

	The whole idea is to get a good idea of what the end is like
for most of the primitive objects we will support.  Then we want to have
the same api to create any of them.  This means alot fewer miscelaneous
api's to learn, as the objects, their parents, their size, their title, etc
are all specified at one time.  Sure you can _also_ change them later,
but that's not the standard way.  Most objects don't need to be changed
later, so why make 4 api calls when one could work, and work for most objects?



: Class can't be changed for an instantiated object, for obvious reasons
: (other than casting to a base class), but creating an object based on a
: text string with class name should be acceptable.

	Create based on a text string class name.  This is a great
way to disassociate class implementations from the calling api.  Remember
not everyone wants the same implementation, but it's sure nice not to have
to rewrite _everything_ in that case.


: 
: As for callbacks, I agree, the callback mechanism should be standarized.
: I'm not sure what the best way of doing it is, though. Any suggestions?


	Yes.  First think about the sorts of things most callbacks want.
A pretty good way is by sending a "message."  This is similar to the events
that Xlib hands over to the user application.  A standard Event structure
is filled in, and a switch statement is executed to process the data.  Replace
the word "Event" with "Callback" above and you've got your callback methodology.

Greg

Previous by date: 5 Oct 1999 23:46:10 -0000 Re: Comments on NanoWidgets, Vidar Hokstad
Next by date: 5 Oct 1999 23:46:10 -0000 Re: A small request, Robert J.Lawrence
Previous in thread: 5 Oct 1999 23:46:10 -0000 Re: Comments on NanoWidgets, Vidar Hokstad
Next in thread:


Powered by ezmlm-browse 0.20.