ternary operator on text widget