/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
EventLooper::Gui::Main Class Reference

List of all members.

Public Member Functions

def __init__
def createWidgets
def hist
def drain
def quit
def next

Public Attributes

 master
 app
 b_quit
 b_next
 b_hist
 canvas_frame

Private Member Functions

def _next_cb

Private Attributes

 _canvas
 _histogram
 _nevents

Detailed Description

Definition at line 8 of file Gui.py.


Constructor & Destructor Documentation

def EventLooper::Gui::Main::__init__ (   self,
  app,
  master = None 
)

Definition at line 9 of file Gui.py.

00010                                       :
00011         Frame.__init__(self,master)
00012         self.master = master
00013         self.app = app
00014         self.pack()
00015 
00016         print 'Tk frame = "%s"' % master.frame()
00017 
00018         self.createWidgets()
00019         self._canvas = None
00020         self._histogram = None
00021         self.hist()
00022         from DybPython.Control import nuwa
00023         self._nevents = nuwa.opts.executions
00024         return


Member Function Documentation

def EventLooper::Gui::Main::createWidgets (   self)

Definition at line 25 of file Gui.py.

00026                            :
00027         b = Button(self)
00028         b['text'] = 'Quit'
00029         b['fg'] = 'red'
00030         b['command'] = self.quit
00031         b.pack({'side':'left'})
00032         self.b_quit = b
00033 
00034         b = Button(self)
00035         b['text'] = 'Next'
00036         b['command'] = self.next
00037         b.pack({'side':'left'})
00038         self.b_next = b
00039 
00040         b = Button(self)
00041         b['text'] = 'Hist'
00042         b['command'] = self.hist
00043         b.pack({'side':'left'})
00044         self.b_hist = b
00045         return

def EventLooper::Gui::Main::hist (   self)

Definition at line 46 of file Gui.py.

00047                   :
00048         print 'hist'
00049 
00050 
00051         import ROOT
00052         if self._canvas is None:
00053             print 'Making canvas'
00054 
00055             self.canvas_frame = Frame(self.master, height=500, width=500)
00056             self.canvas_frame.pack(fill=BOTH, expand=YES)
00057             tkid = self.canvas_frame.winfo_id()
00058             #rid = ROOT.gVirtualX.AddWindow(tkid,350,350)
00059             rid = tkid
00060             print 'Adding canvas window TK ID 0x%x ROOT ID 0x%x' % (tkid,rid)
00061 
00062             self._canvas = ROOT.TCanvas('canvas',350,350,rid)
00063             self._histogram = ROOT.TH1D("gaussian","gaussian",200,-10,10)
00064             self._histogram.Draw()
00065             print 'Histogram is drawn'
00066             pass
00067         self._histogram.Draw()
00068         self._histogram.FillRandom("gaus")
00069         self._canvas.Modified()
00070         self._canvas.Update()
00071 
00072         return
00073     

def EventLooper::Gui::Main::drain (   self)

Definition at line 74 of file Gui.py.

00075                    :
00076         #print 'draining'
00077         self.app.drain_queue()
00078         self.after(100, self.drain)
00079         return

def EventLooper::Gui::Main::_next_cb (   self,
  res 
) [private]

Definition at line 80 of file Gui.py.

00081                           :
00082         print 'Next event loaded'
00083         if res: print 'Result: %s'%str(res)
00084         return

def EventLooper::Gui::Main::quit (   self)

Definition at line 85 of file Gui.py.

00086                   :
00087         self.app.shutdown()
00088         Frame.quit(self)

def EventLooper::Gui::Main::next (   self)

Definition at line 89 of file Gui.py.

00090                   :
00091         if not self._nevents:
00092             self.quit()
00093         self._nevents -= 1
00094         self.app.run(self._next_cb,1)
00095         return


Member Data Documentation

Definition at line 9 of file Gui.py.

Definition at line 9 of file Gui.py.

Definition at line 9 of file Gui.py.

Definition at line 9 of file Gui.py.

Definition at line 9 of file Gui.py.

Definition at line 25 of file Gui.py.

Definition at line 25 of file Gui.py.

Definition at line 25 of file Gui.py.

Definition at line 46 of file Gui.py.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:56:15 for EventLooper by doxygen 1.7.4