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

  • Home
  • SEARCH
  • 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 7777895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:15:32+00:00 2026-06-01T18:15:32+00:00

So I am trying to write a program that uses both the big-bang (see

  • 0

So I am trying to write a program that uses both the big-bang (see 2htdp/universe) function as well as dialogs (see racket/gui/base). My problem is that I want it so that the program displays both of the windows at the same time, however I am having a hard time figuring that part out, as both functions must be “closed/completed” for code to continue. This is what I have tried, with no luck (due to what was said previously):

#lang racket

(require 2htdp/universe
         racket/gui/base)

(define dialog (instantiate dialog% ("Title")))
(define (render data)
   ...)

(define main
   (begin
      (big-bang ...
         (on-draw render))
      (send dialog show #t)))

With this sample [template] code, the big-bang application shows first, and for the dialog to show, you must close the big-bang application. To re-iterate, I want to be able to have both of them show at the same time.

If you would like any more information about the problem, please let me know. Thanks in advance for 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-06-01T18:15:33+00:00Added an answer on June 1, 2026 at 6:15 pm

    You can run both of these in separate threads with their own eventspaces, which should keep them from blocking each other’s execution. Do you expect that there will be communication between the two?

    Here’s an example:

    #lang racket
    
    (require 2htdp/universe
             2htdp/image
             racket/gui/base)
    
    ;; start-dialog: -> void
    (define (start-dialog)
      (define dialog (new dialog% [label "A sample title"]))
      (send dialog show #t))
    
    ;; start-up-big-bang: -> number
    (define (start-up-big-bang)
      (big-bang 0
                (on-tick add1 1)
                (to-draw draw)))
    
    ;; draw: number -> image
    (define (draw w)
      (text (format "I see my number is: ~a" w) 20 "black"))
    
    ;; We create fresh eventspaces for each.
    ;; See: http://docs.racket-lang.org/gui/windowing-overview.html#(part._eventspaceinfo)
    ;; for more details.
    (define c1 (make-eventspace))
    (define c2 (make-eventspace))
    
    ;; And now we can spawn off these two to run concurrently.
    (define t1 (parameterize ([current-eventspace c1])
                 (thread start-up-big-bang)))
    (define t2 (parameterize ([current-eventspace c2])
                 (thread start-dialog)))
    
    ;; Let's wait till both the big-bang and the dialog have closed.
    (thread-wait t1)
    (thread-wait t2)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write a program in Java that uses osql to generate a
I am trying to write a program that uses a Berkeley Database and i
I'm trying to write a program that uses sockets to connect with other instances
I am trying to write a program that uses file I/O to score personality
I'm trying to write a program with g++ that uses conio.h header. What I'm
So I'm trying to write a C program that uses inotify. I've used pyinotify
I'm trying to write myself a program that calculates a function taken from a
I am trying to write a program that uses a C API. This API
gud day... i'm trying to write a program in javascript that uses .json. i
I'm trying to write a program that uses fattach but the compiler says fattach

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.