Describe the bug
Tried using widget-id option for button callback to reuse a callback. The callback function definition does appear to have the widget-id parameter. However, the "command=..." just has a straight function with no parameters (did you intend to generate a lambda here with the widget-id?
To Reproduce
Steps to reproduce the behavior:
See attached .ui fle
Generate it as a custom widget. Generated code is:
Describe the bug Tried using widget-id option for button callback to reuse a callback. The callback function definition does appear to have the widget-id parameter. However, the "command=..." just has a straight function with no parameters (did you intend to generate a lambda here with the widget-id?
To Reproduce Steps to reproduce the behavior: See attached .ui fle Generate it as a custom widget. Generated code is:
!/usr/bin/python3
import tkinter as tk import tkinter.ttk as ttk
class WidgetidWidget(tk.Toplevel): def init(self, master=None, kw): super(WidgetidWidget, self).init(master, kw) self.button1 = ttk.Button(self) self.button1.configure(text='button1') self.button1.pack(side="top") self.button1.configure(command=self.testcallback) self.configure(height=200, width=200)
if name == "main": root = tk.Tk() widget = WidgetidWidget(root) widget.pack(expand=True, fill="both") root.mainloop()
Your Environment (please complete the following information):
Additional context Add any other context about the problem here.