alejandroautalan / pygubu

A simple GUI builder for the python tkinter module
MIT License
2.01k stars 213 forks source link

Set widget identifier as name if given #287

Closed BloodyRain2k closed 1 year ago

BloodyRain2k commented 1 year ago

This is a small change so that custom set widget id's actually get used in the creation process of widgets. It's what I came up with regarding https://github.com/alejandroautalan/pygubu-designer/discussions/212

This is what it looks like in the code: image .activity refers to a named tk.Frame in the mainwindow .frm_task_8 is another tk.Frame placed in the frame activity .lbl_from is a named tk.Label inside frm_task_8

To me, this way of using the widget names we can assign in the designer make actually sense, instead of the plain !<classname><#n>. It will still do this by default, but now custom names are actually used.

Not sure if it might be better to also prefix the names with a special character, just a different one than the default !, but for that I understand Tkinter's / Pygubu's .nametowidget() workings too little.

alejandroautalan commented 1 year ago

Moved your idea to BuilderObject class.