Updating StatusBar

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

Updating StatusBar

Andrew Lawson
Hello all

I have a problem, and I'm confused. I have an Enhanced list view with a
ListPresenter attached and appropriate model. I have #when:send:to: set
up to run code that shows expanded details of the selected item in some
text fields to the side and also to show some of the same information in
the StatusBar. The issue I have is that a click to select an item will
trigger the appropriate code and the details will appear in the text
boxes but not in the status bar, however, should I change the selection
using the up and down arrow keys instead, both the text boxes and the
status bar are updated.  Given that the same code is called on both
occasions I can't imagine why there would be any difference in the
result. This is Dolphin 6.02.

        thanks

            Andrew


Reply | Threaded
Open this post in threaded view
|

Re: Updating StatusBar

Udo Schneider
Andrew Lawson wrote:

> I have a problem, and I'm confused. I have an Enhanced list view with a
> ListPresenter attached and appropriate model. I have #when:send:to: set
> up to run code that shows expanded details of the selected item in some
> text fields to the side and also to show some of the same information in
> the StatusBar. The issue I have is that a click to select an item will
> trigger the appropriate code and the details will appear in the text
> boxes but not in the status bar, however, should I change the selection
> using the up and down arrow keys instead, both the text boxes and the
> status bar are updated.  Given that the same code is called on both
> occasions I can't imagine why there would be any difference in the
> result. This is Dolphin 6.02.
How do you update the text boxes and status bar? The easiest way I found
up to now is to bind the TextBox and the Text in the Status Bar to the
same ValueModel holding the text. If update is needed I simply update
the value in the ValueModel which causes both dependent text boxes to
update itself.

I hacked some code to demonstrate this (attached).

CU,

Udo



---->8-----SNIP---->8-----SNIP---->8-----SNIP---->8-----SNIP----

"Filed out from Dolphin Smalltalk X6"!

Shell subclass: #TestShell
        instanceVariableNames: 'listPresenter textPresenter
statusBarTextPresenter textModel'
        classVariableNames: ''
        poolDictionaries: ''
        classInstanceVariableNames: ''!
TestShell guid: (GUID fromString: '{BE1252BD-889E-419D-AABF-61C25F1A4672}')!
TestShell comment: ''!
!TestShell categoriesForClass!Unclassified! !
!TestShell methodsFor!

createComponents
        super createComponents.
        listPresenter := self add: ListPresenter new name: 'list'.
        textPresenter := self add: TextPresenter new name: 'text1'.
        statusBarTextPresenter := self add: TextPresenter new name: 'text2'!

createSchematicWiring
        super createSchematicWiring.
        listPresenter
                when: #selectionChanged
                send: #updateText
                to: self!

model: aModel
        super model: aModel.
        listPresenter model: aModel.
        textModel := String new asValue.
        textPresenter model: textModel.
        statusBarTextPresenter model: textModel!

updateText
        textModel value: listPresenter selection! !
!TestShell categoriesFor: #createComponents!public! !
!TestShell categoriesFor: #createSchematicWiring!public! !
!TestShell categoriesFor: #model:!public! !
!TestShell categoriesFor: #updateText!public! !

!TestShell class methodsFor!

defaultModel
^ListModel on: #(red green blue)!

resource_Default_view
        "Answer the literal data from which the 'Default view' resource can be
