Label and tetbox for Name added
This commit is contained in:
parent
d8918d2331
commit
ef0b9b9580
59
journal.py
59
journal.py
|
|
@ -1,23 +1,54 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
|
||||||
from tkinter import Tk, Frame, BOTH
|
import tkinter as tk
|
||||||
|
from tkinter import ttk
|
||||||
class Journal(Frame):
|
from tkinter.messagebox import showinfo
|
||||||
|
|
||||||
def __init__(self, parent):
|
|
||||||
Journal.__init__(self, parent , background = "black")
|
|
||||||
|
|
||||||
self.parent = parent
|
|
||||||
|
|
||||||
self.parent.title("Ameland Kinderjournal")
|
|
||||||
self.pack(fill=BOTH, expand=1)
|
|
||||||
|
|
||||||
journal = Tk()
|
|
||||||
|
|
||||||
|
# configure root window
|
||||||
|
journal = tk.Tk()
|
||||||
# set Window to fullscreen (dependend of the actual screensize)
|
# set Window to fullscreen (dependend of the actual screensize)
|
||||||
width = journal.winfo_screenwidth()
|
width = journal.winfo_screenwidth()
|
||||||
height = journal.winfo_screenheight()
|
height = journal.winfo_screenheight()
|
||||||
journal.geometry("%dx%d" % (width, height))
|
journal.geometry("%dx%d" % (width, height))
|
||||||
|
journal.title("Ameland Kinderjournal")
|
||||||
|
|
||||||
|
# store name and message
|
||||||
|
name = tk.StringVar()
|
||||||
|
message = tk.StringVar()
|
||||||
|
|
||||||
|
def send_clicked():
|
||||||
|
""" callback when the message has been composed and "Abschicken" has been clicked
|
||||||
|
"""
|
||||||
|
msg = f'Deine Nachricht wurde gespeichert'
|
||||||
|
showinfo(
|
||||||
|
title = 'Information',
|
||||||
|
message = msg
|
||||||
|
)
|
||||||
|
|
||||||
|
# Main Window
|
||||||
|
journal = ttk.Frame(journal)
|
||||||
|
journal.pack()
|
||||||
|
|
||||||
|
#class Journal(Frame):
|
||||||
|
#
|
||||||
|
# def __init__(self, parent):
|
||||||
|
# Journal.__init__(self, parent , background = "black")
|
||||||
|
#
|
||||||
|
# self.parent = parent
|
||||||
|
#
|
||||||
|
# self.parent.title("Ameland Kinderjournal")
|
||||||
|
# #self.pack(fill=BOTH, expand=1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# insert a tkinter textbox -> https://www.pythontutorial.net/tkinter/tkinter-entry/
|
||||||
|
#journal = journal.Entry()
|
||||||
|
|
||||||
|
# name
|
||||||
|
name_label = ttk.Label( journal, text="Dein Name:" )
|
||||||
|
name_label.pack( fill = 'x', expand = True )
|
||||||
|
name_entry = ttk.Entry( journal, textvariable = name )
|
||||||
|
name_entry.pack( fill = 'x', expand = True )
|
||||||
|
name_entry.focus()
|
||||||
|
|
||||||
app = Example(journal)
|
|
||||||
journal.mainloop()
|
journal.mainloop()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user