slang-users mailing list

[2001 Date Index] [2001 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: help with menus and callbacks


On Thu, May 10 2001, Joe Robertson wrote:

Hi,

> Hi All,
> 
> I'm reasonably comfortable with C, and I have created a simple drop down menu system for my very simple program.  I've been trying to look at other apps with menus and figure out how to hook up functions to a keypress(enter key).
> 
> Can someone suggest a site, doc or example of taking a keycapture in the main loop and having that execute a C function from another module?
> 
> I'm thinking something of a table lookup of a function and execute it.

You can also find that in my IRC client that's using slang. Take a look
at file input.c, parse_kbd(). The way I get the appropriate function from
a table might seem complicated, but I did it for efficiency reasons (i.e.
you don't have to walk the array to find a key). URL is :

http://users.netraam.com/~jm/justirc/

Btw, John, could you please update URL for it? The old URL was
http://tel.netraam.com/jm/justirc/. Please do the same for my other app
(http://tel.netraam.com/jm/pupette/ ->
http://users.netraam.com/~jm/pupette/). Thank you.

Best regards,
Goran

> 
> Willing to learn, just need a few hints.
> 
> Thanks,
> -- 
> Joe Robertson   -----------------------------
> [E]	jmrobert@xxxxxxxx
> [W]	http://www.huntsvilleal.com/~jmrobert
> [ICQ]	2586528
> ---------------------------------------------
> "I am... after all... a SuperHero."
>  Larry-Boy
>  http://www.larry-boy.com
> ---------------------------------------------
> 

--

Writing about music is like dancing about architecture.
    -- Frank Zappa 


[2001 date index] [2001 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]