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


Python Viewer.__init__方法代码示例

本文整理汇总了Python中pyglet_gui.core.Viewer.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Viewer.__init__方法的具体用法?Python Viewer.__init__怎么用?Python Viewer.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyglet_gui.core.Viewer的用法示例。


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

示例1: __init__

# 需要导入模块: from pyglet_gui.core import Viewer [as 别名]
# 或者: from pyglet_gui.core.Viewer import __init__ [as 别名]
    def __init__(self, label="", is_pressed=False, on_press=None):
        TwoStateController.__init__(self, is_pressed=is_pressed, on_press=on_press)
        Viewer.__init__(self)

        self.label = label

        # graphics
        self._label = None
        self._button = None
开发者ID:eggfu,项目名称:pyglet-gui,代码行数:11,代码来源:buttons.py

示例2: __init__

# 需要导入模块: from pyglet_gui.core import Viewer [as 别名]
# 或者: from pyglet_gui.core.Viewer import __init__ [as 别名]
    def __init__(self, label="", is_pressed=False, on_press=None):
        TwoStateController.__init__(self, is_pressed=is_pressed, on_press=on_press)
        Viewer.__init__(self)
        if isinstance(label, str):
            self._document = pyglet.text.document.UnformattedDocument(label)
        else:
            self._document = label

        # graphics
        self._label = None
        self._button = None
开发者ID:Norberg,项目名称:pyglet-gui,代码行数:13,代码来源:buttons.py

示例3: __init__

# 需要导入模块: from pyglet_gui.core import Viewer [as 别名]
# 或者: from pyglet_gui.core.Viewer import __init__ [as 别名]
 def __init__(self, text="", bold=False, italic=False,
              font_name=None, font_size=None, color=None, path=None):
     Viewer.__init__(self)
     self.text = text
     self.bold = bold
     self.italic = italic
     self.font_name = font_name
     self.font_size = font_size
     self.color = color
     self.path = path
     self.label = None
开发者ID:JStation,项目名称:omphalos,代码行数:13,代码来源:gui.py

示例4: __init__

# 需要导入模块: from pyglet_gui.core import Viewer [as 别名]
# 或者: from pyglet_gui.core.Viewer import __init__ [as 别名]
    def __init__(self, document, width=0, height=0, is_fixed_size=False):
        Viewer.__init__(self, width, height)
        Controller.__init__(self)

        self.max_height = height
        if isinstance(document, str):
            self._document = pyglet.text.document.UnformattedDocument(document)
        else:
            self._document = document
        self._content = None
        self.content_width = width
        self._scrollbar = None
        self.set_document_style = False
        self.is_fixed_size = is_fixed_size
开发者ID:eggfu,项目名称:pyglet-gui,代码行数:16,代码来源:document.py

示例5: __init__

# 需要导入模块: from pyglet_gui.core import Viewer [as 别名]
# 或者: from pyglet_gui.core.Viewer import __init__ [as 别名]
    def __init__(self, value=0.0, min_value=0.0, max_value=1.0, on_set=None, steps=None, width=0, height=0):
        ContinuousStateController.__init__(self, value=value,
                                           min_value=min_value,
                                           max_value=max_value,
                                           on_set=on_set)
        Viewer.__init__(self, width, height)

        self._bar = None    # a bar where the knob slides.
        self._knob = None   # the knob that moves along the bar.
        self._offset = (0, 0)  # offset of the knob image to its central position
        self._padding = (0, 0, 0, 0)  # padding of the bar image to its central position

        self.steps = steps
        self._markers = []  # markers in case of discrete steps.
        self._step_offset = (0, 0)
开发者ID:eggfu,项目名称:pyglet-gui,代码行数:17,代码来源:sliders.py

示例6: __init__

# 需要导入模块: from pyglet_gui.core import Viewer [as 别名]
# 或者: from pyglet_gui.core.Viewer import __init__ [as 别名]
    def __init__(self, text="", length=20, max_length=None, padding=0, on_input=None):
        Viewer.__init__(self)
        FocusMixin.__init__(self)

        self._document = pyglet.text.document.UnformattedDocument(text)
        self._document_style_set = False  # check if style of document was set.

        self._length = length  # the length of the box in characters
        self._max_length = max_length  # the max length allowed for writing.
        self._on_input = on_input

        self._padding = 4 + padding

        # graphics loaded in both states
        self._field = None

        # graphics loaded in state "writing"
        self._text_layout = None
        self._caret = None

        # graphics loaded in state "label"
        self._label = None
开发者ID:Norberg,项目名称:pyglet-gui,代码行数:24,代码来源:text_input.py

示例7: __init__

# 需要导入模块: from pyglet_gui.core import Viewer [as 别名]
# 或者: from pyglet_gui.core.Viewer import __init__ [as 别名]
 def __init__(self):
     Viewer.__init__(self)
     Controller.__init__(self)
     self._highlight = None
     self._highlight_flag = False
开发者ID:JStation,项目名称:omphalos,代码行数:7,代码来源:mixins.py

示例8: __init__

# 需要导入模块: from pyglet_gui.core import Viewer [as 别名]
# 或者: from pyglet_gui.core.Viewer import __init__ [as 别名]
 def __init__(self, min_width=0, min_height=0):
     Viewer.__init__(self)
     self._min_width, self._min_height = min_width, min_height
开发者ID:Norberg,项目名称:pyglet-gui,代码行数:5,代码来源:containers.py


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