reconstituted.
        DO NOT EDIT OR RECATEGORIZE THIS METHOD.

        If you wish to modify this resource evaluate:
        ViewComposer openOn: (ResourceIdentifier class: self selector:
#resource_Default_view)
        "

        ^#(#'!!STL' 3 788558 10 ##(Smalltalk.STBViewProxy)  8
##(Smalltalk.ShellView)  98 27 0 0 98 2 27131905 131073 416 0 524550
##(Smalltalk.ColorRef)  8 4278190080 0 551 0 0 0 416 788230
##(Smalltalk.BorderLayout)  1 1 0 410 8 ##(Smalltalk.StatusBar)  98 18 0
416 98 2 8 1140853004 1 560 0 482 8 4278190080 0 7 0 263174
##(Smalltalk.Font)  0 16 459014 ##(Smalltalk.LOGFONT)  8 #[243 255 255
255 0 0 0 0 0 0 0 0 0 0 0 0 144 1 0 0 0 0 0 0 3 2 1 34 65 114 105 97 108
0 159 4 0 134 63 1 0 0 204 53 63 1 2 0 20 59 0 0 0 0 247 0 5 86 111 1]
328198 ##(Smalltalk.Point)  193 193 0 560 0 8 4294903813 234 256 98 2
853766 ##(Smalltalk.StatusBarItem)  1 -1 560 0 459270
##(Smalltalk.Message)  8 #displayString 98 0 832 1114638
##(Smalltalk.STBSingletonProxy)  8 ##(Smalltalk.IconImageManager)  8
#current 8 'text2' 98 1 848 1115142 ##(Smalltalk.StatusBarNullItem)  513
1 560 0 0 983302 ##(Smalltalk.MessageSequence)  202 208 98 1 721670
##(Smalltalk.MessageSend)  8 #createAt:extent: 98 2 754 1 689 754 1185
45 560 983302 ##(Smalltalk.WINDOWPLACEMENT)  8 #[44 0 0 0 0 0 0 0 1 0 0
0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 0 0 0
0 88 1 0 0 80 2 0 0 110 1 0 0] 98 0 754 193 193 0 27 0 0 410 8
##(Smalltalk.ContainerView)  98 15 0 416 98 2 8 1140850688 131073 1296 0
0 0 7 0 0 0 1296 1180166 ##(Smalltalk.ProportionalLayout)  234 240 98 2
410 8 ##(Smalltalk.ListBox)  98 17 0 1296 98 2 8 1144062209 1025 1440
590662 2 ##(Smalltalk.ListModel)  202 208 98 0 0 938 8
##(Smalltalk.SearchPolicy)  8 #identity 482 8 4278190080 0 7 0 0 0 1440
0 8 4294905281 866 896 98 0 1568 32 1058 202 208 98 2 1122 1152 98 2 754
1 1 754 1067 689 1440 1122 8 #horizontalExtent: 98 1 1 1440 1218 8 #[44
0 0 0 0 0 0 0 1 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255
255 255 255 255 0 0 0 0 0 0 0 0 21 2 0 0 88 1 0 0] 98 0 1280 0 27 21 32
234 256 98 4 410 8 ##(Smalltalk.TextEdit)  98 16 0 1296 98 2 8
1140916352 1025 1952 0 482 8 4278190080 0 7 0 0 0 1952 0 8 4294903797
852486 ##(Smalltalk.NullConverter)  0 0 1 1058 202 208 98 3 1122 1152 98
2 754 1077 1 754 109 689 1952 1122 8 #selectionRange: 98 1 525062
##(Smalltalk.Interval)  3 1 3 1952 1122 8 #isTextModified: 98 1 32 1952
1218 8 #[44 0 0 0 0 0 0 0 1 0 0 0 255 255 255 255 255 255 255 255 255
255 255 255 255 255 255 255 26 2 0 0 0 0 0 0 80 2 0 0 88 1 0 0] 98 0
1280 0 27 8 'text1' 1440 8 'list' 0 1058 202 208 98 1 1122 1152 98 2 754
1 1 754 1185 689 1296 1218 8 #[44 0 0 0 0 0 0 0 1 0 0 0 255 255 255 255
255 255 255 255 255 255 255 255 255 255 255 255 0 0 0 0 0 0 0 0 80 2 0 0
88 1 0 0] 98 3 1440 410 8 ##(Smalltalk.Splitter)  98 12 0 1296 98 2 8
1140850688 1 2592 0 482 8 4278190080 0 519 0 0 0 2592 1058 202 208 98 1
1122 1152 98 2 754 1067 1 754 11 689 2592 1218 8 #[44 0 0 0 0 0 0 0 1 0
0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 21 2
0 0 0 0 0 0 26 2 0 0 88 1 0 0] 98 0 1280 0 27 1952 1280 0 27 234 256
1568 0 0 0 0 0 1 0 0 0 0 1 0 0 1058 202 208 98 2 1122 1152 98 2 754 2799
21 754 1201 801 416 1122 8 #updateMenuBar 1568 416 1218 8 #[44 0 0 0 0 0
0 0 0 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
255 119 5 0 0 10 0 0 0 207 7 0 0 154 1 0 0] 98 2 1296 560 1280 0 27 )! !
!TestShell class categoriesFor: #defaultModel!public! !
!TestShell class categoriesFor: #resource_Default_view!public! !

