ComboBox.connectFormatEntryText

Connect to FormatEntryText signal.

Emitted to allow changing how the text in a combo box's entry is displayed.

See propertyGtk.ComboBox:has-entry.

Connect a signal handler which returns an allocated string representing path. That string will then be used to set the text in the combo box's entry. The default signal handler uses the text from the propertyGtk.ComboBox:entry-text-column model column.

Here's an example signal handler which fetches data from the model and displays it in the entry.

static char *
format_entry_text_callback (GtkComboBox *combo,
                            const char *path,
                            gpointer     user_data)
{
  GtkTreeIter iter;
  GtkTreeModel model;
  double       value;

  model = gtk_combo_box_get_model (combo);

  gtk_tree_model_get_iter_from_string (model, &iter, path);
  gtk_tree_model_get (model, &iter,
                      THE_DOUBLE_VALUE_COLUMN, &value,
                      -1);

  return g_strdup_printf ("%g", value);
}
class ComboBox
ulong
connectFormatEntryText
(
T
)
(,
Flag!"After" after = No.After
)
if (
isCallable!T &&
is(ReturnType!T == string)
&&
(
Parameters!T.length < 1 ||
(
ParameterStorageClassTuple!T[0] == ParameterStorageClass.none &&
is(Parameters!T[0] == string)
)
)
&&
(
Parameters!T.length < 2 ||
(
ParameterStorageClassTuple!T[1] == ParameterStorageClass.none &&
is(Parameters!T[1] : gtk.combo_box.ComboBox)
)
)
&&
Parameters!T.length < 3
)

Parameters

callback T

signal callback delegate or function to connect

string callback(string path, gtk.combo_box.ComboBox comboBox)

path the gtk.tree_path.TreePath string from the combo box's current model to format text for (optional)

comboBox the instance the signal is connected to (optional)

Returns a newly allocated string representing path for the current gtk.combo_box.ComboBox model.

after Flag!"After"

Yes.After to execute callback after default handler, No.After to execute before (default)

Return Value

Type: ulong

Signal ID