Re: Grid, individuell einstellbar für Zeilen und Spalten
Verfasst: Donnerstag 8. Oktober 2015, 16:58
Hi Alfons
Habe noch etwas aufbauend auf die gestrigen Variante ausprobiert. Das Designer Gui-Skript ist nach wie vor button_test_01.py
Um Callback's von den Buttons zu erhalten habe ich mein button_test_code_01.py Skript noch mit folgendem erweitert:
Funktioniert bestens. Jetzt noch eine Frage beim beenden (schliessen des Hauptfensters wirft proxy.py in Zeile-17 folgende Exception:
Gruss wuf
Habe noch etwas aufbauend auf die gestrigen Variante ausprobiert. Das Designer Gui-Skript ist nach wie vor button_test_01.py
Code: Alles auswählen
Frame('main_frame')
goIn()
Button('button_01',**{'text': 'Button-1'})
Button('button_02',**{'text': 'Button-2'})
Button('button_03',**{'text': 'Button-3'})
widget('button_01').pack(side='left')
widget('button_02').pack(side='left')
widget('button_03').pack(side='left')
goOut()
widget('main_frame').pack(expand='1')Code: Alles auswählen
from functools import partial
import DynTkInter as tk
def buttons_callback(button):
print("You have pressed {}".format(button))
def close_app():
print('close')
app_win.destroy()
# designed gui related
app_win = tk.Tk(link = 'button_test_01.py')
tk.goto('main_frame')
tk.goIn()
button_01 = tk.widget('button_01')
button_02 = tk.widget('button_02')
button_03 = tk.widget('button_03')
# my code
app_win.geometry('300x200')
app_win.protocol("WM_DELETE_WINDOW", close_app)
button_01.configure(text="Hello")
button_01.configure(command=partial(buttons_callback, button_01['text']))
button_02.configure(command=partial(buttons_callback, button_02['text']))
button_03.configure(command=partial(buttons_callback, button_03['text']))
app_win.mainloop()Dies kann sicher noch unterdrückt werden oder müssen da noch weitere Abfang-Massnahmen getroffen werden?close
Exception ignored in: <bound method Proxy.__del__ of <proxy.Proxy object at 0x7f4a47d6d438>>
Traceback (most recent call last):
File "/home/nikola/Downloads/python-gui-messaging-master/GuiDesigner/proxy.py", line 17, in __del__
File "/usr/lib/python3.4/tkinter/__init__.py", line 1886, in __getattr__
AttributeError: 'tkapp' object has no attribute 'undo_receiveAll_extern'
Gruss wuf