[ROOT] How do you run a script when a window closes?

From: Chris Milne (phycm@phy.hw.ac.uk)
Date: Fri Aug 17 2001 - 17:16:36 MEST


Hi there,

I have a script that creates a TControlBar. When one of the buttons is clicked a window is opened (Main), and the 
TcontrolBar is recreated to include extra buttons.

However when I close Main I want the Control Bar to return to it's original state, how do I do this?

First I run this script:


  TControlBar *bar;
  bar = new TControlBar("vertical", "Controls",750,10);
  bar->AddButton("Display OCP Contour Plot","display_OCP_contour()", "Click To Display Contour Plot for OCP");
  bar->AddButton("Display Blueshift and Bleaching","display_blue_blea()", "Click To Display Blueshift and Bleaching");
  bar->AddButton("","","");
  bar->AddButton("Quit",".q", "Click Here To End Your ROOT Session");
  bar->Show();
  
Then in the function display_OCP_contour() I have:

  delete bar;
  bar = new TControlBar("vertical", "Controls",750,10);
  bar->AddButton("Display OCP Contour Plot","display_OCP_contour()", "Click To Display Contour Plot for OCP");
  bar->AddButton("Display Blueshift and Bleaching","display_blue_blea()", "Click To Display Blueshift and Bleaching");
  bar->AddButton("","","");
  bar->AddButton("Unzoom Energy axis","Unzoom_energy()", "Unzoom The Energy Axis Of The Contour Plot And Slice");
  bar->AddButton("Unzoom Time axis","Unzoom_time()", "Unzoom The Time Axis Of The Contour Plot And Slice");
  bar->AddButton("","","");
  bar->AddButton("Print Time v Absorption","Print_time_abs()", "Click Here To Print The Time v Absorption Slice");
  bar->AddButton("Print Energy v Absorption","Print_energy_abs()", "Click Here To Print The Energy v Absorption Slice");
  bar->AddButton("","","");
  bar->AddButton("Quit",".q", "Click Here To End Your ROOT Session");
  bar->Show();
  
Thanks in advance
Chris Milne



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:58 MET