vruby question

Discussion in 'Ruby' started by Esad Hajdarevic, Sep 29, 2006.

  1. 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
     
    Esad Hajdarevic, Sep 29, 2006
    #1
    1. Advertising

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

    > 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.
     
    Stefan Schmiedl, Sep 29, 2006
    #2
    1. Advertising

  3. Hi!

    Stefan Schmiedl 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
     
    Esad Hajdarevic, Sep 29, 2006
    #3
  4. On Saturday, September 30, 2006, at 4:30 AM, Esad Hajdarevic wrote:
    >Hi!
    >
    >Stefan Schmiedl 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
    >
    >
    >


    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
    --
    Posted with http://DevLists.com. Sign up and save your mailbox.
     
    Steve Tuckner, Sep 29, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steve Tuckner

    VRuby/Win32 Question

    Steve Tuckner, Sep 25, 2003, in forum: Ruby
    Replies:
    1
    Views:
    97
    Eric Landuyt
    Sep 25, 2003
  2. Iki

    VRuby and Timeout

    Iki, Nov 7, 2003, in forum: Ruby
    Replies:
    0
    Views:
    95
  3. Armin Roehrl
    Replies:
    0
    Views:
    115
    Armin Roehrl
    Feb 9, 2004
  4. Domenic Padula

    VRuby tabstop question

    Domenic Padula, Sep 29, 2006, in forum: Ruby
    Replies:
    3
    Views:
    128
    Domenic P.
    Oct 12, 2006
  5. Replies:
    6
    Views:
    135
Loading...

Share This Page