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

Python desktop.getDesktop函数代码示例

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

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



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

示例1: __init__

    def __init__(self):
        Window.__init__(self, 0, getDesktop().height - 24, getDesktop().width, 24, topmost=1)
        self.setLayout(pyui.layouts.BorderLayoutManager())

        self.command = Edit("Enter commands here.", 255, self.enter)
        self.addChild(self.command, pyui.locals.CENTER)
        self.pack()
开发者ID:BackupTheBerlios,项目名称:street-svn,代码行数:7,代码来源:CommandLine.py


示例2: __init__

    def __init__(self):

        # create gui objects
        self.grid = None
        self.makeWindow()
	#self.dbutton = pyui.widgets.Button("Delete!", self.onDelete)
        getDesktop().registerHandler(DIALOGCLOSED, self.onDialogClosed)
开发者ID:burito,项目名称:PyUI,代码行数:7,代码来源:test2.py


示例3: setDirty

 def setDirty(self, collide = 1):
     self.dirty = 1
     if self.dirty:
         return
     if collide:
         getDesktop().dirtyCollidingWindows(self.rect)
     Base.setDirty(self)
开发者ID:burito,项目名称:PyUI,代码行数:7,代码来源:base.py


示例4: setShow

 def setShow(self,value):
     self.show = value
     self.setDirty()
     for child in self.children:
         child.setShow(value)
     if not value:
         getDesktop().getTheme().setArrowCursor()            
开发者ID:burito,项目名称:PyUI,代码行数:7,代码来源:base.py


示例5: init

def init():
    pyui.init(width, height, "p3d", fullscreen=0, title="CodeWorld")
    getRenderer().setBackMethod(render)
    getDesktop().registerHandler(pyui.locals.KEYDOWN, keyDown)
    pygame.key.set_repeat(500, 30)

    initGL()
开发者ID:BackupTheBerlios,项目名称:street-svn,代码行数:7,代码来源:Core.py


示例6: write

 def write(self, text):
     text = string.rstrip(text)
     if len(text) < 1:
         return
     text = string.replace(text, "\n", " ")
     text = string.replace(text, "\r", " ")      
     self.append(text)
     getDesktop().postUserEvent(pyui.dialogs.EVENT_OUTPUT)
开发者ID:harkal,项目名称:sylphis3d,代码行数:8,代码来源:console.py


示例7: close

 def close(self, value = 1):
     #print "closed - " , value
     self.modal = value
     getDesktop().setModal(None)
     self.setShow(0)
     self.loseFocus()
     self.postEvent(locals.DIALOGCLOSED)
     if self.cb:
         self.cb(value)
开发者ID:BackupTheBerlios,项目名称:street-svn,代码行数:9,代码来源:dialogs.py


示例8: write

 def write(self, text):
     #self.oldout.write("%s" % text)
     text = string.rstrip(text)
     if len(text) < 1:
         return
     text = string.replace(text, "\n", " ")
     text = string.replace(text, "\r", " ")      
     self.lines.append(text)
     getDesktop().postUserEvent(EVENT_OUTPUT)
开发者ID:BackupTheBerlios,项目名称:street-svn,代码行数:9,代码来源:dialogs.py


示例9: update

def update():
    getDesktop().draw()
    getDesktop().update()

    r, w, e = Network.multiplex()
    for sock in r:
        try:
            sock.handleInput()
        except Exception, exc:
            print "Unhandled exception:", exc
开发者ID:BackupTheBerlios,项目名称:street-svn,代码行数:10,代码来源:Core.py


示例10: __init__

 def __init__(self, x = -1, y = -1, w = 300, h = 200, title = None):
     # center if position not specified
     if x < 0:
         x = (getDesktop().width - w) / 2
     if y < 0:
         y = (getDesktop().height - h) / 2
     pyui.widgets.Frame.__init__(self, x, y, w, h, title)
     self.modal = -1   # this is set to the return value of the dialog
     self.setShow(1)
     self.setDirty()
     self.cb = None
开发者ID:BackupTheBerlios,项目名称:street-svn,代码行数:11,代码来源:dialogs.py


