Design Issues - Getting started with GUI interfaces.



I have been programming perl for sometime, but this is my first go at
designing GUI interfaces.  I am coming up against the best way to
design GUIs and would appreciate some hints on how best to structure
my code.  Here is an explanation of my specific problem:

Files:

main.pl
Main.pm
DB.pm
Farm.pm

main.pl - makes call to sub mainLoop in Main.pm that starts the program

Main.pm - 

sub mainLoop {
   -called a sub to create a tree (createTree)
   -create an HPaned object and place the tree in it
   -place the HPaned into a window
   -show all
   -etc
}

sub createTree {
   -call a routine in DB.pm to get values for the tree store
   -build the tree store and tree view
 
   # here is the problem area
   -connect the tree view to a signal_connect (row-activated)
   -have anonymous subroutine to get data from the activated row
   -pass the data to Farm.pm and construct a widget that displays
      detailed information about the row clicked on in the tree.
      This widget has to get back to mainLoop so that it can be
      added to the HPaned object and displayed.  How can I add this
      new widget to the HPaned without setting Global variables (our)
      and other types of ugliness.  

   -return the tree to mainLoop
}

Am I going about this the right way?  Any suggestions on what to
change or how to improve?

Thanks for any suggestions,

Tyler Hepworth



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]