I have a question about Root GUI programming.
I want to execute a code when the main window is resized. I defined the following slot and connected it to the main frame, but the slot is not executed …
Is there any way to detect window resizing?
w->SetWindowName(“Example Macro”);
w->MapSubwindows();
w->MapWindow();
}
[/code]
If this macro works for you, and if you still have problem with your code, I would suggest to post your code, or at least a macro reproducing the issue.
thank you for your reply.
Your code does work but I didn’t notice that, because in a standalone Root program, somehow the standard output is not display in the console. Could you tell me why?
By the way, what I wanted to do is to set the canvas margins when the main window is resized so that the histogram frame on the canvas is always a square. I added the slot “SetMargins()” in the attached script, but the margins are not changed as I expect. I guess it is because the status of the canvas is not updated right after the window is resized.
I’d appeciate any advice… setmargins.C (1.66 KB)