From 0451f85e7cd4de3cdd32e7ceb8484308274e64f0 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sat, 27 Feb 2021 13:27:43 -0800 Subject: [PATCH] Don't use import from. --- PGUI.pyw | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/PGUI.pyw b/PGUI.pyw index 46b143f..e3cb075 100644 --- a/PGUI.pyw +++ b/PGUI.pyw @@ -1,7 +1,5 @@ import tkinter -from tkinter import Button as tButton -from tkinter import Tk, BOTH -from tkinter.ttk import Frame, Style, Button +import tkinter.ttk import os import subprocess import sys @@ -15,15 +13,15 @@ def load_programs(): shortcuts = [pathclass.Path(p) for p in shortcuts] return shortcuts -class PGUILauncher(Frame): +class PGUILauncher(tkinter.ttk.Frame): def __init__(self, parent): - Frame.__init__(self, parent) + super().__init__(parent) self.parent = parent - self.style = Style() + self.style = tkinter.ttk.Style() self.style.theme_use("clam") - self.pack(fill=BOTH, expand = 1) + self.pack(fill=tkinter.BOTH, expand = 1) self.filter_var = tkinter.StringVar() self.filter_var.trace('w', self.filter) @@ -40,7 +38,7 @@ class PGUILauncher(Frame): shortcuts = load_programs() for (index, shortcut) in enumerate(shortcuts): print(y, x) - button = Button( + button = tkinter.ttk.Button( self, text=shortcut.replace_extension('').basename, command=lambda sc=shortcut: self.launch_program(sc), @@ -84,7 +82,7 @@ class PGUILauncher(Frame): def main(argv): - root = Tk() + root = tkinter.Tk() root.title("PGUI") root.resizable(0,0)