Python Gtk警告**:使用标题栏将内容添加到对话框的操作区域
在Python Gtk警告**:使用标题栏将内容添加到对话框的操作区域,python,gtk,gtk3,pygobject,Python,Gtk,Gtk3,Pygobject,在Gtk.Stack中添加自定义Gtk.Box时,会出现此警告 class MainWindow(Gtk.ApplicationWindow): """ Class that inherits of Gtk.ApplicationWindow and that represents the main window application """ def __init__(self, app): super().__init__(applicat
Gtk.Stack
中添加自定义Gtk.Box
时,会出现此警告
class MainWindow(Gtk.ApplicationWindow):
"""
Class that inherits of Gtk.ApplicationWindow and that represents the main window application
"""
def __init__(self, app):
super().__init__(application=app)
self.builder = Gtk.Builder.new_from_file(UIS_PATH + 'main_window.xml')
self.set_titlebar(self.builder.get_object('mw_headerbar'))
self.add(self.builder.get_object('mw_main_vbox'))
stack = self.builder.get_object('mw_main_stack')
stack.add_titled(PersonsFom(self), 'persons_form', 'Gestão de Pessoas')
sidebar = Gtk.StackSidebar()
sidebar.set_stack(stack)
sidebar.set_size_request(200, -1)
mw_main_hbox = self.builder.get_object('mw_main_hbox')
mw_main_hbox .pack_start(sidebar, expand=False, fill=True, padding=0)
mw_main_hbox.reorder_child(sidebar, 0)
当执行流为linestack时,会出现警告。添加标题为(PersonsFom(self),“persons\u form”,“Gestão de Pessoas”)
PersonForm
是Gtk.Box
的一个子类,包含多个组件,如按钮
,框
,网格
,条目
。。。
我不明白你这个警告是什么意思
main窗口
类已使用glade文件构建,而PersonsForm
已创建。
我也将离开人员窗体
git。显示你的glade文件。@andlabs EditedFTR,在升级系统之前,我从Arch repos收到了与glade相同的错误(还有其他错误,窗口没有出现)。你确定该消息会与该代码一起显示吗?因为查看您的存储库时,我会看到一个
图像\u选择器\u对话框
。。。我不知道还有什么能给对话添加内容是的!这是显示。但是,如果我使用python代码创建Gtk.HeaderBar
,并删除glade文件中的HeaderBar
,则不会显示错误。抱歉耽搁了。