pygtk - What does it mean for a gtk widget to have its own window -


i trying learn pygtk , understand meaning of terms in documentation , tutorial.

according documentation

  1. a button object not have own window.
  2. widgets not receive events (widgets not have own window) not work tooltips.

so conclude tooltips not work buttons. seems wrong , example code below seems prove wrong. there don't understand meaning of terms? above statements incorrect? can explain missing here. method get_has_window() not answer same question whether tooltip work?

#!/usr/bin/env python  import pygtk pygtk.require('2.0') import gtk  class isbuttonnowindowwidget:     def sillycallback(self, widget, data):         print data         if widget.get_has_window():             print "which has window"         else:             print "which *not* have window"      def __init__(self):         # create dismissable top level         self.window = gtk.window(gtk.window_toplevel)         self.window.connect("destroy", lambda w: gtk.main_quit())          button = gtk.button("press me")         button.connect("clicked", self.sillycallback,                         "you have clicked button")         tooltips = gtk.tooltips()         # according pygtk documentation:         # widgets not receive events         # (widgets not have own window)         # *not* work tooltips.         tooltips.set_tip(button, "just press me, already!")         self.window.add(button)         button.show()         self.window.show()  def main():     gtk.main()     return 0  if __name__ == "__main__":     isbuttonnowindowwidget()     main() 


Comments

Popular posts from this blog

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -

python - Error while using APScheduler: 'NoneType' object has no attribute 'now' -