title: tkinter grid alignment: Python 2.7
body: <p>I'm having a problem with the grid alignment when I add in a text box.</p>
  
  <p>I've set up a simple GUI with a 3 column wide display. As part fo the GUI I have a text box for entering notes, and a spinbox for a defined number range. </p>
  
  <p>If I remove the text box from the active code my spinbox aligns correctly with all other entries, but when I place the text box in the grid my spinbox is moved over to the right.</p>
  
  <p>Doesn't seem to matter where the spinbox code is in relation to the text box, once the text box is present the spin box moves over to the right.</p>
  
  <p>At this stage I just can't see what is causing the problem. </p>
  
  <p>I'll admit I'm new to Tkinter (and stackoverflow).</p>
  
  <p>This is the particular line of code that causes the problem:</p>
  
  <pre><code>self.newText.grid(row=display_row, column=0, columnspan=4, padx=10, pady=10).
  </code></pre>
  
  <p>Sample code below. If I comment out the above line the spin box aligns correctly, if its present then the spinbox is offset. Its only the spinbox that is affected, neither Label, Entry, RadioButton or Text widgets are affected, but Spinbox is. These are the only widgets needed for my GUI.</p>
  
  <p>Any help appreciated.</p>
  
  <pre><code>#-------------------------------------------------------------------------------
  # Name:        MyGUI
  # Purpose:     Problem Sample
  #
  #-------------------------------------------------------------------------------
  
  
  from Tkinter import *
  
  #===============================
  # GUI Class
  #===============================
  
  class GUIClass():
      '''
      GUI class
      '''
      def __init__(self):
          self.displayframe   = 0
          self.NameVar        = StringVar()
          self.NumVar         = StringVar()   # shouldn't be but it works
          self.ButtonVar      = BooleanVar()
  
      #===============================
      # Function for standard button
      def StandardEntry(self,  display_row,labeltext,entryvar):
          '''
          Standard 'Entry' feature for GUI.
          '''
          Label(self.displayframe, text=labeltext).grid(row=display_row, column=0, sticky=W)
          name = Entry(self.displayframe, textvariable=entryvar)
          name.grid(row=display_row, column=1, sticky=W)
          display_row+=1
  
      def BooleanRadioButton(self, display_row, labeltext, entryvar):
          '''
          Boolean true/false radio button function
          '''
          Label(self.displayframe, text=labeltext).grid(row=display_row, column=0, sticky=W)
          ButtonOn = Radiobutton(self.displayframe, text="Enabled", variable=entryvar, value=True)
          ButtonOn.grid(row=display_row, column=1, sticky=W)
          ButtonOn = Radiobutton(self.displayframe, text="Disabled", variable=entryvar, value=False)
          ButtonOn.grid(row=display_row, column=2, sticky=W)
  
      def StandardSpinBox(self, display_row, labeltext, min_value, max_value, variablename):
          '''
          Standard spinbox for this project.
          '''
          Label(self.displayframe, text=labeltext).grid(row=display_row, column=0, sticky=W)
          spinboxwidget = Spinbox(self.displayframe, from_=min_value, to=max_value, textvariable=variablename)
          spinboxwidget.grid(row=display_row, column=1)
  
      def AddFreeTextForm(self, display_row, notes):
          '''
          Standard widget for free text entry
          '''
          self.newText = Text(self.displayframe, width=50, height=8, takefocus=0)
          self.newText.grid(row=display_row, column=0, columnspan=4, padx=10, pady=10)
  
      def movesettingstoclass(self, dataclass):
          dataclass.NameVar       = self.NameVar.get()
          dataclass.NumVar        = int(self.NumVar.get())
          dataclass.ButtonVar     = self.ButtonVar.get()
  
  
      def populate(self, dataclass):
          '''
          Takes the data in the data structure and populates the GUI.
          '''
          self.NameVar.set(dataclass.NameVar)
          self.NumVar.set(str(dataclass.NumVar))
          self.ButtonVar.set(dataclass.ButtonVar)
  
  #===============================
  # Data Class
  #===============================
  class DataClass():
  
      def __init__(self):
          self.NameVar         = 'SomeName'
          self.NumVar          = 11
          self.ButtonVar       = False
  
      def showvalues(self):
          '''
          Debug function/method for checking values are set correctly.
          '''
  
          msg += 'NameVar    :     %s\n' %self.NameVar
          msg += 'NumVar     :     %d\n' %self.NumVar
          msg += 'KVVar      :     %d\n' %self.KVVar
          if self.ButtonVar == True:
              msg += 'ButtonVar:     True\n'
          else:
              msg += 'ButtonVar:     False\n'
  
          print msg
  
  
  #=============================================
  # Main window
  #=============================================
  root = Tk()
  
  MyData = DataClass()
  mainGUI = GUIClass()
  
  root.title('Problem Example')
  menu = Menu(root)
  root.config(menu=menu)
  
  
  #==============================================================================
  # text fields to be entered by the user...
  
  display_row = 0
  Notes = ''
  
  mainGUI.displayframe = Frame(root)
  
  #==============================================================================
  # Some entry input parameter
  
  mainGUI.StandardEntry(display_row, "Some Label", mainGUI.NameVar)
  display_row+=1
  
  #==============================================================================
  # Some spinbox input parameter
  
  mainGUI.StandardSpinBox(display_row, "Some Label", 3, 21, mainGUI.NumVar)
  display_row+=1
  
  #==============================================================================
  # Some Radiobutton input parameter
  
  SwitchOn = mainGUI.BooleanRadioButton(display_row, "Button Label", mainGUI.ButtonVar)
  display_row+=1
  
  Label(mainGUI.displayframe, text="Configuration Notes").grid(row=display_row, column=1, sticky=W)
  display_row += 1
  
  #notes = mainGUI.AddFreeTextForm(display_row, "Configuration Notes", MyData.Notes)
  notes = mainGUI.AddFreeTextForm(display_row, Notes)
  display_row+=1
  
  mainGUI.displayframe.pack(anchor='w')
  
  #==============================================================================
  # and the magic all happens here
  mainloop()
  </code></pre>