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


Python tksupport.install函数代码示例

本文整理汇总了Python中twisted.internet.tksupport.install函数的典型用法代码示例。如果您正苦于以下问题:Python install函数的具体用法?Python install怎么用?Python install使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: __init__

    def __init__(self):
	root = self.root = Tk()
	root.wm_title('xcons')
	# Link Tk into twisted main loop
	tksupport.install(root)

	# Create menu bar
	mbar = Frame(root)
	mbar.pack(side=TOP, fill=X)
	if mbar:
	    mb_console = Menubutton(mbar, text='Console', underline=0)
	    if mb_console:
		menu = mb_console['menu'] = Menu(mb_console, tearoff=0)
		# menu.add_command(label='Connect...', underline=0)
		menu.add_command(label='Exit', underline=1,
				 command=root.quit)
	    mb_console.pack(side=LEFT)

	status = self.status = Label(root)
	status.pack(side=BOTTOM, anchor=W)

	# Create text area
	#xsc = Scrollbar(root, orient=HORIZONTAL)
	ysc = Scrollbar(root)
	text = self.text = Text(root,
				font='jet-small-fixed',
				yscrollcommand=ysc.set)
	ysc.config(command=text.yview)

	ysc.pack(side=RIGHT, fill=Y)
	text.pack(side=TOP, fill=BOTH)

	text.bind('<KeyPress>', self.keypress)
开发者ID:pythontech,项目名称:ptcons,代码行数:33,代码来源:xcons.py

示例2: optionView

    def optionView(self):

        tksupport.install(self.top)

        self.top.title('Chat')
        self.top.geometry( '700x680' )

        def callback():
            self.stop()

        self.top.protocol("WM_DELETE_WINDOW", callback)

        optionView = Frame(self.top)
        optionView.pack()

        MyButton = partial(Button, optionView, text='Host a server', command=self.serverView)

        chooseServer = MyButton()
        chooseServer.pack()

        chooseClient = MyButton(text='Connect to a server', command=self.clientView)
        chooseClient.pack()

        
        quitButton = Button(optionView, text='QUIT',command=self.stop)
        quitButton.pack()

        self.pages['optionView'] = optionView
        self.current = 'optionView'

        reactor.run()
开发者ID:cverhelst,项目名称:PasswordRecovery,代码行数:31,代码来源:view.py

示例3: run

def run():
    import sys

    opt = Options()
    opt.parseOptions(sys.argv[1:])
    delay = int(opt["delay"])
    if opt["proxy"]:
        host = urlparse.urlparse(opt["proxy"])[1]
        if ":" in host:
            host, port = host.split(":", 1)
            port = int(port)
        else:
            port = 80
        makeChecker = lambda url, notified: monitor.ProxyChangeChecker(host, port, notified, url, delay)
    else:
        makeChecker = lambda url, notified: monitor.ChangeChecker(notified, url, delay)
    from twisted.internet import reactor, tksupport

    root = Tk.Tk()
    root.protocol("WM_DELETE_WINDOW", reactor.stop)
    root.title("Web Monitor")
    tksupport.install(root)
    frame = webmonFrame(root, makeChecker, opt.urls)
    frame.pack()
    reactor.run()
开发者ID:jsober,项目名称:twisted,代码行数:25,代码来源:tkwebmon.py

示例4: main

def main():     
    root = Tk()
    root.title('BSE Client')
    root.geometry("600x670")  
    root.pack_propagate(0)
    ui = UI(root)
    tksupport.install(root)     
    reactor.run()
开发者ID:mn9182,项目名称:BSE,代码行数:8,代码来源:BSE_Trader_Terminal.py

示例5: __init__

    def __init__(self, ip="localhost"):
        self.window = Tk()
        self.canvas = Canvas(self.window, {"height": 700, "width": 1200})
        self.canvas.grid(column=0, row=0, sticky=(N, W))
        self.game_board = None

        point = TCP4ClientEndpoint(reactor, ip, 1079)
        d = point.connect(ObserverProtocolFactory(self.update_board))

        tksupport.install(self.window)
        reactor.run()
开发者ID:dustice,项目名称:grimwar,代码行数:11,代码来源:TKTestObserver.py

示例6: __init__

 def __init__(self, parent):
     from Tkinter import Tk, Label, Button
     self.parent = parent
     self.win = Tk(className='moving')
     self.win.overrideredirect(1)
     self.win.tkraise()
     self.label = Label(self.win, text=' '*25, font='fixed')
     self.label.pack(padx=20, pady=10)
     self.button = Button(self.win, text='OK', command=self.parent.hide)
     self.button.pack(pady=5)
     tksupport.install(self.win)
