GtkAboutDialog关闭按钮错误 [英] GtkAboutDialog Close Button Bug
问题描述
我使用GtkAboutDialog,除了这个小部件的关闭按钮外,一切正常。所有其他按钮工作正常,我不知道如何,但所有按钮都有默认回调,他们创建和销毁窗口。
但是GtkAboutDialog小部件的关闭按钮不起作用。我什至不能看到它的小部件。所以,我可以访问它吗?
[CLARIFICATION]你正在看的是gtk.AboutDialog - 弹出窗口显示应用程序的相关信息(PyGTK 2.6中的新增功能)。此窗口包含GtkHButtonBox小部件中包含的'close'按钮小部件。 GtkHButtonBox小部件是我能够访问的最高级别小部件。任何有关如何进入关闭按钮并连接处理程序以获取回调信号的想法?
像对待窗口一样进行对话。学习PyGTK时犯了同样的错误。
对话框的最基本形式是显示并运行对话框:
aboutdialog.run()
然后立即调用:
aboutdialog.destroy()
.run()行是一个循环,它会一直运行,直到在对话框中发生某种事情。
在这里示例。
I use GtkAboutDialog and everything works fine except the close button of this widget. All other buttons works fine, I don't know how but all buttons have default callbacks and they create and destroy the windows. But the "Close" button of GtkAboutDialog widget does not work. I can not even see it's widget. So, can I access it?
[CLARIFICATION] What you're looking at is gtk.AboutDialog — popup window displaying information about an application (new in PyGTK 2.6). This window contains the 'close' button widget which is contained in a GtkHButtonBox widget. The GtkHButtonBox widget is the highest level widget I am able to access for some. Any ideas on how to get to the "close" button and connect a handler for a callback signal?
You don't conenct signals in the same way for a dialog as you do for a window. I made the same mistake when learning PyGTK.
The most basic form of a dialog is you display and run the dialog with:
aboutdialog.run()
Often you will then immediately call:
aboutdialog.destroy()
The .run() line is a loop, which runs until something happens within the dialog.
There is a working example here.
这篇关于GtkAboutDialog关闭按钮错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!