gtk.gdk.Window

本文介绍了 GTK 中的 gdk.Window 和 gtk.Window 的概念及其区别。gdk.Window 是屏幕上的矩形区域,用于实现 gtk.Widget 和 gtk.Window 等高级对象。而 gtk.Window 则是顶层窗口,即用户通常所指的“窗口”。此外,文章还列举了一些没有 gdk.Window 的 GTK 组件,并说明了如何使用 EventBox 来为这些组件捕获事件。

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.

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.HSeparator
http://www.pygtk.org/pygtk2tutorial/sec-WidgetsWithoutWindows.html
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值