func (this *GUI) showOrHideContainerDependingOnIfEval(ifStmt interfaces.If, conditionalContainer *ui.Box) { conditionValue := ifStmt.EvalConditionAsBool(this.Symbols) // if condition evals to true if conditionValue { conditionalContainer.Show() return } // condition evals to false conditionalContainer.Hide() }
func (this *GUI) showOrHideContainerDependingOnIfElseEval(ifElseStmt interfaces.IfElse, conditionalContainerIfBody, conditionalContainerElseBody *ui.Box) { conditionValue := ifElseStmt.EvalConditionAsBool(this.Symbols) // ifElse if block condition evals to true if conditionValue { conditionalContainerIfBody.Show() conditionalContainerElseBody.Hide() return } // condition evals to false, show else body conditionalContainerIfBody.Hide() conditionalContainerElseBody.Show() }
// attachQuestionToTable is a helper method that attaches a GUIQuestion to the supplied box func attachQuestionToTable(table *ui.Box, question *GUIQuestion) { table.Append(question.Label, false) table.Append(question.Element, false) table.Append(question.ErrorLabel, false) }