Posted By

gtcaz on 01/27/07


Tagged

textmate e wxCocoaDialog


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

bjchrist
gbvb
vali29
webstic


wxCocoaDialog progressbar example


 / Published in: Ruby
 

This is an example of how to use the progressbar widget from Alexander Stigsen's new wxCocoaDialog, an open source port of CocoaDialog to Win32 using the ExWidgets toolkit. This is a companion project to his e Text Editor.

  1. #!/usr/bin/env ruby
  2.  
  3. cocoadialog = "#{ENV['TM_SUPPORT_PATH']}/bin/CocoaDialog"
  4.  
  5. IO.popen("'#{cocoadialog}' progressbar --title 'Updating...'",'w') do |pbar|
  6. (1..100).each do |percent|
  7. pbar.puts "#{percent} #{percent}% Complete\n"
  8. sleep(1) if percent % 10 == 0 and percent < 100
  9. end
  10. end

Report this snippet  

You need to login to post a comment.