Hi guys,
Is there a way to set first let’s say 5 characters of an Entry widget and set them as non-editable as in not selectable or editable ?
Thanks,
Hi guys,
Is there a way to set first let’s say 5 characters of an Entry widget and set them as non-editable as in not selectable or editable ?
Thanks,
Look into GtkTextTag:editable
, and setting that to FALSE
on the region in your GtkTextBuffer
that should be locked.
Not for GtkEntry; you also did not specify whether you’re using GTK4 or GTK3.
You could try to connect to delete signal and cancel deletion of letters. This is for gtk3
Gtk.Editable::delete-text
This signal is emitted when text is deleted from the widget by the user. The default handler for this signal will normally be responsible for deleting the text, so by connecting to this signal and then stopping the signal with g_signal_stop_emission(), it is possible to modify the range of deleted text, or prevent it from being deleted entirely. The
start_pos
andend_pos
parameters are interpreted as for gtk_editable_delete_text().
GTK4 have same signal Editable::delete-text
It’s GTK3, I figured out the issue thanks to your comments and guides!
What solution did you pick in the end? In case anyone finds this searching later and it can help them
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.