Skip to content

Instantly share code, notes, and snippets.

@vigilantPotato
Created August 31, 2024 21:51
Show Gist options
  • Select an option

  • Save vigilantPotato/0bba3fc93257a6407892201dff279e5e to your computer and use it in GitHub Desktop.

Select an option

Save vigilantPotato/0bba3fc93257a6407892201dff279e5e to your computer and use it in GitHub Desktop.
set aspect ration of message widget
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