Hello experts,
I have experienced a very strange problem with the editor: when clicking the x axis of a histogram, the pad editor shows up on the left of my TBrowser window. Sometimes editing works, sometimes the axis editor is only shown for <1 second, then some other editor is shown. As you probably didn’t understand the description, here is how to reproduce.
Run the following code (chartree.C):
[code]#include <TBrowser.h>
#include <TFile.h>
#include <TTree.h>
#include
#include
using namespace std;
void createTestFile(const char *filename) {
char c[] = “A”;
auto file = unique_ptr(TFile::Open(filename, “recreate”));
auto tree = new TTree(“t”, “t”);
tree->Branch(“c”, c, “c/C”);
mt19937 rng(0);
for (size_t i = 0; i < 5; ++i) {
uniform_int_distribution<char> rndChar('A', 'Z');
c[0] = rndChar(rng);
tree->Fill();
}
tree->Write();
}
void chartree() {
const char filename[] = “/tmp/bug.root”;
createTestFile(filename);
TFile::Open(filename);
new TBrowser;
}
[/code]
It creates a simple test tree with one /C branch, saves the tree to a file. Then it opens the file and a TBrowser window. Now:
double-click on the file /tmp/bug.root
double-click on the tree "t"
double-click on the branch “c” (a histogram is drawn)
click on View/Editor in the menu (the Pad Editor shows)
click on the x axis
Now the Pad Editor shows the settings for the x axis. However, after approx 1 second?!, it shows “Name: t::Tree” and the axis editor pad is gone. Why does this happen / how can I prevent it from happen?
Unfortunately I don’t know enough about ROOT’s internals, I found the TAxisEditor and the TGedEditor but I am not sure if that is the right place to start searching. Can anyone tell me what is going on here?