开发者ID:braams,项目名称:shtoom,代码行数:11,代码来源:notification.py

示例7: run

def run():
    global button
    global osc_sender
    osc_sender = UDPSenderApplication(OSC_SEND_PORT, OSC_SEND_HOST)
    root = Tkinter.Tk()
    root.wm_title("Color picker osc.udp://%s:%s" % (OSC_SEND_HOST, OSC_SEND_PORT))
    button = Tkinter.Button(root, text='Set Background Color',
            command=set_color)
    button.config(height=3, font=('times', 20, 'bold'))
    button.pack(expand=Tkinter.YES, fill=Tkinter.BOTH)
    tksupport.install(root)
    reactor.run()
开发者ID:interferences-at,项目名称:encreslumieres,代码行数:12,代码来源:osc-color-picker.py

示例8: _start_root

    def _start_root(self):
        if os.name == "nt":
            button_foreground = "#104639"
            lookup_button_padding = 10
        else:
            button_foreground = "#FFFFFF"
            lookup_button_padding = 11

        root = tk.Tk()
        root.resizable(0, 0)
        root.wm_title("LBRY")

        tksupport.install(root)

        if os.name == "nt":
            root.iconbitmap(os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])),
                                         "lbrynet", "lbrynet_downloader_gui", "lbry-dark-icon.ico"))
        else:
            root.wm_iconbitmap("@" + os.path.join(os.path.dirname(__file__), "lbry-dark-icon.xbm"))

        root.button_font = tkFont.Font(size=9)

        ttk.Style().configure(".", background="#FFFFFF")
        ttk.Style().configure("LBRY.TButton", background="#104639", foreground=button_foreground,
                              borderwidth=1, relief="solid", font=root.button_font)
        ttk.Style().map("LBRY.TButton",
                        background=[('pressed', "#104639"),
                                    ('active', "#104639")])
        #ttk.Style().configure("LBRY.TButton.border", background="#808080")
        ttk.Style().configure("Lookup.LBRY.TButton", padding=lookup_button_padding)
        ttk.Style().configure("Stop.TButton", padding=1, background="#FFFFFF", relief="flat", borderwidth=0)
        ttk.Style().configure("TEntry", padding=11)
        ttk.Style().configure("Float.TEntry", padding=2)
        #ttk.Style().configure("A.TFrame", background="red")
        #ttk.Style().configure("B.TFrame", background="green")
        #ttk.Style().configure("B2.TFrame", background="#80FF80")
        #ttk.Style().configure("C.TFrame", background="orange")
        #ttk.Style().configure("D.TFrame", background="blue")
        #ttk.Style().configure("E.TFrame", background="yellow")
        #ttk.Style().configure("F.TFrame", background="#808080")
        #ttk.Style().configure("G.TFrame", background="#FF80FF")
        #ttk.Style().configure("H.TFrame", background="#0080FF")
        #ttk.Style().configure("LBRY.TProgressbar", background="#104639", orient="horizontal", thickness=5)
        #ttk.Style().configure("LBRY.TProgressbar")
        #ttk.Style().layout("Horizontal.LBRY.TProgressbar", ttk.Style().layout("Horizontal.TProgressbar"))

        root.configure(background="#FFFFFF")

        root.protocol("WM_DELETE_WINDOW", self.stop)

        self.master = root
开发者ID:teran-mckinney,项目名称:lbry,代码行数:51,代码来源:GuiApp.py

示例9: setup_window

def setup_window(title = "Turtles"):
    #setup canvas and make it play nicely with Twisted
    root = Tkinter.Tk() 
    canvas = Tkinter.Canvas(root,width=WINDOW_WIDTH,height=WINDOW_HEIGHT)
    canvas.pack(side = Tkinter.LEFT)

    tksupport.install(root)
   
    root.title(title)
    draw_headings(canvas)
    
    root.protocol('WM_DELETE_WINDOW', reactor.stop)
    
    return canvas
开发者ID:ggaughan,项目名称:logo140,代码行数:14,代码来源:turtles.py

示例10: __init__

    def __init__(self):
        self.window = Tk()
        self.canvas = Canvas(self.window, { "height": 700, "width": 1450 })
        self.canvas.grid(column = 0, row = 0, sticky=(N, W))
        self.game_board = None
        self.actions = None
        self.simulator_screen = None

        point = TCP4ClientEndpoint(reactor, "localhost", 1079)
        d = point.connect(PlayerProtocolFactory(self.update_game))
        d.addCallback(self.got_protocol)

        tksupport.install(self.window)
        reactor.run()
