Sorry. Missed the part in your first message where you said foo was a 
function. 

Glad you got it working.

On Sunday, 3 October 2021 at 19:08:33 UTC+1 [email protected] wrote:

> I got it working now:
>
> mouse_callbacks={'Button1':lambda: qtile.cmd_function(foo)},
>
> the cmd_function is to be called. now it works.
>
> Thanks
>
>
>
> 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/2be97638-21e0-42ee-aac4-5a4c556afa82n%40googlegroups.com.

Reply via email to