[Java-gnome-developer] more glade
Brought to you by:
afcowie
From: Alex M. <ale...@fa...> - 2004-01-30 20:01:06
|
Hi again, i've got a question... I'm using glade in a main class which calls a lot of controllers and other classes which instantiates Window widgets controlled by the controllers. As you can see, i'm using Model-View-Controller for programming widgets in OO paradigm. Maybe this is not the correct way using glade because i've found a little problem. I've seen that you can´t call glade files which were instantiated on a class different from the calling class. I've found a way of doing it, but i doesn't like much. The idea is having a main controller class in which glade widgets are instantiated with // WINDOW1 VARS var = Class libglade.getWidget("gladeVar"); After that, when window1 is created calling his respective class, the constructor in window1 copies all the variables created in the main controller in his own class variables (or properties). This also implies that all the events must also be declarated in this main controller. This is the only way wich i've found trying to make my OO programming with glade. I doesnt like much because it seems a little dirty but, when the project gets bigger, a good OO design helps a lot. I'd like to know your opinions. As you can see, im an OO paranoic :-) but this is one of the things why i like java (and java-gnome). -- Alex Moreno |