Vruby question

Hi!

In the following code (Parked at Loopia), the Dialog returns
the value (:test) the first time, but after the form B has been closed,
and created again, it returns 0. Any idea why? Am I doing something
wrong or is this bug in vruby/swin? If I use hide instead of close,
everything works well.

Esad

On Fri, 29 Sep 2006 05:03:36 +0200, Esad H. wrote:

Hi!

In the following code (Parked at Loopia), the Dialog returns
the value (:test) the first time, but after the form B has been closed,
and created again, it returns 0. Any idea why? Am I doing something
wrong or is this bug in vruby/swin? If I use hide instead of close,
everything works well.

Esad

I have used vruby and other GUI frameworks only sparingly and years ago,
but they usually differentiate between creating a window and displaying
it on screen.

So I’d guess that closing (as in “I don’t need this anymore”) a window
might free system resources and leave you with a reference to something
invalid.

If you hde the window (as in “I might need it later”) ruby keeps the
system resources around and the second use of b is fine.

Then again, I really don’t know what I’m talking about :slight_smile:

Have fun,
s.

Hi!

Stefan S. wrote:

I have used vruby and other GUI frameworks only sparingly and years ago,
but they usually differentiate between creating a window and displaying
it on screen.

The problem with the form is that after you show it, you should enter
the messageloop, and in case of dialog vruby does that for you (it enter
the messageloop after the dialog is closed and then returns a value).

I simply added something like this (after form creation)

Thread.new { VRLocalScreen.messageloop }

which createas a messageloop for the form in background, this thread
dies after the form has been closed.

It worked!

I feel vruby has a great potential, it is too pity it so chaotic and
undocumented. If I could find few more people, I’d be willing to spend
some time creating english documentation, cleaning up the sources,
applying patches, starting a mailing list, a nice english webpage etc.

Esad

On Saturday, September 30, 2006, at 4:30 AM, Esad H. wrote:

the messageloop after the dialog is closed and then returns a value).
I feel vruby has a great potential, it is too pity it so chaotic and
undocumented. If I could find few more people, I’d be willing to spend
some time creating english documentation, cleaning up the sources,
applying patches, starting a mailing list, a nice english webpage etc.

Esad

You might want to check out VRTools to see about the holes in VRuby that
it fills (gem install VRTools).

  • Supports Tabbing in forms
  • Allows creation of forms and dialogs using a similar mechanism
  • Adds support for right click menus
  • Adds a layout manager for VRuby forms
  • Allows test first to be used on a form

Steve T.