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


Python Tk.wm_title方法代码示例

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


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

示例1: main

# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import wm_title [as 别名]
def main():
    root = Tk()

    if platform.system()!="Darwin":
        MyHwCtrl = Hardware_control()
        MyHwCtrl.go_to_base()

    root.geometry("480x320")
    root.wm_title('Medimi')
    if len(sys.argv) > 1 and sys.argv[1] == 'fs':
        root.wm_attributes('-fullscreen', True)
    os = platform.system()
    print os

    if platform.system()!="Darwin":
        app = PiMenu(root, MyHwCtrl)
    else:
        print "Runnning on Mac"
        app = PiMenu(root,None)

#    myClock = Clock(root)

#   root.bind("<Button-1>", callback, root) #
#    myClock.tick()

    root.mainloop()
开发者ID:senspix,项目名称:medimi,代码行数:28,代码来源:pimenu.py

示例2: main

# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import wm_title [as 别名]
def main():

    # helper method used when quitting program
    def kill_all_threads():
        if input_frame.backend_call is not None:
            input_frame.backend_call.stop()
            input_frame.backend_call.join()
        root.destroy()

    root = Tk()
    root.wm_protocol ("WM_DELETE_WINDOW", kill_all_threads)
    root.wm_title("Seating Chart Creator")
    centered_window = Frame(root)
    centered_window.pack()

    header_frame = HeaderFrame(centered_window)
    header_frame.grid(row=0, column=0, columnspan=3, sticky=(W))

    instructions_frame = InstructionsFrame(centered_window)
    instructions_frame.grid(row=1, column=0, columnspan=3, padx=(0,20))

    progress_frame = ProgressFrame(centered_window)
    progress_frame.grid(row=2, column=1, padx=10, pady=20, sticky=(N))

    results_frame = ResultsFrame(centered_window, progress_frame.plot_frame)
    results_frame.grid(row=2, column=2, padx=10, sticky=(N))

    input_frame = InputFrame(centered_window, progress_frame, results_frame)
    input_frame.grid(row=2, column=0, padx=(30,20), sticky=(N))

    progress_frame.input_frame = input_frame
    results_frame.input_frame = input_frame
    root.mainloop()
开发者ID:KatrinaE,项目名称:SeatingChartCreator,代码行数:35,代码来源:SeatingChartCreator.py

示例3: main

# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import wm_title [as 别名]
def main():
    global fingerprint
    root = Tk()
    root.geometry("240x320")
    root.wm_title('Marauders Map')

    if len(sys.argv) > 1 and sys.argv[1] == 'fs':
        root.wm_attributes('- fullscreen', True)
    app = Marauders(root)


    channel_hop.start_mon_mode('wlan0')

    # Start channel hopping
    iface = channel_hop.get_mon_iface()
    #iface = 'wlan2'
    hop = threading.Thread(target=channel_hop.channel_hop, args=[iface])
    hop.daemon = True
    hop.start()
    

    os.system("sudo hciconfig hci0 reset")
    #p = Popen(["hciconfig", "hci0", "down"], stdout=PIPE, stderr=PIPE, preexec_fn=os.setsid)
    #p = Popen(["hciconfig", "hci0","up"], stdout=PIPE, stderr=PIPE, preexec_fn=os.setsid)

    #p = Popen([app.path+"/ibeacon_scan","-b"], stdout=PIPE, preexec_fn=os.setsid)


    if(os.path.isfile(app.path + '/fingerprint.pkl')):
        fingerprint_file = open(app.path + '/fingerprint.pkl', 'rb')
        fingerprint = pickle.load(fingerprint_file)
        fingerprint_file.close()

    root.mainloop()
开发者ID:kmackenzieii,项目名称:marauders-map,代码行数:36,代码来源:Marauders.py

示例4: init_screen

# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import wm_title [as 别名]
 def init_screen(self):
     # intialise screen and turn off auto-render
     root = Tk()
     root.wm_title(self.window_title)
     window = TK.Canvas(master=root, width=self.width, height=self.height)
     window.pack()
     self.screen = TurtleScreen(window)
     self.screen.tracer(0, 0)
开发者ID:AllTheWayDown,项目名称:turtlepower,代码行数:10,代码来源:world.py

示例5: main

# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import wm_title [as 别名]
def main():
    root = Tk()
    root.geometry("320x240")
    root.wm_title('PiMenu')
    if len(sys.argv) > 1 and sys.argv[1] == 'fs':
        root.wm_attributes('-fullscreen', True)
    app = PiMenu(root)
    root.mainloop()
