Ok, I've found my mistake. I have to define a key called 'name' and use its 
value in qtile.widgetMap['namevalue'].mymethod()
Sorry for bothering you, guys, and thanks for your help

Best regards,
Arsenii


On Saturday, August 19, 2017 at 7:15:11 PM UTC+2, Arsenii Riazantsev wrote:
>
>
> <https://lh3.googleusercontent.com/-33e4O7lNuX0/WZhxMaDUutI/AAAAAAAAARY/9xAVw67pH6EyRPV7S7JpOv4AJS-jfqSwgCLcBGAs/s1600/Untitled.png>
> Hey, thanks for your help. I tried, but maybe my implementation is 
> incorrect. Is it enough to show just a screenshot? There is the widget's 
> method on the left side and the config part on the right. 
>
> On Thursday, August 17, 2017 at 2:10:17 AM UTC+2, Tycho Andersen wrote:
>>
>> Hi Arsenii, 
>>
>> On Wed, Aug 16, 2017 at 03:10:58PM -0700, Arsenii Riazantsev wrote: 
>> > Hi, everyone! 
>> > 
>> > I am new to Python.I would like to make one custom widget and to call 
>> one 
>> > of it's method after pressing a key. I tried to import "Key" class and 
>> to 
>> > bind the button with the method, but it doesn't work. Is it not 
>> possible to 
>> > implement such a bind at all? Maybe there is another way to do it? 
>>
>> Try, 
>>
>> def foo(qtile): 
>>     qtile.widgetMap['yourwidget'].your_method() 
>>
>> keys = [ 
>>     ... 
>>     Key([mod], "k", lazy.function(foo)), 
>> ] 
>>
>> Cheers, 
>>
>> Tycho 
>>
>

-- 
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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to