refresh text in statusbar

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

refresh text in statusbar

Ted Bracht-2
Hi,

I've got a statusbar with a statusbar item in a standard shell, and when
pressing a button on that shell a method is called that runs through a
number of stages. At the start of each stage I change the value (a string)
of the statusbar item. However, the statusbar is only updated after the
process has gone through all stages, even if I explicitly refresh.
When I put a 'self halt' in the below method, it neatly refreshes the
statusbar at every update.

Anybody an idea?

#status: aString
     (self presenterNamed: 'status') value: aString.
     (self presenterNamed: 'status') view refreshContents.

Thanks,

Ted


Reply | Threaded
Open this post in threaded view
|

Re: refresh text in statusbar

Ian Bartholomew
Ted,

> #status: aString
>      (self presenterNamed: 'status') value: aString.
>      (self presenterNamed: 'status') view refreshContents.

Try changing #refreshContents to #update, it seems to work.

I think the problem is just that a StatusItem is not really a view, it just
pretends to be one, and it is reliant on Windows telling it when to refresh
itself. Windows only seems to tell it when it has nothing else to do - hence
it only updates when everything else is finished (NB: guesswork after a
quick look).

StatusBarItemAbstract>>update, the suggested change, is a private method
though so you may like to use public methods that have the same effect.

(self presenterNamed: 'status') view width: (self presenterNamed: 'status')
view width

Personally, I'd just swear blind that I never saw the red icon <g>

Ian


Reply | Threaded
Open this post in threaded view
|

Re: refresh text in statusbar

ted.bracht
Ian,

"Ian Bartholomew" <[hidden email]> wrote in message
news:92lrvr$snp$[hidden email]...
> Ted,
>
> > #status: aString
> >      (self presenterNamed: 'status') value: aString.
> >      (self presenterNamed: 'status') view refreshContents.
>
> Try changing #refreshContents to #update, it seems to work.
>

It worked, thanks

Ted