开发者ID:dmpop,项目名称:pimenu,代码行数:10,代码来源:pimenu.py

示例6: main

# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import wm_title [as 别名]
def main(config=config):
    """
    Creates an application instance.
    """
    root = Tk()
    root.columnconfigure(0, weight=1)
    root.wm_title("ayy lmap")
    app = Application(master=root, config=config)
    return app
开发者ID:PikalaxALT,项目名称:pokemon-reverse-engineering-tools,代码行数:11,代码来源:map_editor.py

示例7: __init__

# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import wm_title [as 别名]
    def __init__(self, width, height, title="NinjaTurtle"):
        self.width = width
        self.height = height
        self.window_title = title

        root = Tk()
        root.wm_title(self.window_title)
        window = TK.Canvas(master=root, width=self.width, height=self.height)
        window.pack()
        self.screen = TurtleScreen(window)
        self.screen.tracer(0, 0)

        self.turtles = dict()
开发者ID:AllTheWayDown,项目名称:ninjaturtle,代码行数:15,代码来源:tk_renderer.py

示例8: main

# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import wm_title [as 别名]
def main(config=config):
    """
    Launches the map editor.
    """
    root = Tk()
    root.wm_title("MAP EDITOR")
    app = Application(master=root, config=config)

    try:
        app.mainloop()
    except KeyboardInterrupt:
        pass

    try:
        root.destroy()
    except TclError:
        pass
开发者ID:TheScarletSword,项目名称:pokereddeluxe,代码行数:19,代码来源:map_editor.py

示例9: error_and_exit

# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import wm_title [as 别名]
def error_and_exit(title, main_text):
    """
    Show a pop-up window and sys.exit() out of Python.

    :param title: the short error description
    :param main_text: the long error description
    """
    # NOTE: We don't want to load all of these imports normally.
    #       Otherwise we will have these unused GUI modules loaded in the main process.
    from Tkinter import Tk, Canvas, DISABLED, INSERT, Label, Text, WORD

    root = Tk()
    root.wm_title("Tribler: Critical Error!")
    root.wm_minsize(500, 300)
    root.wm_maxsize(500, 300)
    root.configure(background='#535252')

    # Place the window at the center
    root.update_idletasks()
    w = root.winfo_screenwidth()
    h = root.winfo_screenheight()
    size = tuple(int(_) for _ in root.geometry().split('+')[0].split('x'))
    x = w / 2 - 250
    y = h / 2 - 150
    root.geometry("%dx%d+%d+%d" % (size + (x, y)))

    Canvas(root, width=500, height=50, bd=0, highlightthickness=0, relief='ridge', background='#535252').pack()
    pane = Canvas(root, width=400, height=200, bd=0, highlightthickness=0, relief='ridge', background='#333333')
    Canvas(pane, width=400, height=20, bd=0, highlightthickness=0, relief='ridge', background='#333333').pack()
    Label(pane, text=title, width=40, background='#333333', foreground='#fcffff', font=("Helvetica", 11)).pack()
    Canvas(pane, width=400, height=20, bd=0, highlightthickness=0, relief='ridge', background='#333333').pack()

    main_text_label = Text(pane, width=45, height=6, bd=0, highlightthickness=0, relief='ridge', background='#333333',
                           foreground='#b5b5b5', font=("Helvetica", 11), wrap=WORD)
    main_text_label.tag_configure("center", justify='center')
    main_text_label.insert(INSERT, main_text)
    main_text_label.tag_add("center", "1.0", "end")
    main_text_label.config(state=DISABLED)
    main_text_label.pack()

    pane.pack()

    root.mainloop()

    # Exit the program
    sys.exit(1)
开发者ID:Tribler,项目名称:tribler,代码行数:48,代码来源:check_os.py

示例10: FrameTk

# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import wm_title [as 别名]
class FrameTk(object):

    def __init__(self, height, width, box_size, title = "Tk", bg = None):
        self.BOX_SIZE = box_size

        self.main = Tk()
        self.main.wm_title(title)
        self.canvas = Canvas(self.main, height = height, width = width, bg = bg)
        self.canvas.pack()

    def run(self):
        self.main.mainloop()

    def repeat(self, end, timeMillis, callback):
        def _repeat(end, time, func):
            if self.sma.stop:
                return

            if end > 0:
                end -= 1
                self.repeat(end, time, func)
                func()
                self._draw()

        self.canvas.after(timeMillis, _repeat, end, timeMillis, callback)

    def after(self, timeMillis, callback):
        def _callback(time, func):
            if self.sma.stop:
                return

            self.after(time, func)
            func()
            self._draw()

        self.canvas.after(timeMillis, _callback, timeMillis, callback)

    def _draw(self):
        pass

    def drawTkImage(self, x, y, tkimage):
        self.canvas.create_image(x, y, anchor = NW, image = tkimage)

    def drawText(self, x, y, text, color = 'black', size = 8):
        self.canvas.create_text(x, y, anchor = NW, text = text, font = ('Arial', size), width = self.BOX_SIZE, fill = color)
开发者ID:blckshrk,项目名称:DummySMA,代码行数:47,代码来源:FrameTk.py

示例11: startGui

# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import wm_title [as 别名]
def startGui():
	root=Tk()
	root.wm_title("Eagle V6 to Kicad Converter")
	root.wm_minsize(400,200)
	frame = Frame(root, relief=RIDGE, bg="BLUE", borderwidth=2)
	frame.pack(fill=BOTH,expand=1)
	
	label = Label(frame, font=20, bg="BLUE", text="What Would You Like to Do:")
	label.pack(fill=X, expand=1)
	
	butBrd = Button(frame, text="Convert Board",command=convertBoard)
	butBrd.pack(fill=X,expand=1)
	butLib = Button(frame, text="Convert Library",command=convertLib)
	butLib.pack(fill=X,expand=1)
	butSch = Button(frame, text="Convert Schematic",command=convertSch)
	butSch.pack(fill=X,expand=1)
	
	label = Label(frame,bg="BLUE", text="www.github.com/Trump211")
	label.pack(fill=X, expand=1)
	
	root.mainloop()
开发者ID:Jerome-PS,项目名称:Eagle2Kicad,代码行数:23,代码来源:Start.py

示例12: run

# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import wm_title [as 别名]
 def run(self):
     dummy_count = 0
     root = Tk()
     root.wm_title("Debug Window")
     bgndFrm = VerticalScrolledFrame(root)
     cmdFrm = TkCmdFrm(bgndFrm.interior)  # Changed to bgndFrm.interior
     bgndFrm.pack()
     numInpBrds = 0
     numSolBrds = 0
     for i in xrange(len(TkinterThread.GameData.RulesData.INV_ADDR_LIST)):
         if ((TkinterThread.GameData.RulesData.INV_ADDR_LIST[i] & (ord)(rs232Intf.CARD_ID_TYPE_MASK)) == (ord)(rs232Intf.CARD_ID_INP_CARD)): 
             GameData.tkInpBrd.append(TkInpBrd(numInpBrds, i, TkinterThread.GameData.RulesData.INV_ADDR_LIST[i], bgndFrm.interior))  # Changed to bgndFrm.interior
             numInpBrds += 1
         elif ((TkinterThread.GameData.RulesData.INV_ADDR_LIST[i] & (ord)(rs232Intf.CARD_ID_TYPE_MASK)) == (ord)(rs232Intf.CARD_ID_SOL_CARD)):
             GameData.tkSolBrd.append(TkSolBrd(numSolBrds, i, TkinterThread.GameData.RulesData.INV_ADDR_LIST[i], bgndFrm.interior))   # Changed to bgndFrm.interior
             numSolBrds += 1
     for i in xrange(TkinterThread.GameData.LedBitNames.NUM_LED_BRDS):
         GameData.tkLedBrd.append(TkLedBrd(i, numSolBrds + numInpBrds + i + 1, bgndFrm.interior))   # Changed to bgndFrm.interior
     root.update()
     TkinterThread.doneInit = True
     
     while TkinterThread._runTkinterThread:
         root.update()
         cmdFrm.Update_Cmd_Frm()
         
         # Copy the current LED state
         self.blinkOn = not self.blinkOn
         ledData = list(LedBrd.currLedData)
         if self.blinkOn:
             ledBlink = list(LedBrd.currBlinkLeds)
             for i in xrange(TkinterThread.GameData.LedBitNames.NUM_LED_BRDS):
                 ledData[i] |= ledBlink[i]
         for i in xrange(TkinterThread.GameData.LedBitNames.NUM_LED_BRDS):
             GameData.tkLedBrd[i].updateLeds(ledData[i])
         for i in xrange(numSolBrds):
             GameData.tkSolBrd[i].update_status_field(SolBrd.currSolData[i])
         for i in xrange(numInpBrds):
             GameData.tkInpBrd[i].update_status_field(InpBrd.currInpData[i])
         dummy_count += 1
         time.sleep(float(GlobConst.TK_SLEEP)/1000.0)