示例11: __init__

    def __init__(self):
        Window.__init__(self, 0, 0, getDesktop().width, \
                        getDesktop().height/4, topmost = 1)
        self.setLayout(pyui.layouts.BorderLayoutManager())
        self.outputBox = LineDisplay()
        self.addChild(self.outputBox, pyui.locals.CENTER)
        self.pack()

	Events.addCallbacks('keyDown', self.keyDown)
	
        self.oldout = sys.stdout
        sys.stdout = self
开发者ID:BackupTheBerlios,项目名称:street-svn,代码行数:12,代码来源:Console.py


示例12: ReSizeGLScene

    def ReSizeGLScene(self, Width, Height):
        # Prevent A Divide By Zero If The Window Is Too Small     
        if Height == 0:	
            Height = 1

        # Reset The Current Viewport And Perspective Transformation
        glViewport(0, 0, Width, Height)		
        glMatrixMode(GL_PROJECTION)
        glLoadIdentity()
        gluPerspective(45.0, float(Width)/float(Height), 0.1, 100.0)
        glMatrixMode(GL_MODELVIEW)
        getDesktop().width = self.width = Width
        getDesktop().height = self.height = Height
开发者ID:burito,项目名称:PyUI,代码行数:13,代码来源:openglGlut.py


示例13: destroy

 def destroy(self):
     """Call this to remove all references to the widget from the system.
     """
     #print "destroying %s (%d)" % (self, self.id)
     self.window = None
     self.setParent(None)
     if self.popup:
         self.popup.destroy()
         self.popup = None
     if self.children:
         for child in self.children:
             child.destroy()
         self.children = []
     self.eventMap.clear()
     getDesktop().destroyWidget(self)
开发者ID:burito,项目名称:PyUI,代码行数:15,代码来源:base.py


示例14: setup2D

    def setup2D(self):
        """Setup everything on the opengl Stack to draw in 2D in a way that can be torn down later.
        """
        glMatrixMode(GL_PROJECTION)
        glPushMatrix()
        glLoadIdentity()
        glOrtho( 0, getDesktop().width, getDesktop().height, 0, -1, 1 )

        glMatrixMode(GL_MODELVIEW)
        glPushMatrix()
        glLoadIdentity()

        glDisable(GL_DEPTH_TEST)

        glEnable(GL_BLEND)
        glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
开发者ID:burito,项目名称:PyUI,代码行数:16,代码来源:openglBase.py


示例15: __init__

 def __init__(self, x, y, w, h, topmost = 0):
     self._panel = Panel()
     Base.__init__(self)
     self.topMost = topmost
     self._panel.moveto(0,0)
     # the content panel is added as a child through Base::addChild to avoid recursively adding it to itself
     Base.addChild(self, self._panel)
     self._panel.setWindow(self)
     self.drawCommands = []
     # these are drawing callbacks to draw _after_ all the widgets are drawn
     self.drawLastCallbacks = [] 
     if self.__dict__.has_key("title"):
         self.handle = getRenderer().createWindow(self.title)
     else:
         self.handle = getRenderer().createWindow("")
     self.moveto(x, y)
     self.resize(w, h)
     getDesktop().addWindow(self)
开发者ID:BackupTheBerlios,项目名称:street-svn,代码行数:18,代码来源:base.py


示例16: _pyuiKeyUp

    def _pyuiKeyUp(self, event):
        if getDesktop().getFocus() != self.id:
            return 0

        if event.key == pyui.locals.K_SHIFT:
            self.shifting = 0
            return 1

        return 0
开发者ID:bcamellia,项目名称:PySBD,代码行数:9,代码来源:entry.py


示例17: __init__

 def __init__(self):
     """Initialize and register the base widget. widgets are added to the global widget list initially.
     """
     self.parent = None
     self.window = None
     self.posX = 0
     self.posY = 0
     self.width = 1
     self.height = 1
     self.show = 1
     self.dirty = 1
     self.fgColor = getDesktop().theme.getFgColor()
     self.bgColor = getTheme().getBgColor()
     self.children = []
     self.eventMap = {}
     self.calcSize()
     getDesktop().registerWidget(self)
     self.popup = None
     self.tooltipText = ""
