|
From: | ncursesml |
Subject: | New feature - menu item formatting |
Date: | Sat, 3 Oct 2015 01:20:16 +0200 |
Hello, Im new on this ML, so sorry for any mistakes... Long story short: I was wandering if menu items can be formatted autonomously, but sadly there is no set_item* API for this purpose. So I went and made terrible hack in /ncurses/base/MKunctrl.awk to allow passing ANSI control sequences in menu strings. That actually was partially successful, but unstable and not portable. Another try goes directly to menu library, it works for my purposes, so I would like to present you with the result (and possibly get merged?) Quick description: 1) new field in menu.h: tagITEM - unsigned int attr; /* Item attributes */ 2) New functions introduced: set_item_attr() /* Set attribute as attron() does */ item_attr() /* Return current attributes of the item */ 3) Patched _nc_Post_Item() to actually format the item Diff files are attached. Any comments welcomed. Best regards, Martin Sacha
menu.h.diff
Description: Text document
m_item_opt.c.diff
Description: Text document
m_post.c.diff
Description: Text document
signature.asc
Description: PGP signature
[Prev in Thread] | Current Thread | [Next in Thread] |