I'm writing a program with pyinstaller and tkinter. At the startup, I want to show a scrolling textbox with information. The textbox itself appears on a Toplevel, and there is a close button:
from tkinter import Tk,BOTTOM,Toplevel,INSERT,Button
import tkinter.scrolledtext as st
win = Tk()
win.title("Main Window")
info_window = Toplevel()
info_window.wm_title('Licensing')
info_window.attributes('-topmost', 'true')
text_area = st.ScrolledText(info_window,
width = 50,
height = 5,
font = ("Times New Roman",
15))
text_area.pack()
text_area.insert(INSERT,
"""\
This software is licensed under .....
It is distributed as is and may used provided...
You pay me handsomely
You are my friend
References:
1. Doe, John, A Meaningless Research Result, Journal of Meaningless Research, 14
(1), 2022, 235-236.
2. Smith, Jill, A Substantial Research Result, Journal of Substantial Research, 34
(6), 2022, 112-118.
""")
text_area.configure(state ='disabled')
def close_window():
info_window.destroy()
close_button=Button(info_window,
text="Close",fg='black',bg='white',borderwidth=0,command=close_window)
close_button.pack(side=BOTTOM,expand=True)
win.mainloop()
This works, but I'd like to do the following:
- Center the "References" title
- Put journal titles in italics
- Put journal volumes in boldface
and....
- Make the Toplevel() static and not resizeable.