本文整理汇总了Python中pyui.desktop.getDesktop函数的典型用法代码示例。如果您正苦于以下问题:Python getDesktop函数的具体用法?Python getDesktop怎么用?Python getDesktop使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getDesktop函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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()
示例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)
示例3: setDirty
def setDirty(self, collide = 1):
self.dirty = 1
if self.dirty:
return
if collide:
getDesktop().dirtyCollidingWindows(self.rect)
Base.setDirty(self)
示例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()
示例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()
示例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)
示例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)
示例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)
示例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
示例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
示例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
示例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
示例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)
示例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)
示例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)