How to left align a Gtk Label when its width is set by GtkSizeGroup

你说的曾经没有我的故事 提交于 2019-12-05 21:38:36

I dont know if it makes a difference, however it's worth a try:

Did you try to use gtk_label_set_xalign (label1, 0.0) instead of gtk_widget_set_halign (label1, GTK_ALIGN_START) ?

This was indeed a unfinished feature: Before GTK+ 3.16 the most simple solution was still to use gtk_misc_set_alignment (GTK_MISC (label1), 0.0, 0.5); even though it was deprecated.

As Alex mentions in the other answer gtk_label_set_xalign (label1, 0.0) is a good solution in modern GTK+ (>= 3.16).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!