当前位置: 首页>>代码示例>>Python>>正文


Python Widget._build方法代码示例

本文整理汇总了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()
开发者ID:obspy,项目名称:branches,代码行数:12,代码来源:label.py

示例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()
开发者ID:obspy,项目名称:branches,代码行数:12,代码来源:container.py

示例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()
开发者ID:Merfie,项目名称:Space-Train,代码行数:20,代码来源:container.py

示例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()
开发者ID:Merfie,项目名称:Space-Train,代码行数:21,代码来源:label.py

示例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()
开发者ID:obspy,项目名称:branches,代码行数:21,代码来源:folder.py

示例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()
开发者ID:Merfie,项目名称:Space-Train,代码行数:41,代码来源:entry.py

示例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()
开发者ID:obspy,项目名称:branches,代码行数:38,代码来源:entry.py


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