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.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]