Closed wyzarddoc72 closed 5 months ago
Hello @wyzarddoc72 thanks for trying pygubu, and sorry for the late response.
The purpose of this panel is to speed up the definition of bindings in the designer. To do this, the user must define three parameters:
Sequence descriptor: sequence or event to be associated with
Event handler: is the name of the function or method that will be called when the event is fired.
Add: Specifies that the handler will be added to the handler list associated with the same sequence or event.
The ttk.Treeview widget raises a virtual event "\<\<TreeviewSelect>>" when the user selects a row from the treeview. To define in the designer a function that reacts when this event is executed, proceed as follows:
If we generate the code with the "Application" template it will look similar to the following:
class BindingsApp:
def __init__(self, master=None):
self.builder = builder = pygubu.Builder()
builder.add_resource_path(PROJECT_PATH)
builder.add_from_file(PROJECT_UI)
# Main widget
self.mainwindow: tk.Toplevel = builder.get_object("toplevel1", master)
builder.connect_callbacks(self)
def run(self):
self.mainwindow.mainloop()
def on_row_selected(self, event=None):
pass
The call to "builder.connect_callbacks(self)" connects the bindings to the generated methods.
In the generated "on_row_selected" method we write the code necessary to react to that event.
For more info about bingings see this page I hope this information helps you.
Regards Alejandro A.
Thanks so much for the reply. I decided I did not need the binding functionality after all.In future releases I would suggest a similar type of entry box for the button command so that options could be added/passed to the command thanks again
On Sunday, February 11, 2024 at 12:08:02 AM MST, Alejandro Autalán ***@***.***> wrote:
Hello @wyzarddoc72 thanks for trying pygubu, and sorry for the late response.
The bindings panel
The purpose of this panel is to speed up the definition of bindings in the designer. To do this, the user must define three parameters:
Sequence descriptor: sequence or event to be associated with
Event handler: is the name of the function or method that will be called when the event is fired.
Add: Specifies that the handler will be added to the handler list associated with the same sequence or event.
Example
The ttk.Treeview widget raises a virtual event "<
Captura.desde.2024-02-11.03-27-28.png (view on web)
If we generate the code with the "Application" template it will look similar to the following: class BindingsApp: def init(self, master=None): self.builder = builder = pygubu.Builder() builder.add_resource_path(PROJECT_PATH) builder.add_from_file(PROJECT_UI)
self.mainwindow: tk.Toplevel = builder.get_object("toplevel1", master)
builder.connect_callbacks(self)
def run(self):
self.mainwindow.mainloop()
def on_row_selected(self, event=None):
pass
The call to "builder.connect_callbacks(self)" connects the bindings to the generated methods.
In the generated "on_row_selected" method we write the code necessary to react to that event.
For more info about bingings see this page I hope this information helps you.
Regards Alejandro A.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>
Another use question --> I see colors in the generated file but not on my x windows?? How do I activate background colors?thanksDoc On Sunday, February 11, 2024 at 12:08:02 AM MST, Alejandro Autalán @.***> wrote:
Hello @wyzarddoc72 thanks for trying pygubu, and sorry for the late response.
The bindings panel
The purpose of this panel is to speed up the definition of bindings in the designer. To do this, the user must define three parameters:
Sequence descriptor: sequence or event to be associated with
Event handler: is the name of the function or method that will be called when the event is fired.
Add: Specifies that the handler will be added to the handler list associated with the same sequence or event.
Example
The ttk.Treeview widget raises a virtual event "<
Captura.desde.2024-02-11.03-27-28.png (view on web)
If we generate the code with the "Application" template it will look similar to the following: class BindingsApp: def init(self, master=None): self.builder = builder = pygubu.Builder() builder.add_resource_path(PROJECT_PATH) builder.add_from_file(PROJECT_UI)
self.mainwindow: tk.Toplevel = builder.get_object("toplevel1", master)
builder.connect_callbacks(self)
def run(self):
self.mainwindow.mainloop()
def on_row_selected(self, event=None):
pass
The call to "builder.connect_callbacks(self)" connects the bindings to the generated methods.
In the generated "on_row_selected" method we write the code necessary to react to that event.
For more info about bingings see this page I hope this information helps you.
Regards Alejandro A.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>
Another use question --> I see colors in the generated file but not on my x windows?? How do I activate background / foreground colors? thanks Doc
Thanks for all your good information!!
*I have looked for information on how to use the bind options in the designer and have had no luck. Any help would be appreciated. Request --> A button or fill in the blank for text boxes so string text input could be done with less frustration thanks for all your hard work other than a few glitches the program works great.