Better document menthods
This commit is contained in:
parent
c3d38932f4
commit
960028e414
20
README.md
20
README.md
|
@ -198,6 +198,23 @@ Multiple items can have multiple sets of options.
|
|||
| button4 | Scroll up action | function |
|
||||
| button5 | Scroll down action | function |
|
||||
|
||||
###Common methods
|
||||
|
||||
All menus provide a bunch of methods. Most of them have been coverred above, but
|
||||
here is the list:
|
||||
|
||||
| Name | Description | Arguments | Return |
|
||||
| ---------------- | -------------------------------------------- | --------------------- | ------ |
|
||||
| add_item | Add new item to a menu | array of options | item |
|
||||
| add_widget | Add a new widget instead of an item | a widget, args | --- |
|
||||
| add_embeded_menu | Add an inline menu to another menu | an "embed" menu | --- |
|
||||
| add_key_binding | Add a global key binding to a menu | mod array, key | --- |
|
||||
| add_key_hook | Add a callback when a key is pressed | mod, key, event, func | --- |
|
||||
| clear | Remove all items | --- | --- |
|
||||
| scroll_down | If the menu is cropped, scroll down | --- | --- |
|
||||
| scroll_up | If the menu is cropped, scroll up | --- | --- |
|
||||
|
||||
|
||||
###Beautiful options
|
||||
|
||||
Radical also use the some of the same theme options as awful.menu, plus some:
|
||||
|
@ -205,12 +222,15 @@ Radical also use the some of the same theme options as awful.menu, plus some:
|
|||
* menu_height
|
||||
* menu_width
|
||||
* menu_border_width
|
||||
* menu_border_color
|
||||
* border_width
|
||||
* border_color
|
||||
* menu_fg_normal
|
||||
* menu_bg_focus
|
||||
* menu_bg_header
|
||||
* menu_bg_alternate
|
||||
* menu_bg_normal
|
||||
* menu_bg_highlight
|
||||
* menu_submenu_icon
|
||||
* menu_separator_color
|
||||
* menu_submenu_icon
|
||||
|
|
3
base.lua
3
base.lua
|
@ -252,7 +252,6 @@ local function add_embeded_menu(data,menu)
|
|||
end
|
||||
|
||||
local function add_key_binding(data,mod,key,func)
|
||||
print("\n\n\nCAT",mod,key,func)
|
||||
capi.root.keys(util.table.join(capi.root.keys(),aw_key(mod or {}, key, func and func() or function ()
|
||||
print("bob")
|
||||
data.visible = not data.visible
|
||||
|
@ -420,7 +419,7 @@ local function new(args)
|
|||
end
|
||||
end
|
||||
|
||||
function data:remove_key_hook(key)
|
||||
function data:remove_key_hook(key) --TODO broken?
|
||||
for k,v in pairs(internal.filter_hooks or {}) do
|
||||
if k.key == key then
|
||||
internal.filter_hooks[k] = nil
|
||||
|
|
Loading…
Reference in New Issue