Home » U++ Library support » U++ Widgets - General questions or Mixed problems » ColumnList - Set(Value key, Value val) - Working right?
Re: ColumnList - Set(Value key, Value val) - Working right? [message #29163 is a reply to message #29161] |
Fri, 08 October 2010 11:16 |
mrjt
Messages: 705 Registered: March 2007 Location: London
|
Contributor |
|
|
It's a very small bug. See the definition of the Set functions:
void Set(int ii, const Value& key, const Value& val, bool canselect = true);
void Set(int ii, const Value& key, const Value& val, const Display& display, bool canselect = true);
void Set(int ii, const Value& val, bool canselect = true);
void Set(int ii, const Value& val, const Display& display, bool canselect = true);
void Set(const Value& key, const Value& val, const Display& display, bool canselect);
void Set(const Value& key, const Value& val, bool canselect);
You are intending to call Set(Value, Value) but there is no candiate for that, the closest being Set(Value, Value, bool). As there is an implicit declared from Value to int the compiler is actually choosing Set(int, Value), which sets the value using an index.
The quick solution is to add the canselect parameter to your call:
Value id = codelist.GetData();
codelist.Set(id, "Hello World!", true);
but the function definition should also be changed to have a default value.
|
|
|
Goto Forum:
Current Time: Sat Jun 01 15:13:08 CEST 2024
Total time taken to generate the page: 0.00813 seconds
|