gtkd/src/gtk/ComboBox.d line 195
This method did not work for me. So here my suggestion:
public void setActiveText(char[] text, bool insert=false)
{
version(DidNotWorkForMe){
int currActive = getActive();
int active = 0;
bool found = false;
setActive(active);
bool found = false;
while ( !found && active==getActive)
{
found = text==getActiveText();
++active;
}
if ( !found )
{
if ( insert )
{
appendText(text);
setActive(active);
}
else
{
//setActive(currActive);
setActive(-1);
}
}
}
else{
// This works for me ...
int active = 0;
setActive(0);
while ( getActive >= 0 ) // returns -1 if end of list if reached
{
if( text==getActiveText()){
return;
}
++active;
setActive(active);
}
// was not found, the combo has now nothing selected
if ( insert )
{
appendText(text);
setActive(active);
}
}
}