C extension with progress bar

S

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.

Simi
 
R

Rados³aw Bu³at

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
 
M

Michal Suchanek

2009/9/24 Simi Lc said:
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
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top