bug-ncurses
[Top][All Lists]
Advanced

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

Re: Weird positioning of widgets within cdk screens


From: Thomas Dickey
Subject: Re: Weird positioning of widgets within cdk screens
Date: Mon, 7 Dec 2015 20:38:45 -0500
User-agent: Mutt/1.5.21 (2010-09-15)

On Sun, Nov 29, 2015 at 07:59:58PM -0800, Elliot Li wrote:
> 
> > On Nov 29, 2015, at 5:40 PM, Thomas Dickey <address@hidden> wrote:
> > On Thu, Nov 26, 2015 at 09:09:36PM -0800, Elliot Li wrote:
> >> I’m having this problem when trying the cdk library.  I created several new
> >> WINDOW and ran initCDKScreen() on them to manage different collection of
> >> widgets.  After that I create cdk widgets in these screens.  However the 
> >> xpos
> >> and ypos I used for widgets seem not right.  For one screen, (0,0) is the 
> >> top
> >> left corner of the screen, which is correct, but (1,1) is not at location
> >> (1,1) but at (1,1); (1,2) is shown at (1,1).  For another screen, (5,5) is
> >> shown at (0,5).  I don’t know if this is random or if I did something very
> >> wrong.
> >> 
> >> Do you guys have any clue why this can happen? Thanks in advance.
> > 
> > offhand, no - a simple test-program illustrating the problem helps.
> 
> I’ve done some more experiments, and it seems that cdk functions always take
> an absolute coordinate (relative to the root full-screen window) no matter
> what screen I passed to them.  So in order to put some widget at the top-left
> corner of a sub-screen I cannot just use (0,0), but have to use (x, y)
> instead, where x, y is the location of the sub-screen.  Widgets that are
> placed outside the region of the sub-screen will be moved into the subscreen
> according to some rule, it seems to me.
> 
> Is that how cdk functions supposed to behave?

no... they accept some extra values:

quoting from cdk_calendar:

            xpos controls  the  placement  of  the object along the horizontal
                 axis.  It may be an integer or one of the pre-defined  values
                 LEFT, RIGHT, and CENTER.

            ypos controls the placement of the object along the vertical axis.
                 It may be an integer or one of the  pre-defined  values  TOP,
                 BOTTOM, and CENTER.

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

Attachment: signature.asc
Description: Digital signature


reply via email to

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