Python gtk 模块,STOCK_PREFERENCES 实例源码

我们从Python开源项目中,提取了以下3个代码示例,用于说明如何使用gtk.STOCK_PREFERENCES

项目:barbieri-playground    作者:barbieri    | 项目源码 | 文件源码
def setup_gui_url_chooser(self):
        self.media_model = gtk.ListStore(str)
        self.media_type = gtk.ComboBox(self.media_model)
        cell = gtk.CellRendererText()
        self.media_type.pack_start(cell, True)
        self.media_type.add_attribute(cell, "text", 0)

        for t in ("file", "dvd", "tv", "dvb", "vcd", "radio", "cdda", "tivo"):
            self.media_model.append((t,))

        self.media_location = gtk.Entry()
        self.media_server = gtk.Label()
        self.media_server.set_alignment(0, 0.5)

        d = catota.ui.Dialog("Choose Location", self.parent_win,
                             extra_buttons=(gtk.STOCK_PREFERENCES, 1))

        t = catota.ui.new_table((("Server:", self.media_server),
                                 ("Type:", self.media_type),
                                 ("Location:", self.media_location)))
        d.vbox.pack_start(t, True, True)

        self.gui_url_chooser = d
    # setup_gui_url_chooser()
项目:barbieri-playground    作者:barbieri    | 项目源码 | 文件源码
def _setup_actions(self):
        self._add_stock_action("Quit", stock=gtk.STOCK_QUIT)
        self._add_stock_action("Preferences", stock=gtk.STOCK_PREFERENCES)
        self._add_stock_action("Open", stock=gtk.STOCK_OPEN)
        self._add_stock_action("Play", stock=gtk.STOCK_MEDIA_PLAY)
        self._add_stock_action("Stop", stock=gtk.STOCK_MEDIA_STOP)


        act = gtk.ToggleAction("Pause", None, None, gtk.STOCK_MEDIA_PAUSE)
        self.action_group.add_action_with_accel(act, None)
        act.set_accel_group(self.accel_group)
        act.connect_accelerator()
        self.actions["Pause"] = act
    # _setup_actions()
项目:gimp-fanim    作者:douglasvini    | 项目源码 | 文件源码
def _setup_config(self):
        stock_size = gtk.ICON_SIZE_BUTTON
        config_bar = gtk.HBox()

        b_conf = Utils.button_stock(gtk.STOCK_PREFERENCES,stock_size)

        self.widgets_to_disable.append(b_conf)
        # connect
        b_conf.connect("clicked",self.on_config)

        # tooltips
        b_conf.set_tooltip_text("open configuration dialog")

        config_bar.pack_start(b_conf,False,False,0)
        return config_bar