---->8-----SNIP---->8-----SNIP---->8-----SNIP---->8-----SNIP----


Reply | Threaded
Open this post in threaded view
|

Re: Updating StatusBar

Andrew Lawson
On 2006-05-29, Udo Schneider <[hidden email]> wrote:

> Andrew Lawson wrote:
>> I have a problem, and I'm confused. I have an Enhanced list view with a
>> ListPresenter attached and appropriate model. I have #when:send:to: set
>> up to run code that shows expanded details of the selected item in some
>> text fields to the side and also to show some of the same information in
>> the StatusBar. The issue I have is that a click to select an item will
>> trigger the appropriate code and the details will appear in the text
>> boxes but not in the status bar, however, should I change the selection
>> using the up and down arrow keys instead, both the text boxes and the
>> status bar are updated.  Given that the same code is called on both
>> occasions I can't imagine why there would be any difference in the
>> result. This is Dolphin 6.02.
> How do you update the text boxes and status bar? The easiest way I found
> up to now is to bind the TextBox and the Text in the Status Bar to the
> same ValueModel holding the text. If update is needed I simply update
> the value in the ValueModel which causes both dependent text boxes to
> update itself.

I do much the same as you, although I do have two seperate
TextPresenters, both updated with textPresenter value: someText. The
text box always displays the change, the statusbar only on the move by
cursor, not the click ...

    Andrew


Reply | Threaded
Open this post in threaded view
|

Re: Updating StatusBar

Udo Schneider
Andrew Lawson wrote:
> I do much the same as you, although I do have two seperate
> TextPresenters, both updated with textPresenter value: someText. The
> text box always displays the change, the statusbar only on the move by
> cursor, not the click ...
That's strange. Even the hacked example I attached updates the text box
and the text in the status bar in both cases.
Did you have a chance to try my code to see whether the problem occurs
there as well?

Could you shrink your code and post it?

CU,

Udo


Reply | Threaded
Open this post in threaded view
|

Re: Updating StatusBar

Chris Uppal-3
In reply to this post by Andrew Lawson
Andrew,

> The issue I have is that a click to select an item will
> trigger the appropriate code and the details will appear in the text
> boxes but not in the status bar, however, should I change the selection
> using the up and down arrow keys instead, both the text boxes and the
> status bar are updated.

What do you see when you debug through the two different cases ?

    -- chris


Reply | Threaded
Open this post in threaded view
|

Re: Updating StatusBar

Ian Bartholomew-21
In reply to this post by Andrew Lawson
Andrew,

>     The issue I have is that a click to select an item will
> trigger the appropriate code and the details will appear in the text
> boxes but not in the status bar,

I occasionally see something similar with the StatusBars in my
NewsArchiveBrowser and ChunkBrowser.  It is intermittent in my case though,
a quick trial with the news browser just took over ten attempts before the
StatusBar contents failed to appear and another attempt took over twenty..

Have you tried resizing the view?  In my case changing the view size can
cause the text to reappear although, and this is going to sound strange, it
_sometimes_ does it slowly.  As I continuously resize the view I start to
see the top of the text appear right at the bottom of the StatusBar, then a
bit more is displayed, then a bit more, until it is all there.  Honestly!.

It seems like a positioning problem (drawing the text in the wrong place)
and, although I have tried to track it down, or find an easily reproducible
example, I haven't got anywhere.

Might be a completely different problem of course!

--
Ian

Use the Reply-To address to contact me (limited validity).
Mail sent to the From address is ignored.


Reply | Threaded
Open this post in threaded view
|

Re: Updating StatusBar

Andrew Lawson
In reply to this post by Andrew Lawson
On 2006-05-30, Ian Bartholomew <[hidden email]> wrote:

