ich habe schon Google benutzt aber keine lösung gefunden
Code: Alles auswählen
try:
#~~ For Python 2.x
import Tkinter as tk
except ImportError:
#~~ For Python 3.x
import tkinter as tk
import os
relativPath = os.path.abspath('.')
class GUI(tk.Frame):
"""GUI Behandlung als Klasse"""
def __init__(self, parent, *args, **kwargs):
tk.Frame.__init__(self, parent, *args, **kwargs)
self.parent = parent
self.parent.geometry('800x480+0+0')
self.parent.fullscreen = True
print(relativPath + '\\images\\bluetooth_disconnected.gif')
###Oberes Panel
#Uhrzeit und Datum
lbDayTime = tk.Label(parent, text = 'Uhrzeit')
lbDayTime.place(x = 50, y = 0, height = 50)
#Bluetooth Symbol
imgBluetooth = tk.PhotoImage(file = relativPath + '\\images\\bluetooth_disconnected.gif')
lbBluetooth = tk.Label(parent, image = imgBluetooth)
lbBluetooth.place(x = 550, y = 0, width = 50, height = 50)
#Wlan Symbol
imgWlan = tk.PhotoImage(file = relativPath + '\\images\\wlan_disconnected.gif')
lbWlan = tk.Label(parent, image = imgWlan)
lbWlan.place(x = 650, y = 0, width = 50, height = 50)
#USB Symbol
imgUSB = tk.PhotoImage(file = relativPath + '\\images\\usb_disconnected.gif')
lbUSB = tk.Label(parent, image = imgUSB)
lbUSB.place(x = 750, y = 0, width = 50, height = 50)
###Hauptfenster
##Commandos
def RadioBT():
pass
def USBBT():
pass
def BluetoothAudioBT():
pass
def BluetoothBT():
pass
def NavigationBT():
pass
def EinstellungenBT():
pass
#Radio Button
btRadio = tk.Button(parent, text = 'Radio', command = RadioBT)
btRadio.place(x = 50, y = 125, width = 350, height = 75)
#USB Button
btUSB = tk.Button(parent, text = 'USB', command = USBBT)
btUSB.place(x = 50, y = 225, width = 300, height = 75)
#Bluetooth Audio Button
btBluetoothAudio = tk.Button(parent, text = 'Bluetooth Audio', command = BluetoothAudioBT)
btBluetoothAudio.place(x = 50, y = 325, width = 350, height = 75)
#Bluetooth Button
btBluetooth = tk.Button(parent, text = 'Bluetooth', command = BluetoothBT)
btBluetooth.place(x = 400, y = 125, width = 350, height = 75)
#Navigation Button
btNavigation = tk.Button(parent, text = 'Navigation', command = NavigationBT)
btNavigation.place(x = 450, y = 225, width = 300, height = 75)
#Einstellungen Button
btRadio = tk.Button(parent, text = 'Einstellungen', command = EinstellungenBT)
btRadio.place(x = 400, y = 325, width = 350, height = 75)
root = tk.Tk()
GUI(root)#.pack(side="top", fill="both", expand=True)
root.mainloop()