2.) What GUI global? The gg_trg thing? Well, it is created anyways so I just used that.
smells like bad scoping.
These gg stuff and for example not using a initializer but calling InitTrig are all wrong, they are GUI-dependent, we can get better than that... relying on such a variable or InitTrig just makes your code less portable, it also makes it harder to use the template twice (a la JESP ...)