title: How to make a python GUI application desktop size independent?
body: <p>I have created a GUI applcaition in python using Tkinter library. I have disabled resizing of the windows which appear. All the buttons and widgets which I have used are displaying correctly on the system on which i am developing. But when I run the application on other system, the size and location of the widgets became a mess.</p>
  
  <p>Could you all please suggest how can I remove this issue and make the application system independent?</p>
  
  <p>I have attached the code file. Please help here.</p>
  
  <pre><code>#! /usr/bin/python3.4
  
  import tkinter as tk
  from tkinter import *
  from PIL import ImageTk, Image
  from UserWindow import UserWindow
  import swiftclient as sc
  import swiftclient.exceptions as swiftClientExceptions
  
  class MyApp(Frame):
  def __init__(self,parent):
      Frame.__init__(self,parent)
      self.parent=parent  
      self.images = []
      self.configureLoginWindow()
      self.createLoginWindow()
  
  def configureLoginWindow(self):
      self.master.title("Music Library")
      self.master.resizable(False,False)
      w = 400   #Width of the Window
      h = 250   #Height of the Window
      # get screen width and height
      ws = root.winfo_screenwidth()#This value is the width of the screen
      hs = root.winfo_screenheight()#This is the height of the screen
      # calculate position x, y
      x = (ws/2) - (w/2)
      y = (hs/2) - (h/2)
  
      #This is responsible for setting the dimensions of the screen and    where it is
      #placed
      self.master.geometry('%dx%d+%d+%d' % (w, h, x, y))
  
  def createLoginWindow(self):
      #Create a 5*5 Grid
      self.grid()
      for columns in range (0,6):
          self.columnconfigure(columns, pad = 14,weight=1)
      for rows in range (0,6):
          self.rowconfigure(rows , pad = 14,weight=1)
  
      #Setting the image
      rawdata=Image.open('images/login.jpg')
      loginImage=ImageTk.PhotoImage(rawdata)
      self.images.append(loginImage)
      #Creating Label to store Image
      labelLoginImage = Label(image=loginImage,bg="white")
      labelLoginImage.grid(column=0,row=0,columnspan=2,rowspan=5)
      #Creating Login Box
      labelUserName=Label(text="Username")
      labelPassword=Label(text="Password")
      labelWarning = Label(text="UserName OR Password is          wrong!!!!",fg='red')
      entryUserName=Entry(width=20)
      entryPassword=Entry(width=20,show="*")
             btnLogin=Button(text="Login",command=lambda:self.loginClickEvent(entryUserName.get(),entryPassword.get(),labelWarning))
      btnCancel=Button(text="Cancel",command=self.cancelClickEvent)
  
      labelUserName.grid(column=2,row=1,sticky=SW,pady=3)
      labelPassword.grid(column=2,row=2,sticky=NW,pady=3)
        entryUserName.grid(column=3,row=1,columnspan=2,padx=4,sticky=SW,pady=3)
      entryPassword.grid(column=3,row=2,columnspan=2, padx=4,sticky=NW,pady=3)
      btnLogin.grid(column=3,row=2,pady=3)
      btnCancel.grid(column=4,row=2,pady=3)
      labelWarning.grid_forget()
  
  def loginClickEvent(self,usrName,password,labelWarning):
      try:
          #Validation with keystone client via swiftclient
          storage_url , token = sc.client.get_auth("http://172.18.9.100:5000/v2.0/",usrName,password,auth_version='2.0'
                                                   ,os_options=dict({"tenant_name": 'admin'}.items()))
          '''storage_url , token = sc.client.get_auth("http://192.168.0.7:5000/v2.0/",usrName,password,auth_version='2.0'
                                                   ,os_options=dict({"tenant_name": 'demo'}.items()))'''
          storage_url = storage_url[0:7] + "172.18.9.100:8080/" +      storage_url[23:]
          #Passing token and storgae Uri which we have received to User          Window page
          app=UserWindow(storage_url , token)
  
      except swiftClientExceptions.ClientException as unauth:
          labelWarning.grid(column=2,row=3,columnspan=3,sticky='N')
          print(unauth)
  
  def cancelClickEvent(self):    
      self.master.destroy()
  
  
  root=tk.Tk()
  app = MyApp(root)
  app.mainloop()
  </code></pre>
  
  <p>I dont have enough reputation to add the picture please help here.</p>
  
  <p>By messy I means that the space between widgets is uneven and there size is also different.</p>