How to center text in Gtk.Entry?
I am trying to use an Gtk.Entry to show some text that is centered in a dialog. The entry is not editable. I would use a Gtk.Label, however I need to be able to select and copy the text to the clipboard. Do I need to modify the Gtk.RcStyle? If so is there some example code 开发者_如何学Cfor that?
Go ahead and use a Gtk.Label
, and set the Selectable
property to true.
Use xalign
property for centring text:
entry = Gtk.Entry()
entry.props.xalign = 0.5
精彩评论