Rebol Tutorial
Rebol Tutorial

Reputation: 2754

How to run a view without blocking Rebol's Console?

Taken from http://www.rebol.com/docs/view-system.html#section-4:

In some cases you may want to view a window but continue evaluating code after the window is open. You can do that by specifying the new refinement. Here is an example:

print "opening window..."
view/new make face [
    offset: 100x100
    color: papaya
    text: "Example"
]
print "continuing..."

The problem is if I run the code from Rebol's Console, the console is blocked until I close the Windows, whereas I would like to continue what I want in Console.

So how do I unblock the Console ?

Upvotes: 0

Views: 134

Answers (2)

Sunanda
Sunanda

Reputation: 1555

Revised answer as a possible way forward regarding your wish for an always opened windows during the console session while continuing to work in console.

One way to get close is to have a console input field within your GUI page itself:

print "opening window..."
unview/all
view/new layout [
        label "console"
        console: field 300x300 [
                    print console/text attempt [do console/text]
                    ]
        ]

print "continuing..." do-events

That way, you can type into that box, and see the response in the console window.

I use the technique as a way of debugging view applications....you can have some code that adds a debug console or not according to a start-up option, so it is only there when you need it.

Upvotes: 1

Graham Chiu
Graham Chiu

Reputation: 4886

Works for me.

Are you running this as a script or just typing into the console?

Upvotes: 0

Related Questions