[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ncurses-bug
Subject:    =?utf-8?Q?=E7=AD=94=E5=A4=8D:_About_the_menu's_toprow_and_?= =?utf-8?Q?menu's_curitem?=
From:       "lnwdl" <lnwdl () 163 ! com>
Date:       2014-03-25 2:23:17
Message-ID: 001601cf47d1$2e899820$8b9cc860$ () 163 ! com
[Download RAW message or body]

The program's source code I posted has modified the relationship between menu->toprow \
and menu->arrow,  So it's run currently. see line 80~86, these lines should not \
existed. Please comment these lines and run it again. According to the result, and \
think about the change in project below:
> > #define Adjust_Current_Item(menu,row,item) \
> > { if ((item)->y < row) \
> > row = (item)->y;\
> > if ( (item)->y >= (row + (menu)->arows) )\
> > row = ( (item)->y < ((menu)->rows - (menu)->arows) ) ? \   /* repleaced with "row \
> > = ( (item)->y < ((menu)->rows -row) )" */ (item)->y : (menu)->rows - \
> > (menu)->arows;\ _nc_New_TopRow_and_CurrentItem(menu,row,item); }
> -----邮件原件-----
> 发件人: tom@invisible-island.net [mailto:tom@invisible-island.net] 代表
> Thomas Dickey
> 发送时间: 2014年3月23日 5:30
> 收件人: 王德亮
> 抄送: dickey@his.com; bug-ncurses@gnu.org
> 主题: Re: About the menu's toprow and menu's curitem
> 
> On Tue, Mar 18, 2014 at 06:20:32PM +0800, 王德亮 wrote:
> > Due to my poor English, I think you misunderstand me.
> > 
> > > There is no standard way to do this:  combining the two was not in
> > > the
> > > SVr4 menu library.  ncurses actually has a private function
> > > _nc_New_TopRow_and_CurrentItem which appears to do this (it is of
> > > course not recommended to use private functions - doing that is
> > > always at your own risk...).
> > > 
> > I don't think the internal function _nc_New_TopRow_and_CurrentItem can
> > do the job, as the debug message show in the picture 2 that I offered,
> > the _nc_New_TopRow_and_CurrentItem has been token effect, because the
> menu->toprow and menu->curitem has been changed right, but the post result
> is not what I wanted.
> > 
> > 
> > What I wonder is:
> > when I set_current_item(my_menu, my_items[3]); it works wonderful; but
> > when I set_current_item(my_menu, my_items[8]);, it's not worked.
> > so I think the macro Adjust_Current_Item(menu,row,item) should be:
> > #define Adjust_Current_Item(menu,row,item) \
> > { if ((item)->y < row) \
> > row = (item)->y;\
> > if ( (item)->y >= (row + (menu)->arows) )\
> > row = ( (item)->y < ((menu)->rows - (menu)->arows) ) ? \   /*
> repleaced with "row = ( (item)->y < ((menu)->rows -row) )" */
> > (item)->y : (menu)->rows - (menu)->arows;\
> > _nc_New_TopRow_and_CurrentItem(menu,row,item); }
> 
> I see what you are asking about, but with the sample program provided, I get
> the same message from posting with/without the suggested change:
> 
> ret: 0, top: 6, cur_idx: 8, cur->name: Choice 9
> 
> (I ran this before/after with 5.9-release and current code)
> 
> --
> Thomas E. Dickey <dickey@invisible-island.net> http://invisible-island.net
> ftp://invisible-island.net
> 【来自网易邮箱的超大附件】
> 邮件带有附件预览链接,若您转发或回复此邮件时不希望对方预览附件,
>  建议您手动 除链接。
> 
> signature.asc
> 下载: http://u.163.com/uYe5gyOh
> 
> 预览: http://u.163.com/47xoZd36
> 
> 




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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic