import tkinter as tk
from tkinter import ttk


STANDARD_MARGIN = (3, 3, 12, 12)


class Launch(tk.Tk):
    def __init__(self):
        super().__init__()
        self.title('Skeleton analysis tool')
        self.smooth_radius = tk.DoubleVar(value=0.1, name='Smoothing radius')
        self.threshold_radius = tk.DoubleVar(value=50e-9,
                                             name='Threshold radius')
        self.brightness_offset = tk.DoubleVar(value=-10,
                                              name='Brightness offset')
        self.scale_metadata_path = tk.StringVar(value='Scan,PixelHeight',
                                                name='Scale metadata path')
        self.parameters = [
            self.smooth_radius,
            self.threshold_radius,
            self.brightness_offset,
            self.scale_metadata_path
        ]

        # allow resizing
        self.rowconfigure(0, weight=1)
        self.columnconfigure(0, weight=1)

        self.create_main_frame()

    def create_main_frame(self):
        main = ttk.Frame(master=self, padding=STANDARD_MARGIN)
        main.grid(row=0, column=0, sticky='nsew')
        parameters = ttk.Frame(master=main, padding=STANDARD_MARGIN)
        parameters.grid(sticky='nsew')

        cur_row = 0

        heading = ttk.Label(parameters, text='Analysis parameters')
        heading.grid(column=0, row=cur_row, sticky='n')
        cur_row += 1

        for i, param in enumerate(self.parameters):
            param_label = ttk.Label(parameters, text=param._name)
            param_label.grid(row=cur_row + i, column=0, sticky='nsew')
            param_entry = ttk.Entry(parameters, textvariable=param)
            param_entry.grid(row=cur_row + i, column=1, sticky='nsew')
        cur_row += i

        main.pack()


if __name__ == '__main__':
    app = Launch()
    app.mainloop()

@@ -1,16 +1,26 @@
+import os%0A
 import tkinter a
@@ -24,16 +24,42 @@
 r as tk%0A
+import tkinter.filedialog%0A
 from tki
@@ -892,16 +892,108 @@
      %5D%0A%0A
+        self.input_files = %5B%5D%0A        self.output_folder = os.path.expanduser('~/Desktop')%0A%0A
         
@@ -1263,32 +1263,183 @@
  sticky='nsew')%0A
+        self.create_parameters_frame(main)%0A        self.create_buttons_frame(main)%0A        main.pack()%0A%0A    def create_parameters_frame(self, parent):%0A
         paramete
@@ -1460,20 +1460,22 @@
 (master=
-main
+parent
 , paddin
@@ -1537,29 +1537,8 @@
 ')%0A%0A
-        cur_row = 0%0A%0A
     
@@ -1636,23 +1636,17 @@
 =0, row=
-cur_row
+0
 , sticky
@@ -1654,29 +1654,8 @@
 'n')
-%0A        cur_row += 1
 %0A%0A  
@@ -1701,16 +1701,25 @@
 rameters
+, start=1
 ):%0A     
@@ -1808,34 +1808,24 @@
 el.grid(row=
-cur_row + 
 i, column=0,
@@ -1945,88 +1945,974 @@
 row=
-cur_row + i, column=1, sticky='nsew')%0A        cur_row += i%0A%0A        main.pack()%0A
+i, column=1, sticky='nsew')%0A%0A    def create_buttons_frame(self, parent):%0A        buttons = ttk.Frame(master=parent, padding=STANDARD_MARGIN)%0A        buttons.grid(sticky='nsew')%0A        actions = %5B%0A            ('Choose files', self.choose_input_files),%0A            ('Choose output folder', self.choose_output_folder),%0A            ('Run', self.run)%0A        %5D%0A        for col, (action_name, action) in enumerate(actions):%0A            button = ttk.Button(buttons, text=action_name,%0A                                command=action)%0A            button.grid(row=0, column=col)%0A%0A    def choose_input_files(self):%0A        self.input_files = tk.filedialog.askopenfilenames()%0A%0A    def choose_output_folder(self):%0A        self.output_folder = %5C%0A                tk.filedialog.askdirectory(initialdir=self.output_folder)%0A%0A    def run(self):%0A        from skan import pre, csr%0A        print('In:', self.input_files)%0A        print('Out:', self.output_folder)%0A        print('running!')
 %0A%0Aif

Add action buttons