Am Sonntag, 5. März 2006 15:23 schrieb Julien Claassen:
Hi!
I know, this may be a bit off topic. But I've a dificulty:
I'm currently programming a textbase "GUI"-lib. I want the programming
API to be similar to on of a real GUI-lib (gtk, you name them).
Now I'm wondering, there are menus. Menus have menuitems and if you click
on one, something should happen. How is this "something should happen" part
usually done? - I thought of the java-apporach, deriving your own
menu-class. But it doesn't feel right. I have my dificulties with trying
This depends on the programming language of course. If you pick C for example
then you would usually do as Loki already pointed out by using callback
functions.
In Java and C++ you would rather define an abstract class "MenuItem" which
just defines the API, thus the method names and their arguments and return
type and then you would derive that abstract class in your actual
implementation classes to implement those methods.
I'm just wondering how a "text based GUI lib" should look like exactly? I
mean
there are libraries like (n)curses, but those are actually already quite
graphical. So what did you have in mind?
GUI-libs myself, for I'm blind. I could write some
code, but wouldn't know,
if it works, like I planned.
Btw have you planned a lecture or something for this year's LAC? Personally I
would be very interested to hear how blind people usually work with
computers, what kind of interfaces and software they use etc. This might also
help other blind people and give developers an impression how to make
software more friendly for blind people.
CU
Christian