[英]Remove the size request of a widget (Python, Gtk3)
I want to fit some text in a label. 我想在标签中放入一些文字。 I almost managed to do it: when I enlarge the window, I add some
<big>
tags to the label and the text enlarges with the window. 我几乎设法做到了:当我放大窗口时,我在标签上添加了一些
<big>
标签,文本随窗口一起放大。 But if I try to shrink the window, the size-request of the label doesn't let me do it. 但是,如果我试图缩小窗口,标签的大小请求不允许我这样做。
The label is updated many times a second, so if I try to set a custom size request every time I apply a new label, the window will shrink and enlarge if i try to shrink it. 标签每秒更新很多次,因此如果我每次应用新标签时都尝试设置自定义尺寸请求,那么如果我尝试缩小它,窗口将缩小并放大。
What I want to do is removing the size request, without word wrapping and other things like this: I just want let the label go out of the window. 我想要做的是删除大小请求,没有自动换行和其他类似的事情:我只是想让标签走出窗外。
将标签放在像GtkScrolledWindow这样的容器中。
将label的“ellipsize”属性设置为True。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.