In virtually every example code of GTK+ I've seen so far, the widgets of the GUI are all defined inside the main function. At first I adopted this, but then found it highly inconvenient when e.g. manipulating multiple widgets from a single callback function. Of course I could just use the 'data' gpointer for that, but wouldn't I have to wrap every widget I want to manipulate in some sort of struct first to pass it as the 'data' argument?
Anyway, to not be bound by this, I just started defining all Widgets outside the main function, so I can easily access them across all function. Are there any drawbacks to this style?