I am trying to make a widget that contains short text output that the user should be able to copy, but not modify. This is what I came up with:
entry = gtk.Entry() entry.set_property("editable", False) entry.unset_flags(gtk.CAN_FOCUS)
It works, but the record still looks like it is editable, and it looks bad from the user's point of view. I tried entry.set_sensitive(False) instead, but this prevents copying and makes it completely disabled.
I would like to know how to make the correct read-only text entry that will be inaccessible but still active.
Edit: Here is an image of what I'm talking about, although not GTK (and I work in the GNOME environment).
Edit 2: it starts to look like there is no right way to do this with GTK, if someone can confirm this, I will try to resolve the issue.
source share