vruby question

E

Esad Hajdarevic

Hi!

In the following code (http://pastie.caboo.se/15426), 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
 
S

Stefan Schmiedl

Hi!

In the following code (http://pastie.caboo.se/15426), 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 :)

Have fun,
s.
 
E

Esad Hajdarevic

Hi!

Stefan said:
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
 
S

Steve Tuckner

Hi!



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

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 Tuckner
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
44,998
Latest member
MarissaEub

Latest Threads

Top