Elv13 / radical

An extensible menu subsystem for Awesome WM
222 stars 16 forks source link

set_menu call from README does not work since 3.6.x+ #42

Open alepmaros opened 7 years ago

alepmaros commented 7 years ago

The example of adding a menu to a widget in the README does not work because the function changed after awesome 3.6.x

On the README it says you can add a menu to a widget like this:

mytextbox:set_menu(menu,3)

But that results in this error:

stack traceback:
        [C]: in function 'assert'
        /usr/local/share/awesome/lib/gears/object.lua:34: in upvalue 'find_signal'
        /usr/local/share/awesome/lib/gears/object.lua:52: in function 'gears.object.connect_signal'
        /home/apm/.config/awesome/radical/init.lua:64: in method 'set_menu'
        /home/apm/.config/awesome/rc.lua:246: in main chunk
error: /usr/local/share/awesome/lib/gears/object.lua:34: name must be a string, got: number

But the function on Awesome 3.6.x+ changed to:

local function set_menu(self,menu, event, button_id, mode)

So I got it working by calling the function like this:

mytextbox:set_menu(menu, "button::pressed", 3)

I didn't create a pull request because I don't know if you can specify the parameter you are passing like in Python (I couldn't find it) or if it is better to just change the parameter orders from the function or if I am overlooking something.

coldfix commented 7 years ago

Resolved in #45.

Elv13 commented 7 years ago

(just an update: thanks you, I am AFK for a couple days, I will review this as soon as I have access to a real computer again)

On Oct 11, 2017 11:13 AM, "Thomas G." notifications@github.com wrote:

Resolved in #45 https://github.com/Elv13/radical/pull/45.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Elv13/radical/issues/42#issuecomment-335747748, or mute the thread https://github.com/notifications/unsubscribe-auth/AAUxoCZkiY7gaHAerF-1hDofY-hdRubtks5srIbUgaJpZM4LzTdx .