Skip to content

Update GUI_Frame.py #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 46 additions & 23 deletions GUI_Frame.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,51 @@
from tkinter.filedialog import askopenfilename
# -*- coding: utf-8 -*-

from tkinter import ttk, Tk, Label, Frame
from tkinter.filedialog import askopenfilename
from tkinter.messagebox import showinfo, showerror, askokcancel


class Windows(Frame):
def __init__(self, master=None):
ttk.Frame.__init__(self, master)
self.master.title('ProgramName Support Ver : Python3.5 (less)')
self.master.geometry('400x160')
self.master.resizable(0, 0)
self.master.iconbitmap(default='')
self.createWidgets()
def createWidgets(self):
self.master.LB = Label(self.master, text="Specified file : ", fg="blue")
self.master.LB.place(x=10, y=18)
self.master.Run = ttk.Button(self.master, text='GO', command=self.method)
self.master.Run.config(state="disabled")
self.master.Run.place(x=310, y=120)
self.master.LB = Label(self.master, text="Message box : ", fg="blue")
self.master.LB.place(x=10, y=120)
self.master.displayText = Label(self.master, text="Execution message", fg="brown")
self.master.displayText.place(x=90, y=120)
def method(self):
self.master.displayText["text"] = 'Commant here'

def __init__(self, master=None):
ttk.Frame.__init__(self, master)

# 執行檔標題
self.master.title('Program Name Support Ver : Python3.5 (less)')

# 視窗大小
self.master.geometry('400x160')

# 禁用視窗放大縮小
self.master.resizable(0, 0)

# 執行檔圖示
self.master.iconbitmap(default='')
self.createWidgets()

def createWidgets(self):

# 建立文字方塊 (物件名稱可以自訂)
self.master.LB = Label(self.master, text="Specified file : ", fg="blue")
self.master.LB.place(x=10, y=18)

self.master.LB = Label(self.master, text="Message box : ", fg="blue")
self.master.LB.place(x=10, y=120)

self.master.displayText = Label(self.master, text="Execution message", fg="brown")
self.master.displayText.place(x=90, y=120)

# 建立按鈕, command 為按鈕功能
self.master.Run = ttk.Button(self.master, text='GO', command=self.method)
self.master.Run.place(x=310, y=120)

# 按鈕功能
def method(self):
self.master.displayText["text"] = 'Commant here'

if __name__ == '__main__':
root = Tk()
app = Windows(master=root)
app.mainloop()

root = Tk()
app = Windows(master=root)
app.mainloop()