User Tools

Site Tools


Sidebar

Introduction

* Home

Documentation & help

LibreCAD Community

Help on DokuWiki

Temporary shorcuts

dev:v3:gui_api:menu:menu

This is an old revision of the document!


Menu GUI Class

Github Link

 namespace lc::ui::api 


Description

Constructs a menu gui object. Menu after being constructed needs to be added to the mainwindow menu bar or to another menu for it to be visible in the application.

  • Menu Name - string

Examples

  •  local menu1 = gui.Menu("Test")

Add Menu Item


Description

Add menu item to the menu. The item is added to the end of the menu at the last position.

  • Menu Item Label - string , Lua Callback - kaguya::LuaRef
    • returns MenuItem
  • Menu Item Label - string
    • return MenuItem
  • Pointer to Menu Item - MenuItem*

Examples

  •  local item1 = menu1:addItem("Item1") 
  •  local item1 = menu1:addItem("Item1", function() message("Test Item Clicked") end) 
  •  local item1 = gui.MenuItem("Item1")
     menu1:addItem(item1) 

Add Menu


Description

Add menu to the menu, menu is added at the end of the menu at the last position.

  • Menu Label - string
    • return Menu
  • Pointer to Menu - Menu*

Examples

  •  local menu2 = menu1:addMenu("Menu2") 
  •  local menu2 = gui.Menu("Menu2")
     menu1:addMenu(menu2) 

dev/v3/gui_api/menu/menu.1594050702.txt.gz · Last modified: 2020/07/06 15:51 by jedi18