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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:10:40+00:00 2026-05-25T20:10:40+00:00

I have a pygtk add which has a gtk.Button() which when pressed has to

  • 0

I have a pygtk add which has a gtk.Button() which when pressed has to do a job of lets say 5 seconds. So, the thought of implementing the time-intensive function in the signal handler as a thread.

First of all, I have added gtk.gdk.threads_init() in the beginning.

My signal handler is def send_sms() and in that I have another function def send_sms_mycantos() which I call as a thread.

threading.Thread(target = self.send_sms_mycantos, args=(phone_no, message_text, username, password)).start()

I also have a function which displays dialogs.

def dialog_notification(self, message, dialog_type):
    dlg = gtk.MessageDialog(self.window, gtk.DIALOG_DESTROY_WITH_PARENT, dialog_type, gtk.BUTTONS_CLOSE, message)
    dlg.run()
    dlg.destroy()

Now, if I call the above function in my thread

self.dialog_notification("Message sent successfully", gtk.MESSAGE_INFO)

I get this error.

SMSSender.py: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0.

Is this the right way to implement threading. What am I doing wrong. The error is like the thread doesn’t know that Xserver is running.

  • 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-25T20:10:41+00:00Added an answer on May 25, 2026 at 8:10 pm

    The simplest way would be to run self.dialog_notification() in the main gtk thread. Just add gobject.idle_add(self.dialog_notification, args...) in your thread.

    • 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 have a PyGTK program which is hidden most of the time, but with
I have an application which depends on PyGTK, PyGobject, and PyCairo that I built
I have two threads in my PyGTK app: the main thread which runs the
I have a PyGtk treeview with a couple of columns. During runtime i add
To begin, I must say that I have searched for quite a long time
I have a string which contains svn unified diff. My PyGTK app need to
I have a function that creates prompts using gtk.MessageDialog in PyGTK. How could I
I am trying to generate a hierarchical directory listing in pyGTK. Currently, I have
Have just started using Visual Studio Professional's built-in unit testing features, which as 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.