Created
August 31, 2024 21:51
-
-
Save vigilantPotato/0bba3fc93257a6407892201dff279e5e to your computer and use it in GitHub Desktop.
set aspect ration of message widget
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import ctypes | |
| import tkinter | |
| if __name__ == "__main__": | |
| ctypes.windll.shcore.SetProcessDpiAwareness(1) | |
| root = tkinter.Tk() | |
| comment = "MessageとLabelの違いを確認する。" | |
| #Message: aspect=default(150) | |
| m = tkinter.Message(root, text=comment, bg="lightblue") | |
| m.pack(pady=1) | |
| #Message: aspect=300 | |
| m = tkinter.Message(root, aspect=300, text=comment, bg="lightblue") | |
| m.pack(pady=1) | |
| root.mainloop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment