Я хотел бы показать Gtk.Dialog
, определенный в файле Glade несколько раз.
В настоящее время я могу сделать это с помощью пользовательской кнопки для вызова метода hide()
диалогового окна, но, еслипользователь использует Alt + F4 , чтобы закрыть диалоговое окно, оно открывается снова пустым:
И в консоли я вижу несколько ошибок:
(main.py:29152): Gtk-CRITICAL **: 15:28:29.637: gtk_container_foreach: assertion 'GTK_IS_CONTAINER (container)' failed
(main.py:29152): Gtk-CRITICAL **: 15:28:29.651: _gtk_container_get_border_width_set: assertion 'GTK_IS_CONTAINER (container)' failed
(main.py:29152): Gtk-CRITICAL **: 15:28:29.651: gtk_container_set_border_width: assertion 'GTK_IS_CONTAINER (container)' failed
(main.py:29152): Gtk-CRITICAL **: 15:28:29.651: _gtk_container_set_border_width_set: assertion 'GTK_IS_CONTAINER (container)' failed
(main.py:29152): Gtk-CRITICAL **: 15:28:29.651: _gtk_box_get_spacing_set: assertion 'GTK_IS_BOX (box)' failed
(main.py:29152): Gtk-CRITICAL **: 15:28:29.651: gtk_box_set_spacing: assertion 'GTK_IS_BOX (box)' failed
(main.py:29152): Gtk-CRITICAL **: 15:28:29.651: _gtk_box_set_spacing_set: assertion 'GTK_IS_BOX (box)' failed
(main.py:29152): Gtk-CRITICAL **: 15:28:29.651: gtk_button_box_get_layout: assertion 'GTK_IS_BUTTON_BOX (widget)' failed
(main.py:29152): Gtk-CRITICAL **: 15:28:29.651: gtk_box_set_spacing: assertion 'GTK_IS_BOX (box)' failed
(main.py:29152): Gtk-CRITICAL **: 15:28:29.651: _gtk_container_get_border_width_set: assertion 'GTK_IS_CONTAINER (container)' failed
(main.py:29152): Gtk-CRITICAL **: 15:28:29.651: gtk_container_set_border_width: assertion 'GTK_IS_CONTAINER (container)' failed
(main.py:29152): Gtk-CRITICAL **: 15:28:29.651: _gtk_container_set_border_width_set: assertion 'GTK_IS_CONTAINER (container)' failed
(main.py:29152): Gtk-CRITICAL **: 15:28:29.697: _gtk_container_get_border_width_set: assertion 'GTK_IS_CONTAINER (container)' failed
(main.py:29152): Gtk-CRITICAL **: 15:28:29.697: gtk_container_set_border_width: assertion 'GTK_IS_CONTAINER (container)' failed
(main.py:29152): Gtk-CRITICAL **: 15:28:29.697: _gtk_container_set_border_width_set: assertion 'GTK_IS_CONTAINER (container)' failed
(main.py:29152): Gtk-CRITICAL **: 15:28:29.697: _gtk_box_get_spacing_set: assertion 'GTK_IS_BOX (box)' failed
(main.py:29152): Gtk-CRITICAL **: 15:28:29.697: gtk_box_set_spacing: assertion 'GTK_IS_BOX (box)' failed
(main.py:29152): Gtk-CRITICAL **: 15:28:29.697: _gtk_box_set_spacing_set: assertion 'GTK_IS_BOX (box)' failed
(main.py:29152): Gtk-CRITICAL **: 15:28:29.697: gtk_button_box_get_layout: assertion 'GTK_IS_BUTTON_BOX (widget)' failed
(main.py:29152): Gtk-CRITICAL **: 15:28:29.697: gtk_box_set_spacing: assertion 'GTK_IS_BOX (box)' failed
(main.py:29152): Gtk-CRITICAL **: 15:28:29.697: _gtk_container_get_border_width_set: assertion 'GTK_IS_CONTAINER (container)' failed
(main.py:29152): Gtk-CRITICAL **: 15:28:29.697: gtk_container_set_border_width: assertion 'GTK_IS_CONTAINER (container)' failed
(main.py:29152): Gtk-CRITICAL **: 15:28:29.697: _gtk_container_set_border_width_set: assertion 'GTK_IS_CONTAINER (container)' failed
(main.py:29152): Gtk-CRITICAL **: 15:28:31.141: _gtk_container_get_border_width_set: assertion 'GTK_IS_CONTAINER (container)' failed
(main.py:29152): Gtk-CRITICAL **: 15:28:31.141: gtk_container_set_border_width: assertion 'GTK_IS_CONTAINER (container)' failed
(main.py:29152): Gtk-CRITICAL **: 15:28:31.141: _gtk_container_set_border_width_set: assertion 'GTK_IS_CONTAINER (container)' failed
(main.py:29152): Gtk-CRITICAL **: 15:28:31.141: _gtk_box_get_spacing_set: assertion 'GTK_IS_BOX (box)' failed
(main.py:29152): Gtk-CRITICAL **: 15:28:31.141: gtk_box_set_spacing: assertion 'GTK_IS_BOX (box)' failed
(main.py:29152): Gtk-CRITICAL **: 15:28:31.141: _gtk_box_set_spacing_set: assertion 'GTK_IS_BOX (box)' failed
(main.py:29152): Gtk-CRITICAL **: 15:28:31.141: gtk_button_box_get_layout: assertion 'GTK_IS_BUTTON_BOX (widget)' failed
(main.py:29152): Gtk-CRITICAL **: 15:28:31.141: gtk_box_set_spacing: assertion 'GTK_IS_BOX (box)' failed
(main.py:29152): Gtk-CRITICAL **: 15:28:31.141: _gtk_container_get_border_width_set: assertion 'GTK_IS_CONTAINER (container)' failed
(main.py:29152): Gtk-CRITICAL **: 15:28:31.141: gtk_container_set_border_width: assertion 'GTK_IS_CONTAINER (container)' failed
(main.py:29152): Gtk-CRITICAL **: 15:28:31.141: _gtk_container_set_border_width_set: assertion 'GTK_IS_CONTAINER (container)' failed
Я получаю экземпляр диалога с обычным get_object()
:
self.__settings_dialog : Gtk.Dialog = self.__builder.get_object("settings_dialog")
, а затем просто вызываю show()
и hide()
.Но после закрытия с помощью Alt + F4 я не могу показать его снова.