本文整理汇总了Python中widget.Widget._build方法的典型用法代码示例。如果您正苦于以下问题:Python Widget._build方法的具体用法?Python Widget._build怎么用?Python Widget._build使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类widget.Widget
的用法示例。
在下文中一共展示了Widget._build方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _build
# 需要导入模块: from widget import Widget [as 别名]
# 或者: from widget.Widget import _build [as 别名]
def _build(self, batch=None, group=None):
Widget._build(self, batch)
self._label.delete()
self._label = cached.Label(text = self._text, multiline=False,
batch=self._batch, group=self._fg_group,
anchor_x='left', anchor_y='top')
self._deleted = False
self._update_style()
self._update_state()
self._update_size()
示例2: _build
# 需要导入模块: from widget import Widget [as 别名]
# 或者: from widget.Widget import _build [as 别名]
def _build(self, batch=None, group=None):
Widget._build(self, batch) #, group)
for child in self._children:
child._delete()
child._build(batch=self._batch) #, group=self._fg_group)
self._deleted = False
self._update_style()
self._update_state()
self._update_size()
示例3: _build
# 需要导入模块: from widget import Widget [as 别名]
# 或者: from widget.Widget import _build [as 别名]
def _build(self, batch=None, group=None):
''' Build container and add it to batch and group.
:Parameters:
`batch` : `Batch`
Optional graphics batch to add the object to.
`group` : `Group`
Optional graphics group to use.
'''
Widget._build(self, batch) #, group)
for child in self._children:
child._delete()
child._build(batch=self._batch) #, group=self._fg_group)
self._deleted = False
self._update_style()
self._update_state()
self._update_size()
示例4: _build
# 需要导入模块: from widget import Widget [as 别名]
# 或者: from widget.Widget import _build [as 别名]
def _build(self, batch=None, group=None):
''' Build widget and add it to batch and group.
**Parameters**
`batch` : `Batch`
Optional graphics batch to add the object to.
`group` : `Group`
Optional graphics group to use.
'''
Widget._build(self, batch) #, group)
self._label.delete()
self._label = cached.Label(text = self._text, multiline=False,
batch=self._batch, group=self._fg_group,
anchor_x='left', anchor_y='top')
self._deleted = False
self._update_style()
self._update_state()
self._update_size()
示例5: _build
# 需要导入模块: from widget import Widget [as 别名]
# 或者: from widget.Widget import _build [as 别名]
def _build(self, batch=None, group=None):
''' Build box and add it to batch and group.
:Parameters:
`batch` : `Batch`
Optional graphics batch to add the object to.
`group` : `Group`
Optional graphics group to use.
'''
Widget._build(self, batch) #, group)
self.title._delete()
self.title._build(batch=self._batch) #, group=self._fg_group)
if self.child:
self.child._delete()
if self.title._active:
self.child._build(batch=self._batch, group=self._fg_group)
self._update_state()
self._update_style()
self._update_size()
示例6: _build
# 需要导入模块: from widget import Widget [as 别名]
# 或者: from widget.Widget import _build [as 别名]
def _build(self, batch=None, group=None):
''' Build entry and add it to batch and group.
**Parameters**
`batch` : `Batch`
Optional graphics batch to add the object to.
`group` : `Group`
Optional graphics group to use.
'''
Widget._build(self, batch) #, group)
if self._label:
self._label.delete()
self._label = None
if self._layout:
self._layout.delete()
self._layout = None
if self._caret:
self._caret.delete()
self._caret = None
# Dummy layout creation and deletion seems to make rendering faster
doc = pyglet.text.document.UnformattedDocument('dummy')
pyglet.text.layout.IncrementalTextLayout(doc, 1, 1, batch=self._batch).delete()
if not self._active:
self._label = cached.Label(text = self._text, multiline=False,
batch=self._batch, group=self._fg_group,
anchor_x='left', anchor_y='top')
else:
doc = pyglet.text.document.UnformattedDocument(self._text or '')
self._layout = pyglet.text.layout.IncrementalTextLayout(
doc, 1, 1, multiline=False, batch=self._batch, group=self._fg_group)
self._layout.anchor_x = 'left'
self._layout.anchor_y = 'top'
self._caret = pyglet.text.caret.Caret(self._layout)
self._deleted = False
self._update_style()
self._update_state()
self._update_size()
示例7: _build
# 需要导入模块: from widget import Widget [as 别名]
# 或者: from widget.Widget import _build [as 别名]
def _build(self, batch=None, group=None):
Widget._build(self, batch) # , group)
if self._label:
self._label.delete()
self._label = None
if self._layout:
self._layout.delete()
self._layout = None
if self._caret:
self._caret.delete()
self._caret = None
# Dummy layout creation and deletion seems to make rendering faster
doc = pyglet.text.document.UnformattedDocument("dummy")
pyglet.text.layout.IncrementalTextLayout(doc, 1, 1, batch=self._batch).delete()
if not self._active:
self._label = cached.Label(
text=self._text,
multiline=False,
batch=self._batch,
group=self._fg_group,
anchor_x="left",
anchor_y="top",
)
else:
doc = pyglet.text.document.UnformattedDocument(self._text or " ")
self._layout = pyglet.text.layout.IncrementalTextLayout(
doc, 1, 1, multiline=False, batch=self._batch, group=self._fg_group
)
self._layout.anchor_x = "left"
self._layout.anchor_y = "top"
self._caret = pyglet.text.caret.Caret(self._layout)
self._deleted = False
self._update_style()
self._update_state()
self._update_size()