C extension with progress bar

Discussion in 'Ruby' started by Simi Lc, Sep 24, 2009.

  1. Simi Lc

    Simi Lc Guest

    Hi,

    I have a ruby extension which shows a progress bar window.

    The progress bar shows the progress of a loop in the ruby code.For each
    iteration of the loop I call an extension method that sets the current
    progress through the PBM_SETPOS message.

    The progress bar is actually shown.The problem arises when I want to
    implement a cancel button in the progress window.

    While the progress is updating the window becomes unresponsive and
    cancel button click does not work.

    I tried to update the progress in C code through a separate thread using
    CreateThread but it does not show the progress at all.

    Kindly suggest solution to fix this problem

    Thanks in advance and let me know any other details are required.

    Simi
    --
    Posted via http://www.ruby-forum.com/.
     
    Simi Lc, Sep 24, 2009
    #1
    1. Advertising

  2. Calling function which is implemented purely in C will block it until
    it returns. Maybe there is a way to call some rb_thread_shedule
    (written from memory so it could be wrong) which will let other
    threads to run.

    --=20
    Pozdrawiam

    Rados=B3aw Bu=B3at
    http://radarek.jogger.pl - m=F3j blog
     
    Rados³aw Bu³at, Sep 25, 2009
    #2
    1. Advertising

  3. 2009/9/24 Simi Lc <>:
    > Hi,
    >
    > I have a ruby extension which shows a progress bar window.
    >
    > The progress bar shows the progress of a loop in the ruby code.For each
    > iteration of the loop I call an extension method that sets the current
    > progress through the PBM_SETPOS message.
    >
    > The progress bar is actually shown.The problem arises when I want to
    > implement a cancel button in the progress window.
    >
    > While the progress is updating the window becomes unresponsive and
    > cancel button click does not work.
    >
    > I tried to update the progress in C code through a separate thread using
    > CreateThread but it does not show the progress at all.
    >
    > Kindly suggest solution to fix this problem
    >
    > Thanks in advance and let me know any other details are required.
    >


    In general the UI library which you are using for drawing the progress
    bar should provide means for doing this. However, the solution is
    dependent on the library you use, unfortunately.

    So the questions are

    What you are using to display the progress bar?

    Why did you choose this UI, can't a different library provide it? What
    are the requirements?

    Why did you choose to do that in C? Does the library lack ruby
    bindings? Can't it be loaded through ffi?

    Thanks

    Michal
     
    Michal Suchanek, Sep 25, 2009
    #3
  4. Simi Lc

    Axel Etzold Guest

    Axel Etzold, Sep 25, 2009
    #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. Matt
    Replies:
    0
    Views:
    3,552
  2. John Hann
    Replies:
    0
    Views:
    6,086
    John Hann
    Aug 21, 2004
  3. Charlie Zhang
    Replies:
    3
    Views:
    1,260
    Paul Lutus
    Aug 16, 2004
  4. Matt
    Replies:
    9
    Views:
    70,868
  5. Rob

    progress bar or guage bar

    Rob, Jul 11, 2003, in forum: ASP General
    Replies:
    6
    Views:
    202
    Chris Barber
    Jul 12, 2003
Loading...

Share This Page