Exemplo n.º 1
0
    def __init__(self, text, name, entries, tooltip=''):
        Option.__init__(self, text, name, tooltip=tooltip)

        self.combo = CustomComboBoxEntry(Gtk.ComboBox.new_with_entry())
        self.combo.set_entries(entries)

        self.pack_start(self.combo.combo_box, False, False, 0)
Exemplo n.º 2
0
    def __init__(self, text, name, entries):
        Option.__init__(self, text, name)

        self.combo = CustomComboBoxEntry(gtk.ComboBoxEntry())
        self.combo.set_entries(entries)

        self.pack_start(self.combo.combo_box, False)
Exemplo n.º 3
0
    def __init__(self, main_frame):
        dialog = main_frame.builder.get_object('new_entry_dialog')
        self.dialog = dialog
        dialog.set_transient_for(main_frame.main_frame)

        self.main_frame = main_frame
        self.journal = self.main_frame.journal
        self.categories_combo_box = CustomComboBoxEntry(
            main_frame.builder.get_object('categories_combo_box'))
        self.new_entry_combo_box = CustomComboBoxEntry(
            main_frame.builder.get_object('entry_combo_box'))

        # Let the user finish a new category entry by hitting ENTER
        def respond(widget):
            if self._text_entered():
                self.dialog.response(Gtk.ResponseType.OK)

        self.new_entry_combo_box.entry.connect('activate', respond)
        self.categories_combo_box.entry.connect('activate', respond)

        self.categories_combo_box.combo_box.connect('changed',
                                                    self.on_category_changed)