Skip to content

Instantly share code, notes, and snippets.

@shundhammer
Last active July 2, 2020 08:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shundhammer/34c6640e8ead2cda894eb67123943afc to your computer and use it in GitHub Desktop.
Save shundhammer/34c6640e8ead2cda894eb67123943afc to your computer and use it in GitHub Desktop.
Menus in libyui

Menus in libyui

New widget: YMenuBar; mandatory for all UIs.

Features:

  • A menu bar holding pull-down menus

  • Pull-down menus

  • Simple menu items with an ID and a translated text

    • optional: a keyboard shortcut (globally accessible in that dialog)
    • optional: an icon
  • Menu separators (a simple line separating groups of menu items)

  • Submenus

  • Enable / disable individual menu items

Optional:

  • Checkable menu items (on/off)
  • ?? Also optional radio button behaviour for checkable menu items?
    • This would need some grouping; either in the current submenu or in a special (invisible) radio button group container

API

  • Check if the existing YMenuEvent is sufficient (probably it is)
  • Maybe don't extend the YCPValue-based yast-ycp-ui-bindings, use SWIG bindings instead
  • SWIG bindings appear to exist for libyui for the Mageia project that uses primarily libyui-gtk, but also libyui-ncurses

Extension: Contex Menus?

Once we have the infrastructure for this, we might want to check if and when context menus make sense for YaST; possibly for larger widgets like YRichText (proposal!), tables and trees.

Old: The Wizard Menu

This is a part of the YWizard widget which is an optional "special" widget that not all UIs (not NCurses, for example!) provide. It uses some more UI.WizardCommand() sub-commands.

Very basic stuff, only simple menu items, no enabling/disabling, no submenus, no checkable items.

Related Project

https://github.com/manatools/libyui-mga

Looks very basic, very much like the wizard menu. That menu bar inherits YSelectionWidget (not sure if that's a good idea; need to check).

They also have "hidden" menu items which is most questionable from a usability perspective.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment