本文整理汇总了Python中window.Window.create方法的典型用法代码示例。如果您正苦于以下问题:Python Window.create方法的具体用法?Python Window.create怎么用?Python Window.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类window.Window
的用法示例。
在下文中一共展示了Window.create方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: min
# 需要导入模块: from window import Window [as 别名]
# 或者: from window.Window import create [as 别名]
self.moveTarget.top = min(max(t, 0), self.moveTarget.parent.height - self.parent.height)
if __name__ == '__main__':
from window import Window
from panel import Canvas, StackPanel
from component import Component
from random import randint
import color
koan.init()
w = Window()
w.create(0, 0, 800, 600, True)
w.bgColor = color.black
b = Captionbar(w)
b.bindData('width', w, 'width', dir = '<-')
b.height = 100
b.bgColor = color.darkblue
c = StackPanel(w)
c.bgColor = color.darkgray
c.size = 400, 300
b = Caption(c)
#b.bindData('width', c, 'width', dir = '<-')
b.height = 50
b.bgColor = color.lightgray
示例2: super
# 需要导入模块: from window import Window [as 别名]
# 或者: from window.Window import create [as 别名]
if 'M' not in self.align.upper():
self.invoke('Input Finish')
return True
return super(RichEdit, self).onKey(key)
Edit = RichEdit
if __name__ == '__main__':
from window import Window
from pprint import pprint
koan.init()
w = Window()
w.create(0, 0, 640, 480, caption = True)
w.bgColor = color.darkgray
w.bind('Key', pprint)
e = Edit(w)
e.rect = 10,10,300,200
e.align = 'MTL'
e.vscroll = False
e.font = 'Segoe UI'
e.hscroll = False
#e.bgColor = color.lightgray
e.bgColor = color.darkblue
e.fontColor = color.green
#koan.anim.PostEvent(setattr, e, 'text', 'Testing, hello world')
e.maxlen = 5
e.text = 'Hello world'
示例3: onDraw
# 需要导入模块: from window import Window [as 别名]
# 或者: from window.Window import create [as 别名]
#-------------------------------------------------
# display
#-------------------------------------------------
def onDraw(self, render):
super(Combobox, self).onDraw(render)
TextBase.onDraw(self, render)
if __name__ == '__main__':
from window import Window
from panel import StackPanel
koan.init()
w = Window()
w.create(0, 0, 400, 600, True)
w.bgColor = color.darkgray
p = StackPanel(w)
p.bindData('width', w, 'width', dir = '<-')
p.bindData('height', w, 'height', dir = '<-')
# button
b = Button(p)
b.tips = 'Button'
b.bgColor = color.darkblue
b.height = 30
# text button
tb = TextButton(p)
tb.bgColor = color.darkred
示例4: trace
# 需要导入模块: from window import Window [as 别名]
# 或者: from window.Window import create [as 别名]
self.bind('Mouse Leave', self.trace, 'Mouse Leave')
self.bind('Mouse Down', self.trace, 'Mouse Down')
self.bind('Mouse Up', self.trace, 'Mouse Up')
self.bind('Mouse RDown', self.trace, 'Mouse RDown')
self.bind('Mouse RUp', self.trace, 'Mouse RUp')
self.bind('Click', self.trace, 'Click')
self.bind('Dbl Click', self.trace, 'Dbl Click')
self.bind('RDbl Click', self.trace, 'RDbl Click')
def trace(self, *argv, **argd):
print self, argv
koan.init()
w = Window()
w.create(0, 0, 800, 600, caption = True)
w.bgColor = color.darkblue
from dialog import Dialog
from pprint import pprint
w.d = Dialog(w)
w.d.bind('Mouse Enter', pprint, 'Mouse Enter')
w.d.bind('Mouse Leave', pprint, 'Mouse Leave')
w.d.size = 400, 300
w.d.bgColor = color.blue
w.bind('Key', koan.action.PureAction(w.d.doModal))
o = MyComponent(w.d)
o.rect = 100, 50, 300, 100
o.bgColor = color.yellow
w.show()
示例5: super
# 需要导入模块: from window import Window [as 别名]
# 或者: from window.Window import create [as 别名]
return True
return super(Slider, self).onKey(key)
if __name__ == '__main__':
from window import Window
import color
from pprint import pprint
def kprint(*argv):
pprint(argv)
#print '%f : %s' %(v, msg)
koan.init()
w = Window()
w.create(0, 0, 420, 240, caption = True)
w.bgColor = color.darkblue
s = Slider(w)
s.rect = 0.5, 100, 400, 100
s.bgColor = color.green
s.background = r'E:\CLCVS\PCM\Kanten\Generic\trunk\Custom\Skin\Standard\Photo\Media\slider\zoom_bar.png|(9,0,9,0)'
s.thumbImage = r'E:\CLCVS\PCM\Kanten\Generic\trunk\Custom\Skin\Standard\Photo\Media\seekbar\seek_btn_p.png|(1,1,1,1)'
s.thumbWidth = 20
s.snap = 5
s.setRange((-0.5, 0.5))
import functools
s.bind('Slide', functools.partial(kprint, 'Slide'))
#s.bind('Slide To', functools.partial(kprint, 'Slide To'))
s.bind('Slide To', lambda x: pprint(('Slide To', x)))