wxCocoaDialog progressbar example

/ Published in: Ruby
Save to your folder(s)

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.

Copy this code and paste it in your HTML
  1. #!/usr/bin/env ruby
  3. cocoadialog = "#{ENV['TM_SUPPORT_PATH']}/bin/CocoaDialog"
  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


RSS Icon Subscribe to comments

You need to login to post a comment.