This file contains 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) |
This file contains 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 | |
m = tkinter.Message(root, text=comment, bg="lightblue") |
This file contains 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 | |
def up_left(): | |
gap_x = root.winfo_x() - root.winfo_rootx() | |
root.geometry("+%d+%d" % (gap_x, 0)) | |
def up_right(): | |
x = root.winfo_screenwidth()- root.winfo_width() |
This file contains 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 | |
def centering_main_window(event): | |
screen_width = root.winfo_screenwidth() | |
screen_height = root.winfo_screenheight() | |
window_width = root.winfo_width() | |
window_height = root.winfo_height() | |
x = screen_width / 2 - window_width /2 |
This file contains 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 | |
def show_geometry_info(event): | |
width = "w " + str(root.winfo_width()) + "\n" | |
height = "h " + str(root.winfo_height()) + "\n" | |
x = "x " + str(root.winfo_x()) + "\n" | |
y = "y " + str(root.winfo_y()) | |
geo_info["text"] = width + height + x + y |
This file contains 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 | |
def show_geometry_info(event): | |
geo_label["text"] = root.geometry() | |
if __name__ == "__main__": | |
ctypes.windll.shcore.SetProcessDpiAwareness(1) |
This file contains 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, tkinter.filedialog | |
class ImageViwer(): | |
def __init__(self, root): | |
#image viwer label | |
self.image_label = tkinter.Label( | |
root, | |
bg="lightblue", |
This file contains 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, tkinter.filedialog | |
def get_filepath(): | |
filepath = tkinter.filedialog.askopenfilename( | |
title="slect txt file", | |
filetypes=[("txt files", "*.txt")], | |
) | |
filepath_result["text"] = filepath |
This file contains 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
from comtypes import CLSCTX_ALL | |
from pycaw.pycaw import AudioUtilities, IAudioEndpointVolume | |
import ctypes | |
import tkinter | |
class MasterVolumeSettingScale(tkinter.Scale): | |
def __init__(self, root): | |
super().__init__( | |
root, |
This file contains 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 | |
def get_value(): | |
current_value = scale.get() | |
b1["text"] = current_value | |
def set_value(): | |
scale.set(0) |
NewerOlder