如何在中间设置一个输入框并填充按钮之间的标题栏

How can I set an entrybox in the middle and filling the titlebar between buttons

我想做一个简单的网络浏览器。为此,我需要将输入框放在我的 header 栏的中间并填充 holse space。

输入框位于栏的中间,但未填充按钮之间的 space。

gtk_header_bar_set_custom_title(GTK_HEADER(w->header), w->entry);

问题是我左边有两个按钮,右边有 3 个按钮。输入框位于孔栏的中间,但未填充按钮之间的空间。我也不知道是否有其他功能,或者我是否使用了错误的功能。

但是,由于这个错误,这可能不适用于旧的 GTK+-3 版本:https://bugzilla.gnome.org/show_bug.cgi?id=724332

但还是试试这个: gtk_widget_set_hexpand(w->条目,真);