开发者ID:dustice,项目名称:grimwar,代码行数:14,代码来源:TKSimulator.py

示例11: main

def main():        
    root = Tk()

    # Install the Reactor support
    tksupport.install(root)

    # at this point build Tk app as usual using the root object,
    # and start the program with "reactor.run()", and stop it
    # with "reactor.stop()".

    app = App(root)

    root.mainloop()
    root.destroy() # optional; see description below
开发者ID:GrazianoFracasso,项目名称:ListBotIrc,代码行数:14,代码来源:gui.py

示例12: main

def main():
    from twisted.python import log
    log.startLogging(sys.stdout)

    symbol = Symbol.X
    if len(sys.argv) > 1:
        arg = sys.argv[1].strip().lower()
        symbol = Symbol.X if arg == 'x' else Symbol.O

    log.msg('The symbol for the human player is ', symbol)

    app = App(None, symbol)
    app.eval('tk::PlaceWindow %s center' % app.winfo_pathname(app.winfo_id()))

    tksupport.install(app)
    reactor.run()
开发者ID:FlorinLozneanu,项目名称:tictactoe,代码行数:16,代码来源:tkgui.py

示例13: run

def run():
    global menu, options, frame
    args = sys.argv[1:]
    if '-l' in args: # cvs is an idiot
        i = args.index('-l')
        args = args[i:i+2]+args
        del args[i+2:i+4]
    for arg in args[:]:
        try:
            i = args.index(arg)
            if arg[:2] == '-o' and args[i+1][0]!='-':
                args[i:i+2] = [] # suck on it scp
        except ValueError:
            pass
    root = Tkinter.Tk()
    root.withdraw()
    top = Tkinter.Toplevel()
    menu = TkConchMenu(top)
    menu.pack(side=Tkinter.TOP, fill=Tkinter.BOTH, expand=1)
    options = GeneralOptions()
    try:
        options.parseOptions(args)
    except usage.UsageError as u:
        print('ERROR: %s' % u)
        options.opt_help()
        sys.exit(1)
    for k,v in options.items():
        if v and hasattr(menu, k):
            getattr(menu,k).insert(Tkinter.END, v)
    for (p, (rh, rp)) in options.localForwards:
        menu.forwards.insert(Tkinter.END, 'L:%s:%s:%s' % (p, rh, rp))
    options.localForwards = []
    for (p, (rh, rp)) in options.remoteForwards:
        menu.forwards.insert(Tkinter.END, 'R:%s:%s:%s' % (p, rh, rp))
    options.remoteForwards = []
    frame = tkvt100.VT100Frame(root, callback=None)
    root.geometry('%dx%d'%(tkvt100.fontWidth*frame.width+3, tkvt100.fontHeight*frame.height+3))
    frame.pack(side = Tkinter.TOP)
    tksupport.install(root)
    root.withdraw()
    if (options['host'] and options['user']) or '@' in options['host']:
        menu.doConnect()
    else:
        top.mainloop()
    reactor.run()
    sys.exit(exitStatus)
开发者ID:JohnDoes95,项目名称:project_parser,代码行数:46,代码来源:tkconch.py

示例14: make_client

def make_client():
    root = tk.Tk()
    root.title('Tkwidgets application')
        
    login_window = LoginWindow(root)

    factory = ClientFactory(
            root,
            on_connect=functools.partial(setattr, login_window, 'handle'),
            on_login=login_window.lock,
            on_logout=login_window.unlock
    )

    reactor.connectTCP('localhost', STANDARD_PORT, factory)

    tksupport.install(root)

    reactor.run()
开发者ID:rik0,项目名称:rk-exempla,代码行数:18,代码来源:twisted_example.py

示例15: main

def main():
    logging.basicConfig(
        filename="client.log",
        level=logging.INFO,
        format="%(asctime)s -  %(name)s - %(thread)d - %(levelname)s - %(message)s",
        datefmt="%m/%d/%Y %I:%M:%S %p",
    )
    root = Tk()
    root.protocol("WM_DELETE_WINDOW", lambda: on_closing(root, reactor))

    # Install the Reactor support
    tksupport.install(root)
    # set rez
    root.geometry(rez)
    root.wm_title(title)
    # create app obj
    app = Application(reactor, master=root)
    # main loop from
    reactor.run()
开发者ID:Esentiel,项目名称:auto_build_installer,代码行数:19,代码来源:client.py


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