當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。