events - Xwindows

This is a discussion on events - Xwindows ; Hello, I have starting to work with X libraries and I'm searching for a better way to handle events than the classic switch-case loop. Is possible to build a lookup table to call the appropriate handle like ``function[window][event type]''? gtk ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: events

  1. events

    Hello,
    I have starting to work with X libraries and I'm searching for a better
    way to
    handle events than the classic switch-case loop. Is possible to build a
    lookup
    table to call the appropriate handle like ``function[window][event
    type]''?
    gtk toolkit permits to modularize programs in a way that you have to
    call a
    loop function after created your gui, so I think elegant code is
    possible.
    Suggestions/ideas?
    Thanks,
    Gaetano


  2. Re: events

    gaetanoortisi@yahoo.it wrote:
    > I have starting to work with X libraries and I'm searching for a better
    > way to
    > handle events than the classic switch-case loop. Is possible to build a
    > lookup
    > table to call the appropriate handle like ``function[window][event
    > type]''?


    Have a look at the 2000 lines of code windows manager dwm (www.wmii.de). If
    i remember correctly this strategy has been implemented in it.

    Regards
    - Robert Figura

    --
    /* mandlsig.c v0.23 (c) by Robert Figura */
    I=1702;float O,o,i;main(l){for(;I--;putchar("oO .,\nm>cot.bitamea\
    @urigrf 837&874>I?I^833:l%5:5]))for(O=o=l=
    0;O*O+o*o<(16^l++);o=2*O*o+I/74/11.-1,O=i)i=O*O-o*o+I%74*.04-2.2;}


  3. Re: events


    > Have a look at the 2000 lines of code windows manager dwm (www.wmii.de). If
    > i remember correctly this strategy has been implemented in it.
    >
    > Regards
    > - Robert Figura
    >


    No, it index [] only by event, I'm searching for a solution for windows.


+ Reply to Thread