[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [CDK] A few problems, remarks and suggestions, mostly concerning the
Re: [CDK] A few problems, remarks and suggestions, mostly concerning the Scroll widget
Tue, 1 Jan 2019 19:46:56 -0500
On Mon, Dec 31, 2018 at 05:04:15PM +0100, Stéphane Goujet wrote:
> So, as I understand it, there are several roads that can be taken:
> 1. Leave setCDKScrollItems() as it is (but document that it can only be
> called once, and only on a blank CDKSCROLL), and add a
> replaceCDKScrollItems() function (as I did, but inside the API).
> 2. Fix setCDKScrollItems() to handle cases when the CDKSCROLL already
> contains items. Then it behaves like a replaceCDKScrollItems() function.
> 3. Add a cleanCDKScrollItems() function, which deletes items.
> setCDKScrollItems() remains as it is (but its limitations are documented).
> Implementing a replaceCDKScrollItems() equivalent is left to the user.
> What's your opinion?
The third sounds like the simplest route :-)
> >>4. Documentation and code (man cdk_scroll; "scroll.c", line 867)
> >>getCDKScrollItems(): the man page doesn't mention that NULL is allowed for
> >>the list parameter, and that it is a way to get the number of items in the
> >>scroll list.
> >I added the null-pointer check in 2005, apparently after seeing something
> >break. I suppose documenting it would help :-)
> >>BTW, I think it is (is it?) the only way to get the number of items, which
> >>is weird. A dedicated function would be much more natural.
> Was I right, that there is no official function to get the number of items
> in the scroll list? (besides using this one in this 'unexpected' way)
well... an application could just look at the data structure, since
that's not opaque (a function would be nicer, agreed)
Thomas E. Dickey <address@hidden>
Description: Digital signature
- Re: [CDK] A few problems, remarks and suggestions, mostly concerning the Scroll widget,
Thomas Dickey <=