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 7086617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:34:19+00:00 2026-05-28T07:34:19+00:00

I am using pygtk with glade to make a simple program which (by now)

  • 0

I am using pygtk with glade to make a simple program which (by now) consists on:

GUI:
A grid 4×4, each one showing an name.
Under the grid goes a text Entry.
The program runs in fullscreen.

BEHAVIOR:
Each name will be “selectable” for 10secs in an infinite loop. “selectable” means that wherever the user makes a click the name which 10secs time is running is selected and put on the TextEntry.

I already made the GUI, but don’t know how to handle it for detecting the click anywhere on the screen. Any help?

  • 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-05-28T07:34:19+00:00Added an answer on May 28, 2026 at 7:34 am

    To detect a click anywhere on the screen you can connect a callback for the button-press-event. Note that this is a gdk event and you must add this event to the mask with the add_events method.

    The following small program should be useful:

    import gtk
    
    def callback(window, event):
        assert event.type == gtk.gdk.BUTTON_PRESS
        print 'Clicked at x={0}, y={0}'.format(event.x, event.y)
    
    window = gtk.Window()
    window.add_events(gtk.gdk.BUTTON_PRESS_MASK)
    window.connect('button-press-event', callback)
    window.connect('destroy', lambda w: gtk.main_quit())
    window.show_all()
    
    gtk.main()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a glade GUI and i'm using dome gtk.MessageDialog widgets created with pygtk
I'm prototyping GUI layout with PyGTK, sometimes using glade/builder sometimes not, and the following
I've been writing writing a small pygtk application using glade to put together the
I'm using Python and PyGTK. I'm interested in running a certain function, which gets
I'm using Glade 3 to create a GtkBuilder file for a PyGTK app I'm
I am writing a program by a framework using pygtk. The main program doing
I'm using Python 2.6 and PyGTK 2.22.6 from the all-in-one installer on Windows XP,
As explained here , I have a simple tray icon using PyGTK. Being very
From within a Python GUI (PyGTK) I start a process (using multiprocessing). The process
I am writing a simple application and am using glade (gtk) for the UI.

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.