I'd use the self.add_callbacks method as this is what most widgets use. Do you have some code you can share? Much easier to help if we can see your actual code, otherwise we're just guessing. On Sunday, 14 March 2021 at 18:30:22 UTC [email protected] wrote:
> Hi everyone! So I'm working on a widget from scratch that shows > taskwarrior tasks. I've already tweaked some other widgets to get a better > notion of how it works and I'm much more confident now to create my own. > The widget is already displaying the first task on the bar, but for some > reason I can't get the button callbacks to work. Is there a good way to > debug those? Because I tested the functions and they were working as > supposed to, but I couldn't test the callbacks itself properly. > I also saw that there are two main ways to make those callbacks. One is to > add the self.add_callbacks(dict_of_callbacks), with the buttons as keys and > functions as values respectively, and the other is identifying the buttons > directly from the button_press function. Are there too many differences > besides the first one seems more cleaner to me? I did inherited the > button_press function from the upper class. > Oh my widget inherits from ThreadPool, by the way, and I set up the > update_interval to something like 0.5. > -- 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/96bdf45e-5fcc-469b-baf2-1e2a3d86d3acn%40googlegroups.com.
