Menu dividers in ncurses

故事扮演 提交于 2020-01-06 02:39:10

问题


I'd like to build a menu in ncurses that has section dividers.

My example list looks like this:

Aardvark
Apple
Bee
Cat
Kitten
Kalashnikov
Waffle

What I want is non-selectable dividers. Something like this:

(A) ----
Aardvark
Apple
(B) ----
Bee
(C) ----
Cat
(K) ----
Kitten
Kalashnikov
(W) ----
Waffle

Is there a built-in way to do this?

More specifically, I'm using this ruby gem: https://github.com/eclubb/ncurses-ruby I'd prefer an answer that was generic, but if it can be solved with Ruby awesomeness, that's cool too.


回答1:


Assuming you are talking about the ncurses menu library (as "built-in"), you can make a nonselectable item using set_item_opts.



来源:https://stackoverflow.com/questions/34448130/menu-dividers-in-ncurses

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!