开发者

How to center text in Gtk.Entry?

开发者 https://www.devze.com 2023-04-01 06:21 出处:网络
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 clipboa

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
0

精彩评论

暂无评论...
验证码 换一张
取 消