Combobox label and value

Help
2004-01-25
2004-02-17
  • F.A. Pinkse
    F.A. Pinkse
    2004-01-25

    Hi All,

    In the Designer I found the field Label of a combobox to change while editing the field vlaue.
    If I edit the field Label the value gets changed too.
    The generated soiurce refelct this behaviour.

    I would have assumed that the field value is the thing the control gets preloaded to and the field Label is the thing which is displayed to describe the control.

    Who can help me out?

    I am using Boa 0.2.8.

    With best regards,

    Frans.

     
    • Riaan Booysen
      Riaan Booysen
      2004-02-16

      The Label property in the Inspector just reflect the GetLabel and SetLabel methods you get in wxPython.

      In the same way the Value property reflects the GetValue and SetValue methods.

      What is your question though?

      Thanks,
      Riaan.

       
    • F.A. Pinkse
      F.A. Pinkse
      2004-02-16

      Hello Riaan,

      Thanks for your reply.

      I had to redo this Combobox thing again, because I had forgotten the details.
      I am using 0.2.8.

      Here is what I did and observed.

      In the Designer I created a Combobox from the palette. Selected the combobox to access its properties. Under Tab Constr I see a field Value.
      If I edit this to 'sumtin' and click an other field to get it accepted and select the Tab Props I see that 'sumtin' appeared in the field Label. I did not change this field, the Inspector did.
      If I close the Designer by accepting the changes and look at the generated code I can see the things I have done and they agree with what I see in the Inspector.

      From other controls I got the impression that the field Value is used to put in a predefined value in the control which appears when the control is presented to the user.
      While the Field Label is the text which is visible next to the control and describes what the control is all about.

      I hope this is clear enough for you.

      While waiting for your answer I will reread the description of the controls and see if I make a mistake somewhere.

      With best regards,

      Frans.

       
    • Riaan Booysen
      Riaan Booysen
      2004-02-17

      Hi Frans,

      For a few controls the Value and the Label are simply equivalent, nothing deeper to it, that's just the way it is.

      These properties are automatically picked up by Boa through introspection of the controls.

      The best I can do (to lessen such confusion) would be to add some code to the Boa wrappers for these controls to hide one of the two (probably Label).

      Cheers,
      Riaan.

       
    • F.A. Pinkse
      F.A. Pinkse
      2004-02-17

      Hello Riaan,

      Thanks for the explanation.
      From this, together with the reading I have done, I see now that Boa has no part in this.

      My appologies for spending some of your time.

      Some hiding is not a bad idea, it probably generates less code too.
      The .SetLabel code is not generated when you do not modify the Value.
      So if .GetLabel retrieves the Value there is probably no objection in not generating the .Setlabel code when modifing the Value in the Designer.

      I still enjoy using Boa-Constructor.

      With best regards,

      Frans.