improve Frame of Tkinter in Python
Question: I am quite new to use Frame of Tkinter in Python. I discovered Frame from the
following [post](http://stackoverflow.com/questions/32198849/set-the-correct-
tkinter-widgets-position-in-python) When i run the GUI the Check box are not
in the same line.

[![enter image description
here](http://i.stack.imgur.com/jB3jB.png)](http://i.stack.imgur.com/jB3jB.png)

For this reason i have the following two questions:

1) is it possible to use "grid" in the frame in order to place the widget
where i wish?

2) Is it possible to place for example "Camera white balance" and "average
white balance" in the same row? in grid is for example row=0, column=0 and
row=0, column=1

3) if i add a line below the button "Input raw image file" using the code:

    
    
    self.sep = Frame(self, height=2, width=450, bd=1, relief=SUNKEN)
    self.sep.grid(row=1, column=0, columnspan=4, padx=5, pady=5)
    

The Run works forever without showing the GUI.

My code is:

    
    
    from __future__ import division
    from Tkinter import *
    import tkMessageBox
    import tkFileDialog
    
    
    class MainWindow(Frame):
        def __init__(self):
            Frame.__init__(self)
            self.master.title("FOO frame")
            self.master.minsize(350, 150)
            self.grid(sticky=W+N+S+E)
    
            top_frame = Frame(self)
            middle_frame = Frame(self)
            bottom_frame = Frame(self)
    
            top_frame.pack(side="top", fill="x")
            middle_frame.pack(side="top", fill="x")
            bottom_frame.pack(side="top", fill="x")
    
            self.open = Button(top_frame,text="Input raw image file",
                               command=self.open,
                               activeforeground="red")
            self.open.pack(side="left")
    
            self.CheckVar_camera_white_balance = IntVar()
            self.CheckVar_camera_white_balance = Checkbutton(middle_frame,
                text="Camera white balance",
                variable=self.CheckVar_camera_white_balance,
                onvalue=1,
                offvalue=0)
            self.CheckVar_camera_white_balance.pack(side="top", fill="x")
    
            self.CheckVar_average_whole_image_white_balance = IntVar()
            self.CheckVar_average_whole_image_white_balance = Checkbutton(middle_frame,
                text="Average white balance",
                variable=self.CheckVar_average_whole_image_white_balance,
                onvalue=1,
                offvalue=0)
            self.CheckVar_average_whole_image_white_balance.pack()
    
            self.CheckVar_correct_chromatic_aberration = IntVar()
            self.CheckVar_correct_chromatic_aberration = Checkbutton(middle_frame,
                text="Correct chromatic aberration",
                variable=self.CheckVar_correct_chromatic_aberration,
                onvalue=1,
                offvalue=0)
            self.CheckVar_correct_chromatic_aberration.pack()
    
            self.CheckVar_fix_dead_pixels = IntVar()
            self.CheckVar_fix_dead_pixels = Checkbutton(middle_frame,
                text="Fix dead pixels",
                variable=self.CheckVar_fix_dead_pixels,
                onvalue=1,
                offvalue=0)
            self.CheckVar_fix_dead_pixels.pack()
    
    
    # functions
    
        def open(self):
            self.filename_open = tkFileDialog.askopenfilenames(defaultextension='.*')
    
    if __name__ == "__main__":
       d = MainWindow()
       d.mainloop()
    


Answer:   1. Yes, it is possible to use `grid` In any frame you wish
  2. Yes, it is possible to place "Camera white balance" and "average white balance" in the same row.
  3. The reason the code runs forever without displaying anything is because you are using both grid (for the separator) and pack (for the frames). They both have the same parent so you can only use one or the other.

To get things to align you should read the documentation to learn about all of
the options available when calling `grid` and `pack`. These options allow you
to center itemsm or align them alon an edge, control padding, and so on.

