隐藏后 GtkInfoBar 不再显示

GtkInfoBar doesn't show again after hide

我隐藏了 Gtk 小部件,然后尝试显示它,但是方法 "show()"、"show_all()" 或 "show_now()" 中的 none 不起作用。如果不调用 "hide()" 小部件显示。

python 3.5.2
gtk3 3.20.8
pygobject-devel 3.20.1

test.py:

import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk

builder = Gtk.Builder()
builder.add_from_file("gui.glade")
infoBar = builder.get_object("infoBar")
window = builder.get_object("window")
window.show_all()

infoBar.hide()

infoBar.show()

Gtk.main()

gui.glade: http://pastebin.com/xKFt1v84

This is a long-standing bug in GTK+ specific to GtkInfoBar. Monitor the linked bug report for more details, some workarounds (including one in Python that you can use for the time being) and to find out when it's fixed for real.