mailrelax GUI layout.


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by Edward d'Auvergne on January 19, 2010 - 17:28:
Hi Michael,

I've been looking at how you've coded the GUI and have ideas on how to
improve this.  It is very difficult to follow as you have separated
the creation, binding events, and layout for each element into
separate methods.  I would like to propose the following to make this
more flexible - that these concepts are brought back together, i.e. if
I want to modify self.model_noe_1, I don't have to jump all over the
GUI code to find all references to it.  I also think we should have a
different module for each GUI element, maybe menu.py, main_window.py,
auto_model_free.py, auto_r1.py, auto_noe.py, r2.py, etc.  These would
all be in the the gui_bieri/ directory.  Oh, why is the 'res'
directory named in this way?  The calculation parts of the GUI (the
automatic analysis parts) could be in one directory, and the GUI
elements in another.  I would then have a class (or a number of
classes) in each module.  Then the UI elements for each can be placed
in its own method.  I'm essentially proposing to break up the massive
amount of code in relax_gui.py into manageable blocks.  It would then
add more flexibility.  I.e. in the relax_gui.py class there could be
some hard coded variables (these don't change so don't need to be in
the data store).  For example have the variable:

OPEN_ICON = 
sys.path[-1]+sep+'gui_bieri'+sep+'oxygen_icons'+sep+'16x16'+sep+'actions'+sep+'document-open.png'
EXIT_ICON = 
sys.path[-1]+sep+'gui_bieri'+sep+'oxygen_icons'+sep+'16x16'+sep+'actions'+sep+'system-shutdown.png'

I would also remove all the integer sizes with variables and make this
all more relative.  I.e. if I change the + button size on the
model-free analysis in one variable, all buttons change size.  The box
containing all of these will then automatically resize as well.
Breaking up the GUI elements into modules and methods, and grouping
all the actions for each element together will allow this.  What do
you think?

Regards,

Edward



Related Messages


Powered by MHonArc, Updated Tue Jan 19 18:00:10 2010