bug-ncurses
[Top][All Lists]
Advanced

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

答复: About the menu's toprow and menu's curitem


From: lnwdl
Subject: 答复: About the menu's toprow and menu's curitem
Date: Tue, 25 Mar 2014 10:23:17 +0800

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); }
> -----邮件原件-----
> 发件人: address@hidden [mailto:address@hidden 代表
> Thomas Dickey
> 发送时间: 2014年3月23日 5:30
> 收件人: 王德亮
> 抄送: address@hidden; address@hidden
> 主题: 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 <address@hidden> http://invisible-island.net
> ftp://invisible-island.net
> 【来自网易邮箱的超大附件】
> 邮件带有附件预览链接,若您转发或回复此邮件时不希望对方预览附件,
> 建议您手动删除链接。
> 
> signature.asc
> 下载: http://u.163.com/uYe5gyOh
> 
> 预览: http://u.163.com/47xoZd36
> 
> 






reply via email to

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