radical icon indicating copy to clipboard operation
radical copied to clipboard

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

Open alepmaros opened this issue 9 years ago • 2 comments

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.

alepmaros avatar Jan 31 '17 23:01 alepmaros

Resolved in #45.

coldfix avatar Oct 11 '17 09:10 coldfix

(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." [email protected] 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 .

Elv13 avatar Oct 11 '17 23:10 Elv13