lundi 6 mars 2023

How to disable GtkComboBoxText?

The solution mentioned here does not work, at least not in gtk+3.

Setting a Gtk::ComboBoxText to non editable

I am already using the following, which disables the button portion of the ComboBoxText, however the user could still able to type stuff in the internal Entry.

GtkWidget* widget = GTK_WIDGET(input);
if (GTK_IS_COMBO_BOX(widget)) {
  gtk_widget_set_sensitive(widget, false);
  // tried setting the child to sensitive false too
  // gtk_widget_set_sensitive(gtk_bin_get_child(GTK_BIN(widget)), false);
}

There isn't anything which would allow me to grab the underlaying Entry either... there doesn't seem to be any methods for me to archive what I need in gtk3. https://docs.gtk.org/gtk3/class.ComboBoxText.html

Any idea how I could disables the entire ComboBoxText? BOTH the entry + button.

Aucun commentaire:

Enregistrer un commentaire