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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T22:52:36+00:00 2026-06-18T22:52:36+00:00

As the title implies I would like to be able to run a function

  • 0

As the title implies I would like to be able to run a function asynchronous in a GUI created with RGtk2.

The function in itself is an R wrapper for a system command, thus the bulk of the processing time is used on a system() call, and the processing time can range from 10 min to an hour. I would like the GUI to still be responsive in that period.

As it is now the function is put in a gSignalConnect(GtkButton, ‘clicked’) and the rest of the GUI is thus unresponsive until the ‘clicked’ signal is terminated.

Does anyone have an idea regarding whether this is possible?

best
Thomas

  • 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-18T22:52:38+00:00Added an answer on June 18, 2026 at 10:52 pm

    There might be a more direct way, but I think you can do this with gTimeoutAdd:

    library(RGtk2)
    
    w <- gtkWindow()
    g <- gtkVBox(); w$add(g)
    b1 <- gtkButton("Start timer"); g$packStart(b1)
    b2 <- gtkButton("click me"); g$packStart(b2)
    
    
    gSignalConnect(b1, "clicked", function(...) {
      id <- gTimeoutAdd(1, function(...) {
        Sys.sleep(5)                        # replace me
        message("Okay, I'm up")
        FALSE                               # one shot
      })
    })
    gSignalConnect(b2, "clicked", function(...) message('clicked me'))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I really would like to get into HTML 5 way. As a title implies,
As the title implies, the automatically login system is wildly used by many websites.
As the title implies, I am using AFNetworking in an iOS project in which
Just as the title implies, is it acceptable to create and use a collection
As the title implies, I'm using jQuery's show and hide functions to hide and
as the title implies i am searching for a good pattern / schema collection
As the post title implies, I have a legacy database (not sure if that
As the title implies, how does one extract the sub- and superdiagonal of a
Title edits that reflect a better summary of the question are welcome. I'd like
As the title implies I'm trying to select items from one list box, press

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.