开发者ID:burito,项目名称:PyUI,代码行数:19,代码来源:base.py


示例18: runMe

 def runMe(self):
     if not getDesktop().running:
         sys.exit()
     pyui.update()
     pyui.draw()
     self.frame = self.frame + 1
     now = time.time()
     if now - self.last >= 1:
         self.last = now
         print "FPS: %d" % self.frame
         self.frame = 0
开发者ID:BackupTheBerlios,项目名称:street-svn,代码行数:11,代码来源:openglGlut.py


示例19: update

    def update(self):
        """PyGame event handling.
        """
        desktop = getDesktop()
        ## process all pending system events.
        event = pygame.event.poll()
        while event.type != locals.NOEVENT:

            # special case to handle multiple mouse buttons!
            if event.type == locals.MOUSEBUTTONDOWN:
                # print "Mausssssssssssssssssssssssssssssssssss"
                if event.dict["button"] == 1:
                    desktop.postUserEvent(pyui.locals.LMOUSEBUTTONDOWN, event.pos[0], event.pos[1])
                elif event.dict["button"] == 3:
                    desktop.postUserEvent(pyui.locals.RMOUSEBUTTONDOWN, event.pos[0], event.pos[1])
                elif event.dict["button"] == 4:
                    desktop.postUserEvent(pyui.locals.MOUSEWHEEL, event.pos[0], event.pos[1], "UP")
                elif event.dict["button"] == 5:
                    desktop.postUserEvent(pyui.locals.MOUSEWHEEL, event.pos[0], event.pos[1], "DOWN")

            elif event.type == locals.MOUSEBUTTONUP:
                if event.dict["button"] == 1:
                    desktop.postUserEvent(pyui.locals.LMOUSEBUTTONUP, event.pos[0], event.pos[1])
                elif event.dict["button"] == 3:
                    desktop.postUserEvent(pyui.locals.RMOUSEBUTTONUP, event.pos[0], event.pos[1])

            elif event.type == locals.MOUSEMOTION:
                desktop.postUserEvent(pyui.locals.MOUSEMOVE, event.pos[0], event.pos[1])

            elif event.type == pygame.VIDEORESIZE:
                desktop.postUserEvent(pygame.VIDEORESIZE, event.w, event.h)

            elif event.type == locals.KEYDOWN:
                character = event.unicode
                code = 0
                if len(character) > 0:
                    code = ord(character)
                else:
                    code = event.key
                    # code = event.key, code
                desktop.postUserEvent(pyui.locals.KEYDOWN, 0, 0, code, pygame.key.get_mods())
                # if code >= 32 and code < 128:
                #    desktop.postUserEvent(pyui.locals.CHAR, 0, 0, character, pygame.key.get_mods())
            elif event.type == locals.KEYUP:
                code = event.key
                desktop.postUserEvent(pyui.locals.KEYUP, 0, 0, code, pygame.key.get_mods())

            else:
                try:
                    desktop.postUserEvent(event.type)
                except:
                    print "Error handling event %s" % repr(event)
            event = pygame.event.poll()
开发者ID:ieugen,项目名称:Teachingbox,代码行数:53,代码来源:openglPygame.py


示例20: onMouse

 def onMouse(self, button, state, x, y):
     if button == 1:
         return
     if state == 0:
         # mouse button down
         if button == 0:
             getDesktop().postUserEvent(pyui.locals.LMOUSEBUTTONDOWN, x, y)
         else:
             getDesktop().postUserEvent(pyui.locals.RMOUSEBUTTONDOWN, x, y)
     else:
         # mouse button up
         if button == 0:
             getDesktop().postUserEvent(pyui.locals.LMOUSEBUTTONUP, x, y)
         else:
             getDesktop().postUserEvent(pyui.locals.RMOUSEBUTTONUP, x, y)
开发者ID:BackupTheBerlios,项目名称:street-svn,代码行数:15,代码来源:openglGlut.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python desktop.getRenderer函数代码示例发布时间:2022-05-27
下一篇:
Python ugrid.UGrid类代码示例发布时间: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