From: Craig Moran Date: 2005-04-30T02:58:24+09:00 Subject: Fox FXProgressBar refresh issue ------=_Part_672_28997123.1114797483805 Content-Type: multipart/alternative; boundary="----=_Part_673_10079008.1114797483805" ------=_Part_673_10079008.1114797483805 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I am having a refresh issue with the FXProgressBar that I'd like to resolve= .=20 First, I would like to state that I am not an experienced GUI programmer, s= o=20 I'd like some guidance. I am working with Fox, trying to implement a=20 progress bar. I've stripped the code below to what I think is the simplest= =20 base level design. If it may be done simpler, please let me know. The issue is this. When I run this program and let it complete with no=20 interaction, it works fine. However, if I start clicking on the title bar,= =20 it will eventually stop refreshing the application GUI. During my tests,=20 this will generally occur at 9% or shortly thereafter. When I have caused= =20 the GUI to stop refreshing, the program still runs to completion, then=20 refreshes when the progress bar hits 100%. Here's what I'd like to know: 1. Am I implementing this correctly?=20 2. Is there a better way to implement this? In the doStuff def, I=20 would actually be performing real work.=20 3. Am I not making the correct calls to refresh the GUI?=20 C:\>ruby -v ruby 1.8.2 (2004-12-25) [i386-mswin32] This is the 1.8.2-15 One-Click Installer for Windows I am running it on Windows XP SP1. I have duplicated this behavior on=20 Windows 2000 with the same One-Click Installer. I don't think this is an=20 issue with the One-Click Installer. I think that I am doing something wrong= . As an aside, which other cross-platform GUIs have progress bars available? = I=20 have used wxRuby and Tk in the past and my skill level is limited with both= .=20 Thanks in advance for any help that is provided. Craig #!/usr/bin/env ruby require 'fox12' include Fox TOTAL =3D 500000 class ProgressWindow < FXMainWindow def initialize(app) super(app, "Progress Bar", nil, nil, DECOR_ALL, 0, 0, 400, 0) $pbar =3D FXProgressBar.new(self, nil, 0, LAYOUT_FILL_X|FRAME_SUNKEN| FRAME_THICK|PROGRESSBAR_PERCENTAGE) $pbar.total =3D TOTAL end # def initialize def doStuff=20 TOTAL.times { |x| $pbar.setProgress(x) getApp.repaint } end # def doStuff def create super show(PLACEMENT_SCREEN) doStuff end # def create end # class ProgressWindow=20 def run application =3D FXApp.new("Progress", "Test") ProgressWindow.new(application) application.create application.run end # def run run ------=_Part_673_10079008.1114797483805 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I am having a refresh issue with the FXProgressBar that I'd like to resolve.  First, I would like to state that I am not an experienced GUI programmer, so I'd like some guidance.  I am working with Fox, trying to implement a progress bar.  I've stripped the code below to what I think is the simplest base level design.  If it may be done simpler, please let me know.

Th= e issue is this.  When I run this program and let it complete with no interaction, it works fine.  However, if I start clicking on the title bar, it will eventually stop refreshing the application GUI.  During my tests, this will generally occur at 9% or shortly thereafter.  When I have caused the GUI to stop refreshing, the program still runs to completion, then refreshes when the progress bar hits 100%.

Here's what I'd like to know:
  1. Am I implementing this correctly?
  2. Is there a better way to implement this?  In the doStuff def, I = would actually be performing real work.
  3. Am I not making the correct calls to refresh the GUI?
C:\>ruby -v
ruby 1.8.2 (2004-12-25) [i386-mswin32]
This is the 1.8.2-15 One-Click Installer for Windows
I am running it on Windows XP SP1.  I have duplicated this behavior on Windows 2000 with the same One-Click Installer.  I don't think this is an issue with the One-Click Installer.  I think that I am doing something wrong.

As an aside, which other cross-platform GUIs have progress bars available?  I have used wxRuby and Tk in the past and my skill level is limited with both.  Thanks in advance for any help that is provided.
Craig

#!/usr/bin/env ruby
require 'fox12'
include Fox

T= OTAL =3D 500000

class ProgressWindow < FXMainWindow
 &nbs= p;def initialize(app)
    super(app, "Progress = Bar", nil, nil, DECOR_ALL,
        0, 0, 400, 0)
 &nbs= p;  $pbar =3D FXProgressBar.new(self, nil, 0,
  &nbs= p;     LAYOUT_FILL_X|FRAME_SUNKEN|
=09FRAME_THI= CK|PROGRESSBAR_PERCENTAGE)
    $pbar.total =3D TOTAL=
  end # def initialize

  def doStuff
    TOTAL.times { |x|
    &n= bsp; $pbar.setProgress(x)
      getAp= p.repaint
    }
  end # def doStuff
=
  def create
    super
  =   show(PLACEMENT_SCREEN)
    doStuff
&n= bsp; end # def create
end # class ProgressWindow

def run
  application =3D FXApp.new("Progress&quo= t;, "Test")
  ProgressWindow.new(application)
&nb= sp; application.create
  application.run
end # def run=

run ------=_Part_673_10079008.1114797483805-- ------=_Part_672_28997123.1114797483805 Content-Type: application/octet-stream; name=progressBar.rb Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="progressBar.rb" #!/usr/bin/env ruby require 'fox12' include Fox TOTAL = 500000 class ProgressWindow < FXMainWindow def initialize(app) super(app, "Progress Bar", nil, nil, DECOR_ALL, 0, 0, 400, 0) $pbar = FXProgressBar.new(self, nil, 0, LAYOUT_FILL_X|FRAME_SUNKEN| FRAME_THICK|PROGRESSBAR_PERCENTAGE) $pbar.total = TOTAL end # def initialize def doStuff TOTAL.times { |x| $pbar.setProgress(x) getApp.repaint } end # def doStuff def create super show(PLACEMENT_SCREEN) doStuff end # def create end # class ProgressWindow def run application = FXApp.new("Progress", "Test") ProgressWindow.new(application) application.create application.run end # def run run ------=_Part_672_28997123.1114797483805--