Ejemplo n.º 1
0
 def create_buttons(self):
     for properties in GUI_CONF_DICT.itervalues():
         if button_label in properties:
             print "Found a button: {}".format(properties[button_label])
             print "Creating a button for: {}".format(properties[histpath_label])
             temp_button = ROOT.TGTextButton(self.buttons_frame, "&{}".format(properties[button_label]))
             temp_button.Connect('Clicked()', "TPyDispatcher", self.dispatcher, 'Dispatch()')
             self.buttons_frame.AddFrame(temp_button, ROOT.TGLayoutHints())
Ejemplo n.º 2
0
 def create_buttons(self):
     for properties in GUI_CONF_DICT.itervalues():
         if button_label in properties:
             print "Found a button: {}".format(properties[button_label])
             print "Creating a button for: {}".format(
                 properties[histpath_label])
             temp_button = ROOT.TGTextButton(
                 self.buttons_frame, "&{}".format(properties[button_label]))
             temp_button.Connect('Clicked()', "TPyDispatcher",
                                 self.dispatcher, 'Dispatch()')
             self.buttons_frame.AddFrame(temp_button, ROOT.TGLayoutHints())
Ejemplo n.º 3
0
 def clever_dispatching(self):
     btn = ROOT.BindObject(ROOT.gTQSender, ROOT.TGTextButton)
     label = btn.GetText()
     print "Looking for a histogram for button: {}".format(label)
     for properties in GUI_CONF_DICT.itervalues():
         try:
             if properties[button_label].strip() == str(label).strip():
                 hist = self.data_file.Get(properties[histpath_label])
                 self.canvas.cd(properties[canvas_part])
                 print "Histogram has been succesfully found, drawing..."
                 hist.Draw()
                 ROOT.gPad.Update()
                 return
         except KeyError:
             continue
     else:
         print "ERROR: The button couldn't have been found"
Ejemplo n.º 4
0
 def clever_dispatching(self):
     btn = ROOT.BindObject(ROOT.gTQSender, ROOT.TGTextButton)
     label = btn.GetText()
     print "Looking for a histogram for button: {}".format(label)
     for properties in GUI_CONF_DICT.itervalues():
         try:
             if properties[button_label].strip() == str(label).strip():
                 hist = self.data_file.Get(properties[histpath_label])
                 self.canvas.cd(properties[canvas_part])
                 print "Histogram has been succesfully found, drawing..."
                 hist.Draw()
                 ROOT.gPad.Update()
                 return
         except KeyError:
             continue
     else:
         print "ERROR: The button couldn't have been found"