Managing option menus



I'm trying to use option menus to allow users to set various things,
which I'd like reflected in a variable, kind of like pulldown menus in
Netscape choosing parameters.  But I haven't come up with a good way
for a generic callback to set the variable of my choice to the right
enumerated value.

For example, in a D&D character generator (seemed like a good
prototype project), you would choose your class with an option menu.
So, I have "Fighter", "Cleric", "Mage", "Thief"... on an option menu.
I have an int in a data structure I'd like to assign an appropriate
number to according to the value in the option menu.

Anyone have any good sample code on doing this?  SANE looks like it
did exactly what I want, but it had a lot of extra machinery in there.

-- 
Alan Shutko <ats@acm.org> - By consent of the corrupted
When a camel flies, no one laughs if it doesn't get very far!



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