Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9136521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:57:49+00:00 2026-06-17T08:57:49+00:00

In the pygtk reference it states that every Gtk.Widget has the event enter-event-notify ,

  • 0

In the pygtk reference it states that every Gtk.Widget has the event enter-event-notify, but with my test code that event is never fired for the Label widget (with others it has worked).

Is there something I should do differently?

import pygtk
pygtk.require('2.0')
import gtk

class LabelTest:

    def delete_event(self, widget, event, data=None):
        return False

    def destroy(self, widget, data=None):
        gtk.main_quit()

    def __init__(self):
        self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)

        self.window.connect("delete_event", self.delete_event)
        self.window.connect("destroy", self.destroy)
        self.window.set_border_width(10)

        self.label = gtk.Label("A label")

        # question section
        def labelMouseOver(w, data=None):
          print "mouse over"

        self.label.connect('enter-notify-event', labelMouseOver, None)
        # /question section

        self.window.add(self.label)
        self.label.show()
        self.window.show()

    def main(self):
        gtk.main()

if __name__ == "__main__":
    test = LabelTest()
    test.main()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T08:57:50+00:00Added an answer on June 17, 2026 at 8:57 am

    There are certain widgets that don’t own a X-window of their own for performance reasons ,since they are mostly decorative an generally don’t need to handle X event signals. You can find a complete list here.

    In those cases, a GtkEventBox is recommended to wrap the windowless widget with(the EventBox was build with that objective specifically).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PyGTK GUI that has a gtk.Table. Pressing one button will generate
I am trying to make a PyGtk Gui, that has a button. When the
I am trying to write a text viewer widget with PyGTK that displays line
I'm trying to use pygtk in Python but when I try running my code
Every program that I'm making using pygtk is right-alignment by default (maybe because my
I am not that familiar with PyGTK. Please see the following code. Is it
I am writing an pygtk app that uses a treeview, which has a connection
I am writing an email application using PyGTK. In almost every message that I
In GTK (or pygtk or gtkmm...) How can I detect that an application window
I have a function that creates prompts using gtk.MessageDialog in PyGTK. How could I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.