ChrisS85/CGUI — Issue #45: Statusbar: Updating contents
Author: hoppfrosch
Created: 2012-01-26 07:14:52+00:00
State: open

Not quite sure whether this is an issue or NOOB error, but nevertheless:

I cannot figure out how to update the contents of the StatusBar:

```autohotkey
MyWindow := new CBasicWindow("Demo") ;Create an instance of this window class

Loop 100
{
MyWindow.SetProgress(A_Index, 100)
sleep 50
}

Class CBasicWindow Extends CGUI
{
;...
statBar	:= this.AddControl("StatusBar", "statBar", "", "test")
;...

__New(Title)
{
;...
this.statBar.Parts.Add("bla")
this.statBar.Parts[1].Icon := A_AhkPath
this.statBar.Parts := [{Text : "Percent done: ", Width : floor(this.width*0.5)}, {Text : "Hello World!"}]

this.Show();
;...
}

SetProgress(value, total = 100)
{
percent := floor(value/total * 100)
this.statBar.Parts[1] := {text : "Percent done: " percent}
}
}
```

I tried out several things, but cannot figure out, how to update contents of Statusbar .... (either bug or - as I said - NOOB ...)