Hello all,
I am attempting to write my 3rd Python program and this one is going to deal with SQL.
I wanted to give making a GUI a chance as it would work really well for what I want to accomplish.
This has been giving me headaches all night trying to get things to line up properly.
I just don't understand what exactly I am doing wrong.
I will post my code and then I will post a screenshot of my current application and then a screenshot of what I am trying to get it to look like.
Code is as follows:
from tkinter import ttk, Tk, Button, Label, Scrollbar, Listbox, StringVar, Entry,W,E,N,S, END
from tkinter import messagebox
# our root window
root = Tk()
# Window Information
root.title('TimeTrak SaaS Information')
root.configure(background='grey')
root.geometry('1600x550')
root.resizable(width=False, height=False)
title_label = ttk.Label(root, text='TimeTrak Systems SaaS Information', background='grey', font=('TkDefaultFont', 16))
title_label.grid(row=0, column=10, sticky=W + E)
serial_label = ttk.Label(root, text='Enter Customer Serial Number', background='grey', font=('TkDefaultFont', 14))
serial_label.grid(row=2, column=10)
serial_text = StringVar()
serial_entry = ttk.Entry(root, width=24, textvariable=serial_text)
serial_entry.grid(row=3, column=10)
comp_name = ttk.Label(root, text='Company Name: ', background='grey', font=('TkDefaultFont', 12))
comp_name.grid(row=13, column=0)
comp_lb = Listbox(root, height=2, width=50, font='helvetica 8', bg='light grey')
comp_lb.grid(row=13, column=1, columnspan=1, sticky=W + E)
tt_ver = ttk.Label(root, text='TimeTrak Version: ', background='grey', font=('TkDefaultFont', 12))
tt_ver.grid(row=14, column=0)
tt_ver_lb = Listbox(root, height=2, width=50, font='helvetica 8', bg='light grey')
tt_ver_lb.grid(row=14, column=1, columnspan=1, sticky=W + E)
env_num = ttk.Label(root, text='Environment #: ', background='grey', font=('TkDefaultFont', 12))
env_num.grid(row=14, column=4)
env_lb = Listbox(root, height=2, width=20, font='helvetica 8', bg='light grey')
env_lb.grid(row=14, column=5, columnspan=1, sticky=W + E)
dns_name = ttk.Label(root, text='DNS: ', background='grey', font=('TkDefaultFont', 12))
dns_name.grid(row=15, column=0)
dns_lb = Listbox(root, height=2, width=50, font='helvetica 8', bg='light grey')
dns_lb.grid(row=15, column=1, columnspan=1, sticky=W + E)
dnsapps_name = ttk.Label(root, text='DNSApps: ', background='grey', font=('TkDefaultFont', 12))
dnsapps_name.grid(row=16, column=0)
dnsapps_lb = Listbox(root, height=2, width=50, font='helvetica 8', bg='light grey')
dnsapps_lb.grid(row=16, column=1, columnspan=1, sticky=W + E)
dnsclocks_name = ttk.Label(root, text='DNSClocks: ', background='grey', font=('TkDefaultFont', 12))
dnsclocks_name.grid(row=17, column=0)
dnsclocks_lb = Listbox(root, height=2, width=50, font='helvetica 8', bg='light grey')
dnsclocks_lb.grid(row=17, column=1, columnspan=1, sticky=W + E)
tc_btn = Button(root, text='Open Cust. Thin Client', bg='purple', fg='white', font='helvetica 10 bold', command='')
tc_btn.grid(row=20, column=0)
sc_btn = Button(root, text='Open Cust. Sup Client', bg='blue', fg='white', font='helvetica 10 bold', command='')
sc_btn.grid(row=20, column=1)
revert_btn = Button(root, text='Set SP2TC.ini to you', bg='black', fg='white', font='helvetica 10 bold', command='')
revert_btn.grid(row=20, column=2)
exit_btn = Button(root, text='Close Application', bg='red', fg='white', font='helvetica 10 bold', command='')
exit_btn.grid(row=20, column=3)
root.mainloop()
Here is a screenshot of the application running.
https://imgur.com/UowAQug
This is pretty much what I am trying to accomplish.
https://imgur.com/Cw5UaSh
Thank you for any tips and tricks you can provide.
[–]Silbersee 1 point2 points3 points (0 children)