bug-ncurses
[Top][All Lists]
Advanced

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

Re: exit activateCDKSelection from a callback


From: Thomas Dickey
Subject: Re: exit activateCDKSelection from a callback
Date: Fri, 3 Apr 2009 12:42:19 -0400 (EDT)

On Fri, 3 Apr 2009, TheLonelyStar wrote:


Bump.
Anybody an Idea of how to make this work?
Thanks!
Nathan

I took a first look at it, thought that it _should_ be doable by manipulating the exit state, ran short of time and think I might be
able to look deeper on the weekend.



TheLonelyStar wrote:



Thomas Dickey-2 wrote:

Perhaps you can send a short demo program - then we can discuss...


Here it is:

bool Quit=false;

static int  OnChar(EObjectType cdktype,void *object,void
*clientData,chtype key)
{
        Quit=true;
}

static char* choices[]={
                " ",
                "*"
        };

int main()
{
        CDKSCREEN* cdkscreen=initCDKScreen(initscr());
        CDKSELECTION* sel1 =
newCDKSelection(cdkscreen,20,2,RIGHT,-4,-21,"</U>Sel1<!U>",0,0,choices,2,A_REVERSE,true,false);
        CDKSELECTION* sel2 =
newCDKSelection(cdkscreen,1,2,RIGHT,-4,19,"</U>Sel2<!U>",0,0,choices,2,A_REVERSE,true,false);

        bindCDKObject(vSELECTION, sel1, 'q', OnChar, 0);
        bindCDKObject(vSELECTION, sel2, 'q', OnChar, 0);

        drawCDKSelection(sel2,true);
        while(!Quit)
        {
                while(activateCDKSelection(sel1,0)!=1);
                        if(Quit)
                                break;
                while(activateCDKSelection(sel2,0)!=1);
        }


        destroyCDKSelection(sel2);
        destroyCDKSelection(sel1);
        destroyCDKScreen(cdkscreen);
        endCDK();

        return 0;
}



--
View this message in context: 
http://www.nabble.com/exit-activateCDKSelection-from-a-callback-tp22769731p22872132.html
Sent from the Gnu - Ncurses mailing list archive at Nabble.com.



_______________________________________________
Bug-ncurses mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/bug-ncurses


--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net




reply via email to

[Prev in Thread] Current Thread [Next in Thread]