When using lambda:
mouse_callbacks={'Button1':lambda: qtile.cmd_spawn(foo)}
The function is just never called
On Sunday, October 3, 2021 at 12:45:30 PM UTC-5 Gibranlp wrote:
> What is the right implementation of mouse callback on functions?
>
> I have already imported qtile
>
> from libqtile import qtile
>
> I have a working function, called by key shortcut that works fine, but hen
> i use mouse callbacks i just dont know how to make it work.
>
> foo();
>
> I have tried this so far on mouse callbacks
>
> - mouse_callbacks={'Button1':qtile.cmd_spawn(foo)}
>
> which gives the error:
>
> AttributeError: 'NoneType' object has no attribute 'cmd_spawn'
>
> I have also tried
>
> - mouse_callbacks={'Button1':qtile.function(foo)}
>
> and i get the error:
>
> mouse_callbacks={'Button1':qtile.function(set_rand_wallpaper)},
> AttributeError: 'NoneType' object has no attribute 'function'
>
> I have tryed with lazy object which i know now that are not callable,
>
> mouse_callbacks={'Button1':lazy.function(foo)}
>
> Can anyone point me in the right direction?
>
> thanks
>
>
>
>
--
You received this message because you are subscribed to the Google Groups
"qtile-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/qtile-dev/5da2fb90-e687-47f0-9985-8e44318ad4a1n%40googlegroups.com.