Jump to content
Sign in to follow this  
coockie_hunt1993

dynamically change the color of a specific item in a listbox [solved]

Recommended Posts

 

Hello everyone, I already have to apologize for my english, this is not my native language.

 

 

I come to ask your help for a concern of dialog, I am working on an administrator menu. it even built up, from a listbox to list the possible actions.

 

I would like to add "spacer" to enter the cough more clear, 

 

my listbox and filled with a loop foreach, in the array I have an element that allows me to signify that this element and a title, I get well recovered the target element, but impisible to change the eur appearance.

 

code :

//Purge List Exec list
lbClear _listExec;

{
    _Element = _ElementExecFil select _forEachIndex;
    _DysplayName = _Element select 0;
    _ActionExec = _Element select 1;
    _TypeElement = _Element select 3;
    if (_TypeElement == "TITLE") then
    {
        _listExec lbSetColor [(lbSize _listExec)-1, [1,0.3,0.4,1]];
        _listExec lbAdd format ["%1", _DysplayName];
    }else {
        _listExec lbAdd format ["%1", _DysplayName];
    };
    _listExec lbSetdata [(lbSize _listExec)-1, _ActionExec];
} forEach _ElementExecFil;

I try more solution :

 - lbSetColor

- parseText

 

 

but nothing changes, no error in the log.

 

thank you in advance for your help \m/

Share this post


Link to post
Share on other sites

Your syntax looks wrong. Also, you try to set colour before adding new item.

Try:

_index = _myLB lbAdd format ["%1", name _x];
_myLB lbSetColor [_index, [1, 0, 0, 1]];

Remember to change: _myLB

  • Thanks 1

Share this post


Link to post
Share on other sites

No problem. Just a little advice, edit post in future. Welcome to the forums by the way!

  • Thanks 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×