Re: GtkComboBox signals
On Sun, 2015-10-25 at 18:35 +0100, Pekka Riikonen wrote: > second one with "changed" signal on the combobox isn't because the > signal > is emitted also when typing into the entry. It effectively becomes > impossible to determine whether item was typed in or selected from the > list. OK, no answer from experts yet. I can remember that I used this Ruby code for that task: @changed_handler_id = self.signal_connect('changed') {|w| if @pda if w.active != -1 i = w.active_text.to_i if i != (@major ? @pda.schem.major_grid : @pda.schem.minor_grid) if @major then @pda.schem.major_grid = i else @pda.schem.minor_grid = i end @pda.schem.active_grid = i if radio_button.active? @pda.redraw end end end } So active property of https://developer.gnome.org/gtk3/stable/GtkComboBox.html#GtkComboBox--active can be used to detect if an item was selected from list. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
GtkComboBox signals
I'm trying to work out a seemingly trivial use case with combo box with an entry. I want to receive signal only in two cases: 1. When user types something into the entry and then presses Enter key. 2. When user selects something from the combo box with a mouse. The first one is simple, it's the "activate" signal on the entry but the second one with "changed" signal on the combobox isn't because the signal is emitted also when typing into the entry. It effectively becomes impossible to determine whether item was typed in or selected from the list. And if user typed it in I only want the signal when Enter key was pressed. But if user clicked on the item with a mouse I want the signal. If only combobox would emit the "activate" signal for the entry when item is selected from the list. Any way to get this working? Pekka ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
GtkComboBox signals
I'm trying to work out a seemingly trivial use case with combo box with an entry. I want to receive signal only in two cases: 1. When user types something into the entry and then presses Enter key. 2. When user selects something from the combo box with a mouse. The first one is simple, it's the "activate" signal on the entry but the second one with "changed" signal on the combobox isn't because the signal is emitted also when typing into the entry. It effectively becomes impossible to determine whether item was typed in or selected from the list. And if user typed it in I only want the signal when Enter key was pressed. But if user clicked on the item with a mouse I want the signal. If only combobox would emit the "activate" signal for the entry when item is selected from the list. Any way to get this working? Pekka ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list