开发者ID:Shifter1,项目名称:open-pinball-project,代码行数:42,代码来源:tkinterThread.py

示例13: startSession

# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import wm_title [as 别名]
    def startSession(self):
        assert TkinterIsInstalled, '''
        Tkinter is not installed. 
        If you have Linux you could try using 
        "apt-get install python-tk"'''
        try:
            import nlopt
        except ImportError:
            s = '''
            To use OpenOpt multifactor analysis tool 
            you should have nlopt with its Python API installed,
            see http://openopt.org/nlopt'''
            print(s)
            showerror('OpenOpt', s)
            raw_input()
            return
        import os
        hd = os.getenv("HOME")
        self.hd = hd
        root = Tk()
        self.root = root
        from openopt import __version__ as oover
        root.wm_title(' OpenOpt %s Multifactor analysis tool for experiment planning ' % oover)
        SessionSelectFrame = Frame(root)
        SessionSelectFrame.pack(side='top', padx=230, ipadx = 40, fill='x', expand=True)
        var = StringVar()
        var.set('asdf')
        Radiobutton(SessionSelectFrame, variable = var, text = 'New', indicatoron=0, \
                    command=lambda: (SessionSelectFrame.destroy(), self.create())).pack(side = 'top', fill='x', pady=5)
        Radiobutton(SessionSelectFrame, variable = var, text = 'Load', indicatoron=0,  \
                    command=lambda:self.load(SessionSelectFrame)).pack(side = 'top', fill='x', pady=5)
        
        root.protocol("WM_DELETE_WINDOW", self.exit)

        root.mainloop()
        self.exit()
开发者ID:AlbertHolmes,项目名称:openopt,代码行数:38,代码来源:mfa.py

示例14: Lamp

# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import wm_title [as 别名]
class Lamp(object):
	def __init__(self, queue):
		self.root = Tk()
		self.root.wm_title("lamp")
		self.circle = Canvas(self.root, width=100, height=100, bg='gray')
		self.circle.grid(padx=10, pady=10)

		self.queue = queue
		self.turnoff = True
		self.color = DEFAULT_COLOR
		self.circle.create_oval(20, 20, 80, 80, fill = self.color)

	def mainloop(self):
		self.root.mainloop()

	def action(self):
		xtype, xlen, xcolor = self.queue.get(block = True)
		if xcolor is not None:
			self.color = xcolor
		try:
			getattr(self, '_' + TYPE_MAP[xtype])()
		except Exception, e:
			error('action error %s' % e)
		finally:
开发者ID:ti9140,项目名称:lamp,代码行数:26,代码来源:lamp.py

示例15: imsi_mon_demo

# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import wm_title [as 别名]
class imsi_mon_demo(object):

    
    def __init__(self):
        self.imsi_mon_str = '/opt/nokiasiemens/bin/dmxsendcli --unit auto -h *,0102,054f,0,00,04,00,2b24 -b'
        self.imsi_list = imsi_list()
        self.imsi_mon_start = imsi_mon_start(self.imsi_list)
        
        self.imsi_val_1_row = 0
        self.imsi_val_2_row = self.imsi_val_1_row + 1
        self.imsi_val_3_row = self.imsi_val_2_row + 1
        self.imsi_val_4_row = self.imsi_val_3_row + 1
        self.imsi_val_5_row = self.imsi_val_4_row + 1
        self.imsi_val_6_row = self.imsi_val_5_row + 1
        self.imsi_val_7_row = self.imsi_val_6_row + 1
        self.imsi_val_8_row = self.imsi_val_7_row + 1
        self.imsi_val_9_row = self.imsi_val_8_row + 1
        self.imsi_val_10_row = self.imsi_val_9_row + 1
        self.imsi_val_11_row = self.imsi_val_10_row + 1
        self.imsi_val_12_row = self.imsi_val_11_row + 1
        self.imsi_val_13_row = self.imsi_val_12_row + 1
        self.imsi_val_14_row = self.imsi_val_13_row + 1
        self.imsi_val_15_row = self.imsi_val_14_row + 1
        self.imsi_val_16_row = self.imsi_val_15_row + 1
        self.dmx_output_row = self.imsi_val_15_row + 3
        
        self.root = Tk()
        self.root.wm_title("IMSI List notify")
        
        # valid percent substitutions (from the Tk entry man page)
        # %d = Type of action (1=insert, 0=delete, -1 for others)
        # %i = index of char string to be inserted/deleted, or -1
        # %P = value of the entry if the edit is allowed
        # %s = value of entry prior to editing
        # %S = the text string being inserted or deleted, if any
        # %v = the type of validation that is currently set
        # %V = the type of validation that triggered the callback
        #      (key, focusin, focusout, forced)
        # %W = the tk name of the widget
        vcmd = (self.root.register(self.OnValidate), 
                '%d', '%i', '%P', '%s', '%S', '%v', '%V', '%W')

        self.label_imsi_val_1 = Label (self.root, text= "imsi_val[0]")
        self.label_imsi_val_1.grid(row=self.imsi_val_1_row)
        self.imsi_val_1_text = StringVar()
