在ncurses的菜单分频器 [英] Menu dividers in ncurses

查看:103
本文介绍了在ncurses的菜单分频器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在有章节分隔的ncurses建立一个菜单。

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

我的例子列表如下:

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?

更具体地说,我使用这个红宝石宝石: https://github.com/eclubb/ncurses -ruby 我preFER的答案,这是通用的,但如果它可以使用Ruby迷死人来解决,这是太酷。

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.

推荐答案

假设你正在谈论的ncurses的 菜单 库(如内置),可以使用的 set_item_opts

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

这篇关于在ncurses的菜单分频器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