- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
if (!menu) error(E_NOMEM); /* add titles and items */
if ((mn_addtitle(menu, "file", 0, 0, 0) != 0)
|| (mn_additem (menu, "load", 1, mcb_load, 0) != 0)
|| (mn_additem (menu, "save", 0, mcb_save, 0) != 0)
|| (mn_additem (menu, "mpost", 0, mcb_mpost, 0) != 0)
|| (mn_additem (menu, NULL, 0, 0, 0) != 0)
|| (mn_additem (menu, "quit", 0, mcb_quit, 0) != 0)
|| (mn_addtitle(menu, "actions", 0, 0, 0) != 0)
|| (mn_additem (menu, "init", 0, mcb_init, 0) != 0)
|| (mn_additem (menu, "start", 2, mcb_start, 0) != 0)
|| (mn_additem (menu, "stop", 4, mcb_start, 0) != 0)
|| (mn_additem (menu, NULL, 0, 0, 0) != 0)
|| (mn_additem (menu, "view", 0, mcb_view, 0) != 0)
|| (mn_additem (menu, "redraw", 0, mcb_redraw, 0) != 0)
|| (mn_addtitle(menu, "settings", 0, 0, 0) != 0)
|| (mn_additem (menu, "grid", 1, mcb_grid, 0) != 0)
|| (mn_additem (menu, "params", 0, mcb_params, 0) != 0)
|| (mn_addtitle(menu, "help", 0, 0, 0) != 0)
|| (mn_additem (menu, "about", 0, mcb_about, 0) != 0)
|| (mn_addtitle(menu, NULL, 0, 0, 0) != 0))
error(E_WIDGET);
mn_resize (menu, INITXEXT); /* set width of menu bar */
mn_visible(menu, MN_ITEMS, 3);/* show/hide menu items */
mn_enable (menu, MN_ITEMS, 3);/* enable/disable menu items */
Кусок кода из программы http://www.borgelt.net/doc/somd/somd.html для визуализации SOM. Эпичная проверка условий!
sayidandrtfm 04.06.2012 13:11 # +5
Только Xlib, только hardcore.
roman-kashitsyn 04.06.2012 13:14 # +3
Copy-Paste 04.06.2012 20:04 # −6