• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python tksupport.install函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: main

def main(application):
    import sys
    from shtoom.ui.util import maybeInstallDBus
    maybeInstallDBus()

    from twisted.internet import reactor
    from twisted.internet import tksupport

    from shtoom.ui.tkui import ShtoomMainWindow
    UI = ShtoomMainWindow()
    tksupport.install(UI.getMain())
    UI.connectApplication(application)
    from shtoom import log
    if application.getPref('stdout'):
        import sys
        log.startLogging(sys.stdout, setStdout=False)
    else:
        log.startLogging(UI.getLogger(), setStdout=False)
    return UI
开发者ID:braams,项目名称:shtoom,代码行数:19,代码来源:tkshtoom.py


示例17: __init__

    def __init__(self):
        self.window = Tk()
        self.window["bg"] = self.BACKGROUND
        self.window.title(APP_NAME)
        self.window.minsize(700, 550)

        tksupport.install(self.window)
        self.window.protocol("WM_DELETE_WINDOW", self.application_quit)

        self.createMenu()

        selectionGet = self.window.selection_get
        self.client = Client(self, selectionGet)
        self.client.pack()

        self.factory = pb.PBClientFactory()
        self.window.wait_visibility()
        self.logindialog = LoginDialog(self.window, self.loginSuccess, self.application_quit, REMOTE_SERVER, self.PORTNO, self.factory, self.client.cc)
        reactor.callWhenRunning(self.logindialog.run)
        reactor.run()
开发者ID:mgaitan,项目名称:beppo,代码行数:20,代码来源:Login.py


示例18: __init__

 def __init__(self, controller=None):
     self.root = Tk()
     tksupport.install(self.root)
     # h = self.root.winfo_screenheight()
     w = self.root.winfo_screenwidth()
     self.screenSize = (w, w / 2)  # the width of the picture for this game is twice as wide as its height
     # d = MyDialog(self.root)
     # print "result", d.size
     self.canvas = Canvas(self.root, width=self.screenSize[0], height=self.screenSize[1])
     self.controller = controller
     topFrame = Frame(self.root)
     topFrame.pack(side=TOP)
     self.question = StringVar()
     self.answer = StringVar()
     self.timeText = StringVar()
     self.scoreText = StringVar()
     self.scoresText = StringVar()
     self.nextRound = StringVar()
     self.nameInput = Entry(topFrame)
     self.nameInput.grid(row=0, column=1, sticky=W)
     Label(topFrame, text="Enter your name here:   ").grid(row=0, column=0, sticky=W)
     Label(topFrame, textvariable=self.question).grid(row=1, column=2, sticky=W)
     Label(topFrame, textvariable=self.answer).grid(row=1, column=3, sticky=W)
     Label(topFrame, textvariable=self.scoreText).grid(row=0, column=3, sticky=E)
     # Label(topFrame, textvariable=self.timeText).grid(row=2, column=1, sticky=W)
     self.progressBar = ProgressBar(topFrame, value=0, max=5, width=400)
     self.progressBar.grid(row=0, column=2, sticky=W)
     # self.nextRoundBar = ProgressBar(topFrame, value=5000, max=5000, width=400)
     # self.nextRoundBar.grid(row=1, column=2, sticky=W)
     Label(topFrame, textvariable=self.nextRound).grid(row=0, column=3, sticky=W)
     # Button(topFrame, text="Get Question", command=self.controller.getQuestion).grid(row=2, column=1, sticky=W)
     # Button(topFrame, text="New Game", command=self.controller.restartGame).grid(row=2, column=3, sticky=W)
     Button(topFrame, text="Quit", command=self.quit).grid(row=0, column=4, sticky=W)
     Button(topFrame, text="Restart", command=self.restart).grid(row=0, column=5, sticky=W)
     large = 1600
     self.imageId = None
     # self.makeImage(mapFile, None)
     self.canvas.bind("<Button-1>", self.controller.mouseEvent)
     self.canvas.pack(side=BOTTOM)
     self.lines = []
     self.map = None
开发者ID:Grammatiki,项目名称:geography,代码行数:41,代码来源:WorldView.py


示例19: doItTkinterly

def doItTkinterly(opt):
    root=Tkinter.Tk()
    root.withdraw()
    root.title('One Moment.')
    root.protocol('WM_DELETE_WINDOW', reactor.stop)
    tksupport.install(root)
    
    prog=ProgressBar(root, value=0, labelColor="black", width=200)
    prog.pack()

    # callback immediately
    d=defer.succeed(root).addErrback(log.err)

    def deiconify(root):
        root.deiconify()
        return root

    d.addCallback(deiconify)
    
    if opt['zipfile']:
        uz=Progressor('Unpacking documentation...')
        max=zipstream.countZipFileChunks(opt['zipfile'], 4096)
        uz.setBar(prog, max)
        uz.setIterator(zipstream.unzipIterChunky(opt['zipfile'],
                                                 opt['ziptargetdir']))
        d.addCallback(uz.processAll)

    if opt['compiledir']:
        comp=Progressor('Compiling to pyc...')
        comp.setBar(prog, countPysRecursive(opt['compiledir']))
        comp.setIterator(compiler(opt['compiledir']))
        d.addCallback(comp.processAll)

    def stop(ignore):
        reactor.stop()
        root.destroy()
    d.addCallback(stop)

    reactor.run()
开发者ID:Alberto-Beralix,项目名称:Beralix,代码行数:39,代码来源:tkunzip.py


示例20: run

def run():
    r = Tkinter.Tk()
    r.withdraw()
    tksupport.install(r)
    
    filename = tkFileDialog.askopenfilename(
        parent=r, title="Select Twisted APplication File",
        filetypes=FILE_TYPES
    )
    
    working = askdirectory(
        parent=r, title="Select Working Directory"
    )
    
    os.chdir(working)
    
    pickOptions(r, filename)

    from twisted.copyright import version
    r.title('Twisted Daemon Launcher ' + version)
    r.deiconify()
    reactor.run()
开发者ID:fxia22,项目名称:ASM_xf,代码行数:22,代码来源:tktwistd.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python utils.getProcessOutput函数代码示例发布时间:2022-05-27
下一篇:
Python threads.deferToThreadPool函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap