Adding frame over lable on python
Question: I want to create frame over the label and been trying lots of code but it is
not working out. Also trying to make checkbutton to left side of the screen
with no frame. Can anyone help me? Thank you

I got far as this [![1st
Try](http://i.stack.imgur.com/JKWNM.png)](http://i.stack.imgur.com/JKWNM.png)

But I want to make it look like this with the frame

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

    
    
    show_status = Label(dashboard, bd = 5, text = 'Even', fg = 'black',
                            font = ('Arial', 70), width = 8)
    
    def update_dashboard():
    
    three_buttons = Label(dashboard, relief = 'groove')
    
    Alpha_button = Checkbutton(three_buttons, text = 'Alpha',
                                  variable = alpa_1,
                                  command = update_dashboard)
    
    Beta_button = Checkbutton(three_buttons, text = 'Beta',
                               variable = beta_2, 
                               command = update_dashboard)
    
    Gamma_button = Checkbutton(three_buttons, text = 'Gamma',
                               variable = gemma_3, 
                               command = update_dashboard)
    
    
    Alpha_button.grid(row = 1, column = 0, sticky = 'w')
    Beta_button.grid(row = 1, column = 2, sticky = 'w')
    Gamma_button.grid(row = 1, column = 4, sticky = 'w')
    
    margin = 5 # pixels
    
    show_status.grid(padx = margin, pady = margin, row = 1,
                         column = 1, columnspan = 2,)
    three_buttons.grid(row = 4, column = 2, sticky = W)
    
    
    dashboard.mainloop()
    


Answer: You can use a Frame or a Canvas and draw the rest of the widgets on it. Let us
use the Frame by relying on the [grid layout
manager](http://effbot.org/tkinterbook/grid.htm).

To have that effect you are looking for, you simply need to span the label
over the 3 columns of the check button widgets using the option the
[`columnspan`](http://effbot.org/tkinterbook/grid.htm#Tkinter.Grid.grid-
method) option.

# Full program

Here is a simple solution using the object oriented concepts:

    
    
    '''
    Created on May 8, 2016
    
    @author: Billal Begueradj
    '''
    import Tkinter as Tk
    
    
    class Begueradj(Tk.Frame):
        '''
        Dislay a Label spanning over 3 columns of checkbuttons
        '''
        def __init__(self, parent):
            '''Inititialize the GUI
            '''
            Tk.Frame.__init__(self, parent)
            self.parent=parent
            self.initialize_user_interface()
    
        def initialize_user_interface(self):
            """Draw the GUI
            """
            self.parent.title("Billal BEGUERADJ")       
            self.parent.grid_rowconfigure(0,weight=1)
            self.parent.grid_columnconfigure(0,weight=1)
            self.parent.config(background="lavender")    
    
            # Create a Frame on which other elements will be attached to
            self.frame = Tk.Frame(self.parent, width = 500, height = 207)  
            self.frame.pack(fill=Tk.X, padx=5, pady=5)   
    
            # Create the checkbuttons and position them on the second row of the grid
            self.alpha_button = Tk.Checkbutton(self.frame, text = 'Alpha', font = ('Arial', 20))
            self.alpha_button.grid(row = 1, column = 0)
    
            self.beta_button = Tk.Checkbutton(self.frame, text = 'Beta', font = ('Arial', 20))
            self.beta_button.grid(row = 1, column = 1)
    
            self.gamma_button = Tk.Checkbutton(self.frame, text = 'Gamma', font = ('Arial', 20))
            self.gamma_button.grid(row = 1, column = 2)
    
             # Create the Label widget on the first row of the grid and span it over the 3 checbbuttons above
            self.label = Tk.Label(self.frame, text = 'Even', bd = 5, fg = 'black', font = ('Arial', 70), width = 8, relief = 'groove')
            self.label.grid(row = 0, columnspan = 3)
    
    
    
    # Main method
    def main():
        root=Tk.Tk()
        d=Begueradj(root)
        root.mainloop()
    
    # Main program       
    if __name__=="__main__":
        main()
    

# Demo

Here is a screenshot of the running program:

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

