From 36b90cce4d3d34d785b33b4b7bd7da49be08645d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20Veres-Szentkir=C3=A1lyi?= Date: Mon, 4 Nov 2013 23:09:49 +0100 Subject: [PATCH] align buttons horizontally, use command callback --- pysstv/examples/gimp-plugin.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pysstv/examples/gimp-plugin.py b/pysstv/examples/gimp-plugin.py index b82e9d1..0d475f5 100755 --- a/pysstv/examples/gimp-plugin.py +++ b/pysstv/examples/gimp-plugin.py @@ -7,7 +7,7 @@ from gimpfu import register, main, pdb, PF_BOOL, PF_STRING, PF_RADIO from tempfile import mkstemp from PIL import Image, ImageTk -from Tkinter import Tk, Label, Button, Checkbutton, IntVar +from Tkinter import Tk, Label, Button, Checkbutton, IntVar, Frame, LEFT from pysstv import __main__ as pysstv_main from pysstv.examples.pyaudio_sstv import PyAudioSSTV from pysstv.sstv import SSTV @@ -61,7 +61,7 @@ class Transmitter(object): def audio_thread_ended(self): self.tx_enabled.set(0) - def close(self, e): + def close(self): self.root.destroy() @@ -83,12 +83,12 @@ def transmit_current_image(image, drawable, mode, vox, fskid): img_widget = Label(root, image=tk_img) img_widget.image = tk_img img_widget.pack() + buttons = Frame(root) for text, tram in (('TX', tm), ('1750 Hz', tm1750)): - Checkbutton(root, text=text, indicatoron=False, padx=5, pady=5, - variable=tram.tx_enabled, command=tram.start_stop_tx).pack() - close_btn = Button(root, text="Close") - close_btn.bind('', tm.close) - close_btn.pack() + Checkbutton(buttons, text=text, indicatoron=False, padx=5, pady=5, + variable=tram.tx_enabled, command=tram.start_stop_tx).pack(side=LEFT) + Button(buttons, text="Close", command=tm.close).pack(side=LEFT) + buttons.pack() root.mainloop() finally: os.remove(png_fn)