当前位置: 首页>>代码示例>>Python>>正文


Python Frame.tkraise方法代码示例

本文整理汇总了Python中tkinter.Frame.tkraise方法的典型用法代码示例。如果您正苦于以下问题:Python Frame.tkraise方法的具体用法?Python Frame.tkraise怎么用?Python Frame.tkraise使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tkinter.Frame的用法示例。


在下文中一共展示了Frame.tkraise方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Button

# 需要导入模块: from tkinter import Frame [as 别名]
# 或者: from tkinter.Frame import tkraise [as 别名]
            )
        self.button.grid(row=0, column=0)
        
        qBtn = Button(frame2, text="QUIT", command=frame2.quit)
        qBtn.grid(row=0, column=0)
        
        self.dialog.mainloop()
        #self.frame.destroy()
        print("QUIT")

def say_hi(self):
        print ("hi there, everyone!")

if __name__ == '__main__':
    dialogRoot=Tk()
    frame=Frame(dialogRoot)
    
    
    frame2=Frame(dialogRoot)
    
    thread=testThread(dialogRoot, frame, frame2)
    thread.start()
    
    print("Wait")
    time.sleep(10)
    #frame.destroy()
    
    print("change")
    frame.tkraise(frame2)
    
    print("done")
开发者ID:fscnick,项目名称:RapidgatorDownloader,代码行数:33,代码来源:FrameTest.py

示例2: MainWin

# 需要导入模块: from tkinter import Frame [as 别名]
# 或者: from tkinter.Frame import tkraise [as 别名]
class MainWin(Tk):

    def __init__(self, client):
        Tk.__init__(self)
        self.client = client
        self.programPanel = ProgramPanel(client)
        self.programPanel.grid(row = 0, column = 0, sticky = NSEW)

        self.frame = Frame(self)
        self.frame.grid(row = 0, column = 0, sticky = NSEW)
        nextRow = Counter()

        # Create the menu.
        menu = Frame(self.frame)
        addButton = Menubutton(menu, text = 'Add')
        addButton.pack()
        menu.grid(row = nextRow(), column = 0, sticky = W)

        # Create the program panel.
        self.program = ProgramWidget(self.frame, client)
        self.program.grid(row = nextRow(), column = 0, columnspan = 2,
                          sticky = W)

        label = Label(self.frame, text = 'AWB')
        label.grid(row = nextRow(), column = 0)

        self.recordMode = Button(self.frame, text = 'P',
                                 command = self.toggleRecord)
        modeRow = nextRow()
        self.recordMode.grid(row = modeRow, column = 0, sticky = W)
        self.status = Label(self.frame, text = 'Idle')
        self.status.grid(row = modeRow, column = 1)

        self.channels = []
        self.channelFrame = Frame(self.frame)
        self.channelFrame.grid(row = nextRow(), columnspan = 2)

        self.bind('q', self.terminate)
        self.bind('f', self.foo)

        self.bind('r', self.toggleRecord)
        self.bind('k', self.toggleSticky)
        self.bind('.', self.nextSection)
        self.bind(',', self.prevSection)
        self.bind('<space>', self.togglePause)
        self.bind('K', self.clearAllState)
        self.protocol('WM_DELETE_WINDOW', self.destroy)

        self.bind('<F1>', lambda evt: self.frame.tkraise())
        self.bind('<F2>', lambda evt: self.programPanel.tkraise())

        for i in range(0, 8):

            # Bind number key.
            self.bind(str(i),
                      lambda evt, channel = i: self.toggleChannel(channel)
                      )

            # Create channel
            channel = Channel(self.channelFrame, i)
            self.channels.append(channel)
            channel.pack(side = LEFT)

            client.addChannelSubscriber(
                i,
                lambda ch, status, channel = channel:
                    channel.changeStatus(status)
            )

    def foo(self, event):
        print('got foo')

    def terminate(self, event):
        self.destroy()

    def toggleRecord(self, event):
        self.client.recordEnabled = not self.client.recordEnabled
        self.recordMode.configure(text = self.client.recordEnabled and 'R' or
                                  'P'
                                  )

    def togglePause(self, event):
        self.client.togglePause()
        if self.client.paused:
            self.status.configure(text = 'Paused')
        else:
            self.status.configure(text = 'Playing')

    def clearAllState(self, event):
        self.client.clearAllState()
        self.status.configure(text = 'Idle')
        for channel in self.channels:
            channel.changeStatus(0)

    def toggleChannel(self, channel):
        # using "channel" as program
        self.client.activate(channel)
        if self.client.recording.get(channel):
            self.client.endRecord(channel)
        elif self.client.recordEnabled:
#.........这里部分代码省略.........
开发者ID:mindhog,项目名称:mawb,代码行数:103,代码来源:tkui.py

示例3: show_page

# 需要导入模块: from tkinter import Frame [as 别名]
# 或者: from tkinter.Frame import tkraise [as 别名]
 def show_page(self, frame: tk.Frame):
     frame.tkraise()
开发者ID:rbgorbet,项目名称:Hylozoic-Series-3,代码行数:4,代码来源:basic_gui.py


注:本文中的tkinter.Frame.tkraise方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。