bug-ncurses
[Top][All Lists]
Advanced

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

Re: move_panel and getbegxy


From: Bryan Christ
Subject: Re: move_panel and getbegxy
Date: Fri, 25 May 2007 09:40:06 -0500
User-agent: Thunderbird 1.5.0.10 (X11/20070302)

I'm not really a fan of the keeping the bug for compatibility, but I understand it. Your solution below considers only ncurses. The problem is that if the bug exists in pcurses and curses, then you have portability problems. In other words, its best if curses, pcurses, and ncurses all behave the same (even in the ways they are broke).

Clive Nicolson wrote:
On Thu, 24 May 2007, Bryan Christ wrote:

This is a bug which Thomas and I discussed sometime ago. You'll basically have to move the subwin yourself. A sample is below.

Thomas may have the other half of this email, I can't seem to find the follow up, but at least this will clear things up for you a bit. Basically, even though its a bug, other implementations of curses have this problem and so to fix it would break compatibility.

Your code snippet below fixed both my problems.

I do not support the compatibility idea, once getbegxy returns the wrong value the caller can not fix the values. Without private curses data it is not possible, even then a general fix by the caller is very difficult.

If there is some case I've missed ncurses could offer the user a runtime
switch to fix the problem.

eg

#ifdef NCURSES_VERSION_PATCH
#if NCURSES_VERSION_PATCH >= 20070525
  ncurses_hacks_on(XX_FIX_MOVE);
#endif
#endif

I'm prepared to try knocking up a patch to ncurses for this bug.

Thanks
Clive



On Wed, 31 May 2006, Christ, Bryan wrote:

Thomas,

menu_driver() reads window->_begx and window->_begy when determining the
appropriate region/coordinates to update.  The problem with this is that
_begx and _begy don't get updated if the window is a subwin/derwin and
the parent is moved.  the outdated coords cause the mouse hit-test
processed by menu_driver() to fail.  why can't this bug be fixed so that
menu_driver calculates the offset?  currently i am hacking changes to my
subwins (and subwins of subwins of subwins...) to reflect the new data.
code snippet below:

x=0;
y=0;

subwin=child_of_window_that_was_moved;
while(subwin->_parent!=NULL)
{
 x+=subwin->_parx;
 y+=subwin->_pary;
 subwin=subwin->_parent;
}
x+=subwin->_begx;
y+=subwin->_begy;

subwin=child_of_window_that_was_moved;
subwin->_begy=y;
subwin->_begx=x;

Clive Nicolson wrote:
I am using ncurses-5.6 .

I have a panel who's window is associated with a menu (for which I provided
a subwindow via derwin).

I move the panel with move_panel and then do a getbegxy on both the window and the menu's subwindow, the coordinate pairs returned indicate that the subwindow has not moved, but that the window has!

Is this expected?

I also note that the menu_driver can no longer select items (with the mouse)
on the moved menu!

Clive



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





reply via email to

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