Package org.gnome.gtk
Interface ComboBox.FormatEntryTextCallback
- All Superinterfaces:
FunctionPointer
- Enclosing class:
ComboBox
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public static interface ComboBox.FormatEntryTextCallback
extends FunctionPointer
Functional interface declaration of the
FormatEntryTextCallback
callback.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionEmitted to allow changing how the text in a combo box's entry is displayed.default MemorySegment
toCallback
(Arena arena) Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)
method.default MemorySegment
upcall
(MemorySegment sourceComboBox, MemorySegment path) Theupcall
method is called from native code.
-
Method Details
-
run
Emitted to allow changing how the text in a combo box's entry is displayed.See
Gtk.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 theGtk.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); }
-
upcall
Theupcall
method is called from native code. The parameters are marshaled andrun(java.lang.String)
is executed. -
toCallback
Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)
method.- Specified by:
toCallback
in interfaceFunctionPointer
- Parameters:
arena
- the function pointer will be allocated in this arena- Returns:
- the native function pointer
-