#         self.imsi_val_1_text.set('ffff')
        Entry(self.root, textvariable=self.imsi_val_1_text, validate="key", validatecommand=vcmd).grid(row=0, column=1)

        self.label_imsi_val_2 = Label (self.root, text= "imsi_val[1]")
        self.label_imsi_val_2.grid(row=self.imsi_val_2_row)
        self.imsi_val_2_text = StringVar()
        Entry(self.root, textvariable=self.imsi_val_2_text, validate="key", validatecommand=vcmd).grid(row=1, column=1)
        
        self.label_imsi_val_3 = Label (self.root, text= "imsi_val[2]")
        self.label_imsi_val_3.grid(row=self.imsi_val_3_row)
        self.imsi_val_3_text = StringVar()
        Entry(self.root, textvariable=self.imsi_val_3_text, validate="key", validatecommand=vcmd).grid(row=2, column=1)

        self.label_imsi_val_4 = Label (self.root, text= "imsi_val[3]")
        self.label_imsi_val_4.grid(row=self.imsi_val_4_row)
        self.imsi_val_4_text = StringVar()
        Entry(self.root, textvariable=self.imsi_val_4_text, validate="key", validatecommand=vcmd).grid(row=3, column=1)

        self.label_imsi_val_5 = Label (self.root, text= "imsi_val[4]")
        self.label_imsi_val_5.grid(row=self.imsi_val_5_row)
        self.imsi_val_5_text = StringVar()
        Entry(self.root, textvariable=self.imsi_val_5_text, validate="key", validatecommand=vcmd).grid(row=4, column=1)

        self.label_imsi_val_6 = Label (self.root, text= "imsi_val[5]")
        self.label_imsi_val_6.grid(row=self.imsi_val_6_row)
        self.imsi_val_6_text = StringVar()
        Entry(self.root, textvariable=self.imsi_val_6_text, validate="key", validatecommand=vcmd).grid(row=5, column=1)

        self.label_imsi_val_7 = Label (self.root, text= "imsi_val[6]")
        self.label_imsi_val_7.grid(row=self.imsi_val_7_row)
        self.imsi_val_7_text = StringVar()
        Entry(self.root, textvariable=self.imsi_val_7_text, validate="key", validatecommand=vcmd).grid(row=6, column=1)

        self.label_imsi_val_8 = Label (self.root, text= "imsi_val[7]")
        self.label_imsi_val_8.grid(row=self.imsi_val_8_row)
        self.imsi_val_8_text = StringVar()
        Entry(self.root, textvariable=self.imsi_val_8_text, validate="key", validatecommand=vcmd).grid(row=7, column=1)


        self.label_imsi_val_9 = Label (self.root, text= "imsi_val[8]")
        self.label_imsi_val_9.grid(row=self.imsi_val_9_row)
        self.imsi_val_9_text = StringVar()
#         self.imsi_val_1_text.set('ffff')
        Entry(self.root, textvariable=self.imsi_val_9_text, validate="key", validatecommand=vcmd).grid(row=8, column=1)

        self.label_imsi_val_10 = Label (self.root, text= "imsi_val[9]")
        self.label_imsi_val_10.grid(row=self.imsi_val_10_row)
        self.imsi_val_10_text = StringVar()
        Entry(self.root, textvariable=self.imsi_val_10_text, validate="key", validatecommand=vcmd).grid(row=9, column=1)
        
        self.label_imsi_val_11 = Label (self.root, text= "imsi_val[10]")
        self.label_imsi_val_11.grid(row=self.imsi_val_11_row)
        self.imsi_val_11_text = StringVar()
        Entry(self.root, textvariable=self.imsi_val_11_text, validate="key", validatecommand=vcmd).grid(row=10, column=1)

#.........这里部分代码省略.........
开发者ID:hlf0312,项目名称:python,代码行数:103,代码来源:imsi_mon_demo.py


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