bug-ncurses
[Top][All Lists]
Advanced

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

Re: cdkentry questions


From: Thomas Dickey
Subject: Re: cdkentry questions
Date: Wed, 6 Feb 2002 19:07:25 -0500
User-agent: Mutt/1.2.5i

On Wed, Feb 06, 2002 at 02:16:28PM -0800, Peter Jay Salzman wrote:
 
> 1. is there documentation anywhere (other than source code examples)?

there are manpages (but as usual, I find the code adequate ;-)

If you're working from the version I supply, the manpages are indexed
reasonably well (the original's install is somewhat lacking).
 
> 2. in entry_ex.c, there's a function:
> 
>    int XXXCB (EObjectType cdktype, void *object, void *clientData, chtype key)
>    {
>          return 1;
>    }
> 
>   what purpose does this function serve?  i can't figure this out from
>   looking at the source code.

Not much - see buttonbox_ex.c and calendar_ex.c where it is.  

It's not clear in the manpage (yet another to-do item - as you see, my
explanation here is for my reference also ;-).

Checking the code (grep), it's used in binding.c checkCDKObjectBind(), to force
an "early exit" based on the 'key' value passed in.  That is, depending on the
return-value, it can force the caller (an input-reader) to return, passing
control to the code that invokes the widget.

However, it seems the entry widget is inconsistent with the other ones, so
pressing a '?' in that example doesn't make the widget quit since the caller
looks for anything but vEARLY_EXIT and the input reader only sets that value. 
(looks like a bug).
 
> 3. we declare a variable of type CDKENTRY with a call like:
> 
>    directory1 = newCDKEntry (cdkscreen, 0, 0, title1, label1, A_NORMAL,
>       '.', vMIXED, 40, 0, 256, TRUE, FALSE);
> 
>    then the source code calls:
> 
>    bindCDKObject (vENTRY, directory1, '?', XXXCB, NULL);
> 
>    what does this 2nd function do?  it looks like we've already declared
>    directory1 to be of type CDKENTRY and assigned it to a CDKEntry
>    object using newCDKEntry.   what does bindCDKObject do?

I think the answer is that Mike Glover's example was incomplete, and that I
didn't notice this one before.  (I'd have to check more carefully, but I do
recall that because the original code was not properly prototyped, I ended up
adding some of the dummy callback functions - probably these - to get rid of
casts).
 
> thanks for the help!  it's challanging learning all this from source.
> the source takes me so far, but i need a little help to get up to snuff.
> 
> pete
> 
> 
> -- 
> Enron..safe legal abortion..civil liberties..cancelling ICBM treaties..
> What's worse?  Screwing an intern or screwing an entire country?
> 
> PGP Fingerprint: B9F1 6CF3 47C4 7CD8 D33E  70A9 A3B9 1945 67EA 951D

-- 
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net



reply via email to

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