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


Python Widget.setdata方法代码示例

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


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

示例1: setcolor

# 需要导入模块: from widget import Widget [as 别名]
# 或者: from widget.Widget import setdata [as 别名]
 def setcolor(self, color_pair):
     """
     Set the curses color pair that should be used for drawing to the window.
     """
     Widget.setcolor(self, color_pair)
     # refresh the data when we change the color
     Widget.setdata(self, data)
开发者ID:msmiley,项目名称:pycurseslib,代码行数:9,代码来源:editbox.py

示例2: setdata

# 需要导入模块: from widget import Widget [as 别名]
# 或者: from widget.Widget import setdata [as 别名]
    def setdata(self, data):
        """
        Set the data for the EditBox.
        """
        self.__tb = curses.textpad.Textbox(self.__derwin)

        for ch in data.ljust(self.cols):
            self.__tb.do_command(ch)

        self.__tb.do_command(ord(curses.ascii.ctrl('a')))
        Widget.setdata(self, data)
开发者ID:msmiley,项目名称:pycurseslib,代码行数:13,代码来源:editbox.py

示例3: setdata

# 需要导入模块: from widget import Widget [as 别名]
# 或者: from widget.Widget import setdata [as 别名]
    def setdata(self, data):
        """
        Update the ListBox data with the given data set.
        """
        Widget.setdata(self, data)

        # the pad is sized -1 instead of -2 (for borders) because to fill in
        # the appropriate color we need an extra column
        self.__listwin = curses.newpad(len(data), self.cols-1)
        for idx, data in enumerate(self.data):
            self.__listwin.addnstr(idx, 0, data.ljust(self.cols-2), self.cols-2, curses.color_pair(self.color_pair))

        self.refresh()
开发者ID:msmiley,项目名称:pycurseslib,代码行数:15,代码来源:listbox.py

示例4: setdata

# 需要导入模块: from widget import Widget [as 别名]
# 或者: from widget.Widget import setdata [as 别名]
 def setdata(self, data):
     # save the horizontal size needed in the cols variable
     self.cols = len(data) + 3
     Widget.setdata(self, data)
     self.refresh()
开发者ID:msmiley,项目名称:pycurseslib,代码行数:7,代码来源:button.py


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