You read the docs, but missed the first, most important sentence:
"UnityGUI controls make use of a special function called `OnGUI()`."
`GUI` functions can only be called inside `OnGUI()`.
↧