Skip to content

Instantly share code, notes, and snippets.

@vigilantPotato
vigilantPotato / change_color_on_hover.py
Last active April 24, 2023 13:57
how to change tkinter's widget color on hover
View change_color_on_hover.py
import tkinter
class ChangeColorOnHoverButton(tkinter.Button):
"""
button class which changes its background color on hover
"""
def __init__(self, root):
super().__init__(
@vigilantPotato
vigilantPotato / input_dialog.py
Created April 23, 2023 14:25
example of a simple input dialog
View input_dialog.py
import tkinter
class InputDialog(tkinter.Toplevel):
"""
show a dialog which asks user to input something
"""
def __init__(self, root):
super().__init__(root)
@vigilantPotato
vigilantPotato / move_to_display_edge.py
Last active April 19, 2023 13:45
how to just fit tkinter main window to the edge of display
View move_to_display_edge.py
import ctypes
import tkinter
"""Note
Tkinter main window has invisible frame around it.
When you want to just fit the main window to the edge of display,
you have to consider the width of the invisible frame.
For example, when you use root.geometry("+0+100"),
@vigilantPotato
vigilantPotato / tk_button.ipynb
Created January 20, 2019 12:17
tkinter button options
View tk_button.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vigilantPotato
vigilantPotato / Pipfile
Last active January 20, 2019 12:06
images
View Pipfile
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
[dev-packages]
[requires]
View tkinter_button_flash.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View pandas_test1.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.