Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
tkinter in RPi
#1
hi everyone
I have this code running perfect in my windows machine,
when I pass it to my RPi looks completely different,
like the picture out of the windows...
what can I do?

from tkinter import *
import tkinter as tk

parent = Tk()
v = tk.IntVar()
parent.geometry("800x480")
parent.title('4082730-901 ATA: 31-61-28,   Electronic Flight Instruments System Control Panel')

Label(parent, text="").grid(row=0, column=2, sticky='e')
Label(parent, text="W.O Number:").grid(row=1, column=6, sticky='e')
Entry(parent, width=50).grid(row=1, column=7, padx=2, pady=2, sticky='we', columnspan=9)

Label(parent, text="UUT Part Number:").grid(row=2, column=6, sticky='e')
Entry(parent, width=40).grid(row=2, column=7, padx=2, pady=2, sticky='we', columnspan=9)
Label(parent, text="UUT Serial Number:").grid(row=3, column=6, sticky='e')
Entry(parent, width=30).grid(row=3, column=7, padx=2, pady=2, sticky='we', columnspan=9)

Label(parent, text="Date:").grid(row=4, column=6, sticky='e')
Entry(parent, width=20).grid(row=4, column=7, padx=2, pady=2, sticky='we')#, columnspan=9)
Label(parent, text="Technician:").grid(row=5, column=6, sticky='e')
Entry(parent).grid(row=5, column=7, padx=2, pady=2, sticky='we')   # columnspan=9)
Label(parent, text="").grid(row=3, column=14, sticky='e', columnspan=4)

Button(parent, text="      Test Procedure      ").grid(  row=5, column=16, sticky='e' + 'w', padx=2)


Label(parent, text="Work Requested:").grid(row=9, column=6, sticky='e')
tk.Radiobutton(parent, text="Bench Test", variable=v, value=1).grid(row=9, column=7, columnspan=2, sticky='w')
tk.Radiobutton(parent, text="Repair", variable=v, value=2).grid(row=10, column=7, columnspan=2, sticky='w')
tk.Radiobutton(parent, text="Overhaul", variable=v, value=3).grid(row=11, column=7, columnspan=4, sticky='w')

Label(parent, text="").grid(row=12, column=14, sticky='e')
Button(parent, text="   Retrieve Report   ").grid(  row=15, column=5, sticky='s')# + 'w', padx=2, pady=2)
Button(parent, text="   Close Session   ").grid(  row=15, column=21, sticky='e' + 'w', padx=2)

photo = tk.PhotoImage(file="EFIC.gif")
w1 = tk.Label(parent, image=photo).grid( row=6, column=7, columnspan=4, sticky='e')

parent.mainloop()
Reply
#2
I have several Pi's but don't run Windows at all as I have Linux Mint on my laptop.
What is different on Pi?
Is it the colours, shape or something else?
Perhaps a screenshot of both might help otherwise
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020