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


Python Clickable.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from thorpy.elements.clickable import Clickable [as 别名]
# 或者: from thorpy.elements.clickable.Clickable import __init__ [as 别名]
 def __init__(self,
              params,
              text="",
              title=None,
              click_cancel=False,
              text_ok="Ok",
              text_cancel="Cancel",
              paramsetter_elements=None):
     """params can either be a varset or a paramsetter.
     title can either be a string or an element."""
     if isinstance(params, ParamSetter):
         self.paramsetter = params
     else:
         self.paramsetter = ParamSetter(params, elements=paramsetter_elements)
         self.paramsetter.finish()
     self.click_cancel = click_cancel
     self.max_chars = float("inf")
     self.cut_text = ".."
     self.launcher = None
     e_title = _get_title(title)
     if e_title:
         elements = [e_title, self.paramsetter]
     else:
         elements = [self.paramsetter]
     box = launchmod.make_ok_cancel_box(elements, text_ok, text_cancel)
     self.launched = box
     Clickable.__init__(self, text)
开发者ID:YannThorimbert,项目名称:Thorpy-1.5.2a,代码行数:29,代码来源:paramsetterlauncher.py

示例2: __init__

# 需要导入模块: from thorpy.elements.clickable import Clickable [as 别名]
# 或者: from thorpy.elements.clickable.Clickable import __init__ [as 别名]
 def __init__(self):
     Clickable.__init__(self)
     reac_rightclick = Reaction(parameters.BUTTON_UNPRESS_EVENT,
                                self._reaction_rightpress,
                                {"button": parameters.RIGHT_CLICK_BUTTON},
                                name=constants.REAC_RIGHT_CLICK)
     self.add_reaction(reac_rightclick)
     self.normal_params.polite_set("painter size", (16, 16))
     self.press_params.polite_set("painter size", (16, 16))
开发者ID:YannThorimbert,项目名称:ThorPy-1.0,代码行数:11,代码来源:_shifters.py

示例3: __init__

# 需要导入模块: from thorpy.elements.clickable import Clickable [as 别名]
# 或者: from thorpy.elements.clickable.Clickable import __init__ [as 别名]
 def __init__(self,
              colorsetter,
              text="",
              show_select=True,
              click_cancel=False):
     self.text = text
     self.show_select = show_select
     self.click_cancel = click_cancel
     if not isinstance(colorsetter, ColorSetter):
         self.colorsetter = ColorSetter.make(self.text, value=colorsetter)
     else:
         self.colorsetter = colorsetter
     self.old_color = self.colorsetter.get_value()
     self.launched = launchmod.make_ok_cancel_box([self.colorsetter], "Ok", "Cancel") #!!! text
     self.launcher = None
     self.e_color = get_example_element(self.colorsetter.get_color(), (20,20))
     self.e_text = Element(self.text)
     self.e_text.set_style("text")
     self.e_text.finish()
     self.unlaunch_func = None
     Clickable.__init__(self, elements=[self.e_text, self.e_color])
开发者ID:YannThorimbert,项目名称:Thorpy-1.5.2a,代码行数:23,代码来源:colorsetterlauncher.py

示例4: __init__

# 需要导入模块: from thorpy.elements.clickable import Clickable [as 别名]
# 或者: from thorpy.elements.clickable.Clickable import __init__ [as 别名]
    def __init__(self,
                 browser,
                 const_text="",
                 var_text="",
                 show_select=True,
                 click_cancel=False,
                 text_ok="Ok",
                 text_cancel="Cancel"):
        self.recenter=True
        self.const_text = const_text
        self.var_text = var_text
        self.click_cancel = click_cancel
##        self.max_chars = float("inf")
        self.max_chars = 30
        self.cut_text = ".."
        self.show_select = show_select
        self.launcher = None
        self.unlaunch_func = None
        box = launchmod.make_ok_cancel_box([browser], text_ok, text_cancel)
        self.launched = box
        self.browser = browser
        Clickable.__init__(self, self.const_text+self.var_text)
开发者ID:YannThorimbert,项目名称:Thorpy-1.5.2a,代码行数:24,代码来源:browserlauncher.py


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