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


Python Charset.to_gui方法代码示例

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


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

示例1: createPlayerLine

# 需要导入模块: import Charset [as 别名]
# 或者: from Charset import to_gui [as 别名]
    def createPlayerLine(self, hbox, site, player):
        log.debug('add:"%s"' % player)
        label = gtk.Label(site + " id:")
        hbox.pack_start(label, False, False, 3)

        pname = gtk.Entry()
        pname.set_text(player)
        pname.set_width_chars(20)
        hbox.pack_start(pname, False, True, 0)
        pname.connect("changed", self.__set_hero_name, site)

        # Added EntryCompletion but maybe comboBoxEntry is more flexible? (e.g. multiple choices)
        completion = gtk.EntryCompletion()
        pname.set_completion(completion)
        liststore = gtk.ListStore(gobject.TYPE_STRING)
        completion.set_model(liststore)
        completion.set_text_column(0)
        names = self.db.get_player_names(
            self.conf, self.siteid[site]
        )  # (config=self.conf, site_id=None, like_player_name="%")
        for n in names:  # list of single-element "tuples"
            _n = Charset.to_gui(n[0])
            _nt = (_n,)
            liststore.append(_nt)

        self.__set_hero_name(pname, site)
开发者ID:sigmike,项目名称:fpdb,代码行数:28,代码来源:Filters.py

示例2: fillPlayerFrame

# 需要导入模块: import Charset [as 别名]
# 或者: from Charset import to_gui [as 别名]
    def fillPlayerFrame(self, vbox, display):
        top_hbox = gtk.HBox(False, 0)
        vbox.pack_start(top_hbox, False, False, 0)
        lbl_title = gtk.Label(self.filterText['playerstitle'])
        lbl_title.set_alignment(xalign=0.0, yalign=0.5)
        top_hbox.pack_start(lbl_title, expand=True, padding=3)
        showb = gtk.Button(label=_("Refresh"), stock=None, use_underline=True)
        showb.set_alignment(xalign=1.0, yalign=0.5)
        showb.connect('clicked', self.__refresh, 'players')

        vbox1 = gtk.VBox(False, 0)
        vbox.pack_start(vbox1, False, False, 0)
        self.boxes['players'] = vbox1

        for site in self.conf.get_supported_sites():
            hBox = gtk.HBox(False, 0)
            vbox1.pack_start(hBox, False, True, 0)

            player = self.conf.supported_sites[site].screen_name
            _pname = Charset.to_gui(player)
            self.createPlayerLine(hBox, site, _pname)

        if "GroupsAll" in display and display["GroupsAll"] == True:
            hbox = gtk.HBox(False, 0)
            vbox1.pack_start(hbox, False, False, 0)
            cb = gtk.CheckButton(self.filterText['groupsall'])
            cb.connect('clicked', self.__set_group_select, 'allplayers')
            hbox.pack_start(cb, False, False, 0)
            self.sbGroups['allplayers'] = cb
            self.groups['allplayers'] = False

            lbl = gtk.Label(_('Min # Hands:'))
            lbl.set_alignment(xalign=1.0, yalign=0.5)
            hbox.pack_start(lbl, expand=True, padding=3)

            phands = gtk.Entry()
            phands.set_text('0')
            phands.set_width_chars(8)
            hbox.pack_start(phands, False, False, 0)
            phands.connect("changed", self.__set_num_hands, site)
        top_hbox.pack_start(showb, expand=False, padding=1)
开发者ID:kangaderoo,项目名称:fpdb-kangaderoo,代码行数:43,代码来源:Filters.py


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