• StatusBar - how to display a string?

    From F Bek@21:1/5 to All on Wed Feb 17 17:16:11 2021
    Beginner's question
    Dolphin Smalltalk 7.2.6

    How do you get the Status Bar to display a string?

    I can communicate with the Status Bar from a Presenter with say <(self view viewNamed: 'bar')>, but how do I get it to display anything, and update itself? Both #value: and #text: are not understood.

    And more generally, how do I add items to the StatusBar and use them?

    Thanks for reading and eventually answering.
    FB

    ___________________________________________

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From john.aspinall@gmail.com@21:1/5 to fbek...@gmail.com on Thu Feb 18 08:54:52 2021
    Hi FB,

    You can add individual fields (StatusBarItems) to a StatusBar in the View Composer - look for its 'items' aspect, you add/edit/remove/reorder items in the same way as a ListView's columns.

    If you name the StatusBarItems you can then either address them directly via their name (self view viewNamed: 'barItem'), or create a correspondingly-named TextPresenter and use them like a 'normal' text view/presenter pair.

    Hope this helps.

    John



    On Thursday, February 18, 2021 at 1:16:12 AM UTC, fbek...@gmail.com wrote:
    Beginner's question
    Dolphin Smalltalk 7.2.6

    How do you get the Status Bar to display a string?

    I can communicate with the Status Bar from a Presenter with say <(self view viewNamed: 'bar')>, but how do I get it to display anything, and update itself? Both #value: and #text: are not understood.

    And more generally, how do I add items to the StatusBar and use them?

    Thanks for reading and eventually answering.
    FB

    ___________________________________________

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From F Bek@21:1/5 to john.a...@gmail.com on Thu Feb 18 15:07:42 2021
    Thanks John,
    Indeed, StatusBar comes with one (StatusBarItem) and following your message, I added another one for the sake of trying, named it 'bar' and adjusted its (width) from the default (-1) to say (120) so the box extent and separators are clearly visible.

    I am still stuck on trying to communicate anything with it: trying, from within <onViewOpened> the following: (self view viewNamed: 'bar') text: 'xyz' or #value: both selectors produce a 'not understood' error, while #displayString: 'xyz' doesn't produce
    an error but doesn't produce a result either.. Is there a missing step to designate it as text box first (or icon, button, image, or anything else)?

    Do I have to drop a (TextEdit) on top of it? which I have done and, in the hierarchy tree, it shows as a child to the (StatusBar). But then, I am communicating with the (TextEdit), which has its own 'name', and not with the (StatusBarItem), which doesn't
    seem to do much, but looks like a decorator only!?

    It seems like I am missing on the main concept here. Any further clarifications would be much appreciated.
    FB
    ___________________
    On Thursday, February 18, 2021 at 6:54:53 PM UTC+2, john.a...@gmail.com wrote:
    Hi FB,

    You can add individual fields (StatusBarItems) to a StatusBar in the View Composer - look for its 'items' aspect, you add/edit/remove/reorder items in the same way as a ListView's columns.

    If you name the StatusBarItems you can then either address them directly via their name (self view viewNamed: 'barItem'), or create a correspondingly-named TextPresenter and use them like a 'normal' text view/presenter pair.

    Hope this helps.

    John
    On Thursday, February 18, 2021 at 1:16:12 AM UTC, fbek...@gmail.com wrote:
    Beginner's question
    Dolphin Smalltalk 7.2.6

    How do you get the Status Bar to display a string?

    I can communicate with the Status Bar from a Presenter with say <(self view viewNamed: 'bar')>, but how do I get it to display anything, and update itself? Both #value: and #text: are not understood.

    And more generally, how do I add items to the StatusBar and use them?

    Thanks for reading and eventually answering.
    FB

    ___________________________________________

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From john.aspinall@gmail.com@21:1/5 to fbek...@gmail.com on Fri Feb 19 01:53:03 2021
    Try:

    (self view viewNamed: 'bar') model value: 'xyz'

    You can decouple the direct reference to the view by creating your own ValueModel (held in an inst var) and assigning this to the item, then addressing updates to the model, e.g.

    barModel

    ^barModel ifNil: [barModel := ValueHolder new]

    onViewOpened

    super onViewOpened.
    (self view viewNamed: 'bar') model: self barModel

    You should then be able to update the status bar item via the model, e.g.

    self barModel value: 'hello'

    HTH.

    John


    On Thursday, February 18, 2021 at 11:07:43 PM UTC, fbek...@gmail.com wrote:
    Thanks John,
    Indeed, StatusBar comes with one (StatusBarItem) and following your message, I added another one for the sake of trying, named it 'bar' and adjusted its (width) from the default (-1) to say (120) so the box extent and separators are clearly visible.

    I am still stuck on trying to communicate anything with it: trying, from within <onViewOpened> the following: (self view viewNamed: 'bar') text: 'xyz' or #value: both selectors produce a 'not understood' error, while #displayString: 'xyz' doesn't
    produce an error but doesn't produce a result either.. Is there a missing step to designate it as text box first (or icon, button, image, or anything else)?

    Do I have to drop a (TextEdit) on top of it? which I have done and, in the hierarchy tree, it shows as a child to the (StatusBar). But then, I am communicating with the (TextEdit), which has its own 'name', and not with the (StatusBarItem), which doesn'
    t seem to do much, but looks like a decorator only!?

    It seems like I am missing on the main concept here. Any further clarifications would be much appreciated.
    FB
    ___________________
    On Thursday, February 18, 2021 at 6:54:53 PM UTC+2, john.a...@gmail.com wrote:
    Hi FB,

    You can add individual fields (StatusBarItems) to a StatusBar in the View Composer - look for its 'items' aspect, you add/edit/remove/reorder items in the same way as a ListView's columns.

    If you name the StatusBarItems you can then either address them directly via their name (self view viewNamed: 'barItem'), or create a correspondingly-named TextPresenter and use them like a 'normal' text view/presenter pair.

    Hope this helps.

    John
    On Thursday, February 18, 2021 at 1:16:12 AM UTC, fbek...@gmail.com wrote:
    Beginner's question
    Dolphin Smalltalk 7.2.6

    How do you get the Status Bar to display a string?

    I can communicate with the Status Bar from a Presenter with say <(self view viewNamed: 'bar')>, but how do I get it to display anything, and update itself? Both #value: and #text: are not understood.

    And more generally, how do I add items to the StatusBar and use them?

    Thanks for reading and eventually answering.
    FB

    ___________________________________________

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From F Bek@21:1/5 to john.a...@gmail.com on Fri Feb 19 16:54:57 2021
    I tried the ValueHolder way and it kinda worked, but with some weird side effects: 

    First - the main view just remembered that it should be transparent, and as it was drawn on the screen, the main view background just disappeared and became a screen shot to whatever was below it on the desktop, albeit with a bit of scaling up. But when
    instruction <self barModel value: 'hello'> was commented out, this effect disappeared, and the view background returned to the default white. And when the <isTransparent> property was set to 'false' in 'View Composer', the effect disappeared also - fair
    game, as this should have been set to 'false' in the first place? But then, why only now?

    Second - the Status Bar doesn't only show the string, in this case ( hello ), but it precedes it with the symbol ( 'U' ), which is Dolphin's class icon for UTF-encoded strings. And, after a few trials, it seems that whatever the displayed object is (
    Float, Integer, Point, etc.), it is always preceded by its class icon - not really the desired effect. I didn't find a fix for this yet!

    What am I doing wrong?

    ______________________________________

    On Friday, February 19, 2021 at 11:53:04 AM UTC+2, john.a...@gmail.com wrote:
    Try:

    (self view viewNamed: 'bar') model value: 'xyz'

    You can decouple the direct reference to the view by creating your own ValueModel (held in an inst var) and assigning this to the item, then addressing updates to the model, e.g.

    barModel

    ^barModel ifNil: [barModel := ValueHolder new]

    onViewOpened

    super onViewOpened.
    (self view viewNamed: 'bar') model: self barModel

    You should then be able to update the status bar item via the model, e.g.

    self barModel value: 'hello'

    HTH.

    John
    On Thursday, February 18, 2021 at 11:07:43 PM UTC, fbek...@gmail.com wrote:
    Thanks John,
    Indeed, StatusBar comes with one (StatusBarItem) and following your message, I added another one for the sake of trying, named it 'bar' and adjusted its (width) from the default (-1) to say (120) so the box extent and separators are clearly visible.

    I am still stuck on trying to communicate anything with it: trying, from within <onViewOpened> the following: (self view viewNamed: 'bar') text: 'xyz' or #value: both selectors produce a 'not understood' error, while #displayString: 'xyz' doesn't
    produce an error but doesn't produce a result either.. Is there a missing step to designate it as text box first (or icon, button, image, or anything else)?

    Do I have to drop a (TextEdit) on top of it? which I have done and, in the hierarchy tree, it shows as a child to the (StatusBar). But then, I am communicating with the (TextEdit), which has its own 'name', and not with the (StatusBarItem), which
    doesn't seem to do much, but looks like a decorator only!?

    It seems like I am missing on the main concept here. Any further clarifications would be much appreciated.
    FB
    ___________________
    On Thursday, February 18, 2021 at 6:54:53 PM UTC+2, john.a...@gmail.com wrote:
    Hi FB,

    You can add individual fields (StatusBarItems) to a StatusBar in the View Composer - look for its 'items' aspect, you add/edit/remove/reorder items in the same way as a ListView's columns.

    If you name the StatusBarItems you can then either address them directly via their name (self view viewNamed: 'barItem'), or create a correspondingly-named TextPresenter and use them like a 'normal' text view/presenter pair.

    Hope this helps.

    John
    On Thursday, February 18, 2021 at 1:16:12 AM UTC, fbek...@gmail.com wrote:
    Beginner's question
    Dolphin Smalltalk 7.2.6

    How do you get the Status Bar to display a string?

    I can communicate with the Status Bar from a Presenter with say <(self view viewNamed: 'bar')>, but how do I get it to display anything, and update itself? Both #value: and #text: are not understood.

    And more generally, how do I add items to the StatusBar and use them?

    Thanks for reading and eventually answering.
    FB

    ___________________________________________

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From john.aspinall@gmail.com@21:1/5 to fbek...@gmail.com on Mon Feb 22 02:35:35 2021
    I'm not sure what's happening with the transparency issue, but you can get rid of the icon by setting the StatusBarItem's getImageBlock to nil.

    On Saturday, February 20, 2021 at 12:54:58 AM UTC, fbek...@gmail.com wrote:
    I tried the ValueHolder way and it kinda worked, but with some weird side effects:

    First - the main view just remembered that it should be transparent, and as it was drawn on the screen, the main view background just disappeared and became a screen shot to whatever was below it on the desktop, albeit with a bit of scaling up. But
    when instruction <self barModel value: 'hello'> was commented out, this effect disappeared, and the view background returned to the default white. And when the <isTransparent> property was set to 'false' in 'View Composer', the effect disappeared also -
    fair game, as this should have been set to 'false' in the first place? But then, why only now?

    Second - the Status Bar doesn't only show the string, in this case ( hello ), but it precedes it with the symbol ( 'U' ), which is Dolphin's class icon for UTF-encoded strings. And, after a few trials, it seems that whatever the displayed object is (
    Float, Integer, Point, etc.), it is always preceded by its class icon - not really the desired effect. I didn't find a fix for this yet!

    What am I doing wrong?

    ______________________________________
    On Friday, February 19, 2021 at 11:53:04 AM UTC+2, john.a...@gmail.com wrote:
    Try:

    (self view viewNamed: 'bar') model value: 'xyz'

    You can decouple the direct reference to the view by creating your own ValueModel (held in an inst var) and assigning this to the item, then addressing updates to the model, e.g.

    barModel

    ^barModel ifNil: [barModel := ValueHolder new]

    onViewOpened

    super onViewOpened.
    (self view viewNamed: 'bar') model: self barModel

    You should then be able to update the status bar item via the model, e.g.

    self barModel value: 'hello'

    HTH.

    John
    On Thursday, February 18, 2021 at 11:07:43 PM UTC, fbek...@gmail.com wrote:
    Thanks John,
    Indeed, StatusBar comes with one (StatusBarItem) and following your message, I added another one for the sake of trying, named it 'bar' and adjusted its (width) from the default (-1) to say (120) so the box extent and separators are clearly visible.


    I am still stuck on trying to communicate anything with it: trying, from within <onViewOpened> the following: (self view viewNamed: 'bar') text: 'xyz' or #value: both selectors produce a 'not understood' error, while #displayString: 'xyz' doesn't
    produce an error but doesn't produce a result either.. Is there a missing step to designate it as text box first (or icon, button, image, or anything else)?

    Do I have to drop a (TextEdit) on top of it? which I have done and, in the hierarchy tree, it shows as a child to the (StatusBar). But then, I am communicating with the (TextEdit), which has its own 'name', and not with the (StatusBarItem), which
    doesn't seem to do much, but looks like a decorator only!?

    It seems like I am missing on the main concept here. Any further clarifications would be much appreciated.
    FB
    ___________________
    On Thursday, February 18, 2021 at 6:54:53 PM UTC+2, john.a...@gmail.com wrote:
    Hi FB,

    You can add individual fields (StatusBarItems) to a StatusBar in the View Composer - look for its 'items' aspect, you add/edit/remove/reorder items in the same way as a ListView's columns.

    If you name the StatusBarItems you can then either address them directly via their name (self view viewNamed: 'barItem'), or create a correspondingly-named TextPresenter and use them like a 'normal' text view/presenter pair.

    Hope this helps.

    John
    On Thursday, February 18, 2021 at 1:16:12 AM UTC, fbek...@gmail.com wrote:
    Beginner's question
    Dolphin Smalltalk 7.2.6

    How do you get the Status Bar to display a string?

    I can communicate with the Status Bar from a Presenter with say <(self view viewNamed: 'bar')>, but how do I get it to display anything, and update itself? Both #value: and #text: are not understood.

    And more generally, how do I add items to the StatusBar and use them?

    Thanks for reading and eventually answering.
    FB

    ___________________________________________

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From F Bek@21:1/5 to john.a...@gmail.com on Mon Feb 22 06:05:05 2021
    Indeed, setting 'getImageBlock' to 'nil' resolved the issue. I've included that in the <onViewOpened > method (couldn't find a way to do it in View Composer):
    (self view viewNamed: 'bar') model: self barModel ; getImageBlock: nil .

    I'll leave the transparency issue for now, until I (re)check a few more issues...

    Thanks and best regards,
    FB
    ----------------------------------------
    On Monday, February 22, 2021 at 12:35:36 PM UTC+2, john.a...@gmail.com wrote:
    I'm not sure what's happening with the transparency issue, but you can get rid of the icon by setting the StatusBarItem's getImageBlock to nil.
    On Saturday, February 20, 2021 at 12:54:58 AM UTC, fbek...@gmail.com wrote:
    I tried the ValueHolder way and it kinda worked, but with some weird side effects:

    First - the main view just remembered that it should be transparent, and as it was drawn on the screen, the main view background just disappeared and became a screen shot to whatever was below it on the desktop, albeit with a bit of scaling up. But
    when instruction <self barModel value: 'hello'> was commented out, this effect disappeared, and the view background returned to the default white. And when the <isTransparent> property was set to 'false' in 'View Composer', the effect disappeared also -
    fair game, as this should have been set to 'false' in the first place? But then, why only now?

    Second - the Status Bar doesn't only show the string, in this case ( hello ), but it precedes it with the symbol ( 'U' ), which is Dolphin's class icon for UTF-encoded strings. And, after a few trials, it seems that whatever the displayed object is (
    Float, Integer, Point, etc.), it is always preceded by its class icon - not really the desired effect. I didn't find a fix for this yet!

    What am I doing wrong?

    ______________________________________
    On Friday, February 19, 2021 at 11:53:04 AM UTC+2, john.a...@gmail.com wrote:
    Try:

    (self view viewNamed: 'bar') model value: 'xyz'

    You can decouple the direct reference to the view by creating your own ValueModel (held in an inst var) and assigning this to the item, then addressing updates to the model, e.g.

    barModel

    ^barModel ifNil: [barModel := ValueHolder new]

    onViewOpened

    super onViewOpened.
    (self view viewNamed: 'bar') model: self barModel

    You should then be able to update the status bar item via the model, e.g.

    self barModel value: 'hello'

    HTH.

    John
    On Thursday, February 18, 2021 at 11:07:43 PM UTC, fbek...@gmail.com wrote:
    Thanks John,
    Indeed, StatusBar comes with one (StatusBarItem) and following your message, I added another one for the sake of trying, named it 'bar' and adjusted its (width) from the default (-1) to say (120) so the box extent and separators are clearly
    visible.

    I am still stuck on trying to communicate anything with it: trying, from within <onViewOpened> the following: (self view viewNamed: 'bar') text: 'xyz' or #value: both selectors produce a 'not understood' error, while #displayString: 'xyz' doesn't
    produce an error but doesn't produce a result either.. Is there a missing step to designate it as text box first (or icon, button, image, or anything else)?

    Do I have to drop a (TextEdit) on top of it? which I have done and, in the hierarchy tree, it shows as a child to the (StatusBar). But then, I am communicating with the (TextEdit), which has its own 'name', and not with the (StatusBarItem), which
    doesn't seem to do much, but looks like a decorator only!?

    It seems like I am missing on the main concept here. Any further clarifications would be much appreciated.
    FB
    ___________________
    On Thursday, February 18, 2021 at 6:54:53 PM UTC+2, john.a...@gmail.com wrote:
    Hi FB,

    You can add individual fields (StatusBarItems) to a StatusBar in the View Composer - look for its 'items' aspect, you add/edit/remove/reorder items in the same way as a ListView's columns.

    If you name the StatusBarItems you can then either address them directly via their name (self view viewNamed: 'barItem'), or create a correspondingly-named TextPresenter and use them like a 'normal' text view/presenter pair.

    Hope this helps.

    John
    On Thursday, February 18, 2021 at 1:16:12 AM UTC, fbek...@gmail.com wrote:
    Beginner's question
    Dolphin Smalltalk 7.2.6

    How do you get the Status Bar to display a string?

    I can communicate with the Status Bar from a Presenter with say <(self view viewNamed: 'bar')>, but how do I get it to display anything, and update itself? Both #value: and #text: are not understood.

    And more generally, how do I add items to the StatusBar and use them?

    Thanks for reading and eventually answering.
    FB

    ___________________________________________

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From john.aspinall@gmail.com@21:1/5 to fbek...@gmail.com on Mon Feb 22 06:44:20 2021
    (couldn't find a way to do it in View Composer):

    Either double-click the item, change the code to nil and click the green tick, or just right-click the item and select 'Set to Nil'

    Cheers.

    John


    On Monday, February 22, 2021 at 2:05:06 PM UTC, fbek...@gmail.com wrote:
    Indeed, setting 'getImageBlock' to 'nil' resolved the issue. I've included that in the <onViewOpened > method (couldn't find a way to do it in View Composer):
    (self view viewNamed: 'bar') model: self barModel ; getImageBlock: nil .

    I'll leave the transparency issue for now, until I (re)check a few more issues...

    Thanks and best regards,
    FB
    ----------------------------------------
    On Monday, February 22, 2021 at 12:35:36 PM UTC+2, john.a...@gmail.com wrote:
    I'm not sure what's happening with the transparency issue, but you can get rid of the icon by setting the StatusBarItem's getImageBlock to nil.
    On Saturday, February 20, 2021 at 12:54:58 AM UTC, fbek...@gmail.com wrote:
    I tried the ValueHolder way and it kinda worked, but with some weird side effects:

    First - the main view just remembered that it should be transparent, and as it was drawn on the screen, the main view background just disappeared and became a screen shot to whatever was below it on the desktop, albeit with a bit of scaling up. But
    when instruction <self barModel value: 'hello'> was commented out, this effect disappeared, and the view background returned to the default white. And when the <isTransparent> property was set to 'false' in 'View Composer', the effect disappeared also -
    fair game, as this should have been set to 'false' in the first place? But then, why only now?

    Second - the Status Bar doesn't only show the string, in this case ( hello ), but it precedes it with the symbol ( 'U' ), which is Dolphin's class icon for UTF-encoded strings. And, after a few trials, it seems that whatever the displayed object is
    (Float, Integer, Point, etc.), it is always preceded by its class icon - not really the desired effect. I didn't find a fix for this yet!

    What am I doing wrong?

    ______________________________________
    On Friday, February 19, 2021 at 11:53:04 AM UTC+2, john.a...@gmail.com wrote:
    Try:

    (self view viewNamed: 'bar') model value: 'xyz'

    You can decouple the direct reference to the view by creating your own ValueModel (held in an inst var) and assigning this to the item, then addressing updates to the model, e.g.

    barModel

    ^barModel ifNil: [barModel := ValueHolder new]

    onViewOpened

    super onViewOpened.
    (self view viewNamed: 'bar') model: self barModel

    You should then be able to update the status bar item via the model, e.g.

    self barModel value: 'hello'

    HTH.

    John
    On Thursday, February 18, 2021 at 11:07:43 PM UTC, fbek...@gmail.com wrote:
    Thanks John,
    Indeed, StatusBar comes with one (StatusBarItem) and following your message, I added another one for the sake of trying, named it 'bar' and adjusted its (width) from the default (-1) to say (120) so the box extent and separators are clearly
    visible.

    I am still stuck on trying to communicate anything with it: trying, from within <onViewOpened> the following: (self view viewNamed: 'bar') text: 'xyz' or #value: both selectors produce a 'not understood' error, while #displayString: 'xyz' doesn'
    t produce an error but doesn't produce a result either.. Is there a missing step to designate it as text box first (or icon, button, image, or anything else)?

    Do I have to drop a (TextEdit) on top of it? which I have done and, in the hierarchy tree, it shows as a child to the (StatusBar). But then, I am communicating with the (TextEdit), which has its own 'name', and not with the (StatusBarItem),
    which doesn't seem to do much, but looks like a decorator only!?

    It seems like I am missing on the main concept here. Any further clarifications would be much appreciated.
    FB
    ___________________
    On Thursday, February 18, 2021 at 6:54:53 PM UTC+2, john.a...@gmail.com wrote:
    Hi FB,

    You can add individual fields (StatusBarItems) to a StatusBar in the View Composer - look for its 'items' aspect, you add/edit/remove/reorder items in the same way as a ListView's columns.

    If you name the StatusBarItems you can then either address them directly via their name (self view viewNamed: 'barItem'), or create a correspondingly-named TextPresenter and use them like a 'normal' text view/presenter pair.

    Hope this helps.

    John
    On Thursday, February 18, 2021 at 1:16:12 AM UTC, fbek...@gmail.com wrote:
    Beginner's question
    Dolphin Smalltalk 7.2.6

    How do you get the Status Bar to display a string?

    I can communicate with the Status Bar from a Presenter with say <(self view viewNamed: 'bar')>, but how do I get it to display anything, and update itself? Both #value: and #text: are not understood.

    And more generally, how do I add items to the StatusBar and use them?

    Thanks for reading and eventually answering.
    FB

    ___________________________________________

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From F Bek@21:1/5 to john.a...@gmail.com on Mon Feb 22 09:57:45 2021
    Of course! I don't know how I missed that, though I tried. This time, it worked.

    Thanks & regards,
    FB
    _____________________________________

    On Monday, February 22, 2021 at 4:44:22 PM UTC+2, john.a...@gmail.com wrote:
    (couldn't find a way to do it in View Composer):
    Either double-click the item, change the code to nil and click the green tick, or just right-click the item and select 'Set to Nil'

    Cheers.

    John
    On Monday, February 22, 2021 at 2:05:06 PM UTC, fbek...@gmail.com wrote:
    Indeed, setting 'getImageBlock' to 'nil' resolved the issue. I've included that in the <onViewOpened > method (couldn't find a way to do it in View Composer):
    (self view viewNamed: 'bar') model: self barModel ; getImageBlock: nil .

    I'll leave the transparency issue for now, until I (re)check a few more issues...

    Thanks and best regards,
    FB
    ----------------------------------------
    On Monday, February 22, 2021 at 12:35:36 PM UTC+2, john.a...@gmail.com wrote:
    I'm not sure what's happening with the transparency issue, but you can get rid of the icon by setting the StatusBarItem's getImageBlock to nil.
    On Saturday, February 20, 2021 at 12:54:58 AM UTC, fbek...@gmail.com wrote:
    I tried the ValueHolder way and it kinda worked, but with some weird side effects:

    First - the main view just remembered that it should be transparent, and as it was drawn on the screen, the main view background just disappeared and became a screen shot to whatever was below it on the desktop, albeit with a bit of scaling up.
    But when instruction <self barModel value: 'hello'> was commented out, this effect disappeared, and the view background returned to the default white. And when the <isTransparent> property was set to 'false' in 'View Composer', the effect disappeared
    also - fair game, as this should have been set to 'false' in the first place? But then, why only now?

    Second - the Status Bar doesn't only show the string, in this case ( hello ), but it precedes it with the symbol ( 'U' ), which is Dolphin's class icon for UTF-encoded strings. And, after a few trials, it seems that whatever the displayed object
    is (Float, Integer, Point, etc.), it is always preceded by its class icon - not really the desired effect. I didn't find a fix for this yet!

    What am I doing wrong?

    ______________________________________
    On Friday, February 19, 2021 at 11:53:04 AM UTC+2, john.a...@gmail.com wrote:
    Try:

    (self view viewNamed: 'bar') model value: 'xyz'

    You can decouple the direct reference to the view by creating your own ValueModel (held in an inst var) and assigning this to the item, then addressing updates to the model, e.g.

    barModel

    ^barModel ifNil: [barModel := ValueHolder new]

    onViewOpened

    super onViewOpened.
    (self view viewNamed: 'bar') model: self barModel

    You should then be able to update the status bar item via the model, e.g.

    self barModel value: 'hello'

    HTH.

    John
    On Thursday, February 18, 2021 at 11:07:43 PM UTC, fbek...@gmail.com wrote:
    Thanks John,
    Indeed, StatusBar comes with one (StatusBarItem) and following your message, I added another one for the sake of trying, named it 'bar' and adjusted its (width) from the default (-1) to say (120) so the box extent and separators are clearly
    visible.

    I am still stuck on trying to communicate anything with it: trying, from within <onViewOpened> the following: (self view viewNamed: 'bar') text: 'xyz' or #value: both selectors produce a 'not understood' error, while #displayString: 'xyz'
    doesn't produce an error but doesn't produce a result either.. Is there a missing step to designate it as text box first (or icon, button, image, or anything else)?

    Do I have to drop a (TextEdit) on top of it? which I have done and, in the hierarchy tree, it shows as a child to the (StatusBar). But then, I am communicating with the (TextEdit), which has its own 'name', and not with the (StatusBarItem),
    which doesn't seem to do much, but looks like a decorator only!?

    It seems like I am missing on the main concept here. Any further clarifications would be much appreciated.
    FB
    ___________________
    On Thursday, February 18, 2021 at 6:54:53 PM UTC+2, john.a...@gmail.com wrote:
    Hi FB,

    You can add individual fields (StatusBarItems) to a StatusBar in the View Composer - look for its 'items' aspect, you add/edit/remove/reorder items in the same way as a ListView's columns.

    If you name the StatusBarItems you can then either address them directly via their name (self view viewNamed: 'barItem'), or create a correspondingly-named TextPresenter and use them like a 'normal' text view/presenter pair.

    Hope this helps.

    John
    On Thursday, February 18, 2021 at 1:16:12 AM UTC, fbek...@gmail.com wrote:
    Beginner's question
    Dolphin Smalltalk 7.2.6

    How do you get the Status Bar to display a string?

    I can communicate with the Status Bar from a Presenter with say <(self view viewNamed: 'bar')>, but how do I get it to display anything, and update itself? Both #value: and #text: are not understood.

    And more generally, how do I add items to the StatusBar and use them?

    Thanks for reading and eventually answering.
    FB

    ___________________________________________

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)