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
try: | |
import tkinter as tk | |
from tkinter import ttk | |
except ImportError: | |
import Tkinter as tk | |
import ttk | |
class DoubleScrolledFrame: | |
""" |
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
try: #python3 imports | |
import tkinter as tk | |
except ImportError: #python3 failed, try python2 imports | |
import Tkinter as tk | |
class Main(tk.Frame): | |
def __init__(self, master=None, **kwargs): | |
tk.Frame.__init__(self, master, **kwargs) | |
lbl = tk.Label(self, text="this is the main frame") |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
try: | |
import tkinter as tk | |
except ImportError: | |
import Tkinter as tk | |
from PIL import Image, ImageTk | |
from itertools import count, cycle |
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
""" | |
An example of how to show one tkinter window after another. | |
This program will show a password entry dialog. If the ppassword is correct, | |
it will close the dialog and open the main body of the program. | |
""" | |
import tkinter as tk | |
class MainApp(tk.Tk): |
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 tkinter as tk | |
class menu: | |
def __init__(self): | |
self.game = tk.Tk() | |
self.game.geometry('200x200') | |
self.var = tk.StringVar() | |
#~ self.var = tk.StringVar(master=self.game) # this solves the problem | |
ent = tk.OptionMenu(self.game, self.var, 'one', 'two', 'three', 'four') |
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
#!/usr/bin/env python | |
# | |
# unit.py | |
# | |
# Copyright September 2015 | |
# | |
# Documentation is like sex. | |
# When it's good, it's very good. | |
# When it's bad, it's better than nothing. | |
# When it lies to you, it may be a while before you realize something's wrong. |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
try: | |
import Tkinter as tk | |
except ImportError: | |
import tkinter as tk | |
from itertools import cycle |
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
try: | |
import tkinter as tk | |
except ImportError: | |
import Tkinter as tk | |
class VerticalScrolledFrame: | |
""" |