> Andrew,
>
>>     The issue I have is that a click to select an item will
>> trigger the appropriate code and the details will appear in the text
>> boxes but not in the status bar,
>
> I occasionally see something similar with the StatusBars in my
> NewsArchiveBrowser and ChunkBrowser.  It is intermittent in my case though,
> a quick trial with the news browser just took over ten attempts before the
> StatusBar contents failed to appear and another attempt took over twenty..
>
> Have you tried resizing the view?  In my case changing the view size can
> cause the text to reappear although, and this is going to sound strange, it
> _sometimes_ does it slowly.  As I continuously resize the view I start to
> see the top of the text appear right at the bottom of the StatusBar, then a
> bit more is displayed, then a bit more, until it is all there.  Honestly!.
>
> It seems like a positioning problem (drawing the text in the wrong place)
> and, although I have tried to track it down, or find an easily reproducible
> example, I haven't got anywhere.
>
> Might be a completely different problem of course!

Ian, your genius shows through, I had never thought to resize the form
when I saw the problem. Clicking (seeing no update of the status bar)
and then resizing does make the text appear. So it is some sort of
drawing problem. Unfortunately I know nothing about windows
programming (for this I use Dolphin :) ). I had a quick google for
'windows status bar text not appearing' and similar but without
result, perhaps showing that the problem is dolphin specific? Any
ideas anyone? I might have time to make a simple reproducible example
later in the week if necessary.

        Andrew


Reply | Threaded
Open this post in threaded view
|

Re: Updating StatusBar

Andrew Lawson
In reply to this post by Chris Uppal-3
On 2006-05-29, Chris Uppal <[hidden email]> wrote:

> Andrew,
>
>> The issue I have is that a click to select an item will
>> trigger the appropriate code and the details will appear in the text
>> boxes but not in the status bar, however, should I change the selection
>> using the up and down arrow keys instead, both the text boxes and the
>> status bar are updated.
>
> What do you see when you debug through the two different cases ?
>
>     -- chris

Evil, evil code I don't understand, but see my reply to Ian later, the
text is updated, it's just not drawn properly but later appears if you
resize the form.

        Andrew


Reply | Threaded
Open this post in threaded view
|

Re: Updating StatusBar

Eric Taylor
In reply to this post by Andrew Lawson
Andrew,

What version of Windows are you using?  Are you by any chance using
Windows XP but with Appearance set to Classic Mode?

Eric

> -----Original Message-----
> From: Andrew Lawson [mailto:[hidden email]]
> Posted At: Tuesday, May 30, 2006 1:48 AM
> Posted To: comp.lang.smalltalk.dolphin
> Conversation: Updating StatusBar
> Subject: Re: Updating StatusBar
>
> On 2006-05-30, Ian Bartholomew <[hidden email]> wrote:
> > Andrew,
> >
> >>     The issue I have is that a click to select an item will
> >> trigger the appropriate code and the details will appear in the
text
> >> boxes but not in the status bar,
> >
> > I occasionally see something similar with the StatusBars in my
> > NewsArchiveBrowser and ChunkBrowser.  It is intermittent in my case
> though,
> > a quick trial with the news browser just took over ten attempts
before
> the
> > StatusBar contents failed to appear and another attempt took over
> twenty..
> >
> > Have you tried resizing the view?  In my case changing the view size
can
> > cause the text to reappear although, and this is going to sound
strange,
> it
> > _sometimes_ does it slowly.  As I continuously resize the view I
start

> to
> > see the top of the text appear right at the bottom of the StatusBar,
> then a
> > bit more is displayed, then a bit more, until it is all there.
> Honestly!.
> >
> > It seems like a positioning problem (drawing the text in the wrong
> place)
> > and, although I have tried to track it down, or find an easily
> reproducible
> > example, I haven't got anywhere.
> >
> > Might be a completely different problem of course!
>
> Ian, your genius shows through, I had never thought to resize the form
> when I saw the problem. Clicking (seeing no update of the status bar)
> and then resizing does make the text appear. So it is some sort of
> drawing problem. Unfortunately I know nothing about windows
> programming (for this I use Dolphin :) ). I had a quick google for
> 'windows status bar text not appearing' and similar but without
> result, perhaps showing that the problem is dolphin specific? Any
> ideas anyone? I might have time to make a simple reproducible example
> later in the week if necessary.
>
>         Andrew