Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/bin/env python
- # -*- coding: utf-8 -*-
- # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # ttkdemo_support.py
- # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # Written by G.D. Walters for FCM 149 - September 2019
- # Submitted to the public domain - all rights reserved
- # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # Support module generated by PAGE version 4.25
- # in conjunction with Tcl version 8.6
- # Aug 25, 2019 07:48:16 PM CDT platform: Linux
- import sys
- try:
- import Tkinter as tk
- except ImportError:
- import tkinter as tk
- try:
- import ttk
- py3 = False
- except ImportError:
- import tkinter.ttk as ttk
- py3 = True
- def set_Tk_var():
- global tch46
- tch46 = tk.StringVar()
- global combobox
- combobox = tk.StringVar()
- global selectedButton
- selectedButton = tk.StringVar()
- global EntryVar
- EntryVar = tk.StringVar()
- global LabelVar
- LabelVar = tk.StringVar()
- LabelVar.set('')
- def on_rbClick():
- print('ttkdemo_support.on_rbClick')
- sys.stdout.flush()
- print("RadioButton {0} clicked".format(selectedButton.get()))
- style = ttk.Style()
- selected = selectedButton.get()
- style.theme_use(style.theme_names()[int(selected)])
- def on_btnExit():
- print('ttkdemo_support.on_btnExit')
- sys.stdout.flush()
- destroy_window()
- def init(top, gui, *args, **kwargs):
- global w, top_level, root
- w = gui
- top_level = top
- root = top
- # ======================================================
- # Our init code starts here
- # ======================================================
- setup_styles()
- def setup_styles():
- rblist = [w.TRadiobutton1, w.TRadiobutton2, w.TRadiobutton3,
- w.TRadiobutton4, w.TRadiobutton5, w.TRadiobutton6,
- w.TRadiobutton7]
- s = ttk.Style()
- cntr = 0
- def clear_radio_buttons():
- for i in range(7):
- rblist[i].configure(text='')
- rblist[i].configure(state='disabled')
- clear_radio_buttons()
- for i in s.theme_names():
- print(i)
- rblist[cntr].configure(text=i)
- rblist[cntr].configure(state='normal')
- cntr += 1
- w.TProgressbar1.config(mode='indeterminate')
- w.TProgressbar1.start()
- def destroy_window():
- # Function which closes the window.
- global top_level
- top_level.destroy()
- top_level = None
- if __name__ == '__main__':
- import ttkdemo
- ttkdemo.vp_start_gui()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement