gtk.gdk.Window is a rectangular region on the screen. It's a low-level object, used to implement high-level objects such as gtk.Widget and gtk.Window. Agtk.Window is a toplevel window, the object a user might think of as a "window" with a titlebar and so on. A gtk.Window may contain several gtk.gdk.Windowobjects since most widgets use a gtk.gdk.Window.
A gtk.gdk.Window object interacts with the native window system for input and events. Some gtk.Widget objects do not have an associated gtk.gdk.Window and therefore cannot receive events. To receive events on behalf of these "windowless" widgets a gtk.EventBox must be used.
http://www.pygtk.org/pygtk2reference/class-gdkwindow.html
Widgets Without Windows
The following widgets do not have an associated gtk.gdk.window. If you want to capture events, you'll have to use the EventBox. See the section on the EventBox widget.
gtk.Alignment gtk.Arrow gtk.Bin gtk.Box gtk.Button gtk.CheckButton gtk.Fixed gtk.Image gtk.Label gtk.MenuItem gtk.Notebook gtk.Paned gtk.RadioButton gtk.Range gtk.ScrolledWindow gtk.Separator gtk.Table gtk.Toolbar gtk.AspectFrame gtk.Frame gtk.VBox gtk.HBox gtk.VSeparator gtk.HSeparatorhttp://www.pygtk.org/pygtk2tutorial/sec-WidgetsWithoutWindows.html
本文介绍了 GTK 中的 gdk.Window 和 gtk.Window 的概念及其区别。gdk.Window 是屏幕上的矩形区域,用于实现 gtk.Widget 和 gtk.Window 等高级对象。而 gtk.Window 则是顶层窗口,即用户通常所指的“窗口”。此外,文章还列举了一些没有 gdk.Window 的 GTK 组件,并说明了如何使用 EventBox 来为这些组件捕获事件。

6292

被折叠的 条评论
为什么被折叠?



