# Create TCanvas, but no window appears

**URL:** <https://root-forum.cern.ch/t/create-tcanvas-but-no-window-appears/33248>\
**Category:** ROOT\
**Created:** [March 20, 2019, 9:57am UTC](https://root-forum.cern.ch/t/create-tcanvas-but-no-window-appears/33248 "2019-03-20T09:57:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kash](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/k/7ab992/32.png) [@kash](https://root-forum.cern.ch/u/kash)\
**Post date:** [March 20, 2019, 9:57am UTC](https://root-forum.cern.ch/t/create-tcanvas-but-no-window-appears/33248/1 "2019-03-20T09:57:23Z")

</div>

* * *

_ROOT Version:_ 6.16.00  
_Platform:_ macOS Mojave 10.14.3  
_Compiler:_ Not Provided

* * *

I installed ROOT6 on macOS Mojave by Homebrew.  
The command “root” works well.  
The splash screen and root prompt appear and I can create objects, call functions, execute calculations.

Problem occurs when I create a TCanvas (or draw something: canvas with default setting created automatically).  
The following warnings are shown;

root [0] c1 = new TCanvas(“c1”,“c1”,650,400)  
Warning in TCanvas::ResizePad: c1 width changed from 0 to 10  
Warning in TCanvas::ResizePad: c1 height changed from 0 to 10  
(TCanvas \*) @0x7ffeed449908

or

root [0] h1 = new TH1D(“h1”,“h1”,10,0,10)  
(TH1D \*) @0x7ffee7c6e908  
root [1] h1-\>Draw()  
Warning in TCanvas::ResizePad: c1 width changed from 0 to 10  
Warning in TCanvas::ResizePad: c1 height changed from 0 to 10  
Info in TCanvas::MakeDefCanvas: created default TCanvas with name c1

In both case, a canvas seems to be created, but no window shows up.  
I would like to know the reason of this situation.

I can execute functions of TCanvas such as c1-\>Destructor() without errors.  
However c1-\>Print(“hoge.pdf”) doesn’t work, i.e. “hoge.pdf” is not created.  
The situation is the same when using batch mode.

I already read the following page;

> [@Canvas does not show up in OSX 10.8 with XQuartz 2.7.2?](https://root-forum.cern.ch/t/canvas-does-not-show-up-in-osx-10-8-with-xquartz-2-7-2/14688):
>
> Hi, I’ve made a clean install of Mountain Lion this week and added XQuartz 2.7.2, XCode 4.4 and command line tools. Now, the compilation of the ROOT 5.34.01 works fine with: ./configure macosx --enable-python --prefix=/usr/local/root make -I/opt/X11/include -j2 make install . /usr/local/root/bin/thisroot.sh Everything seems to be fine. The splash screen opens if I run the interactive ROOT session: However, any attempt to crate a Canvas or Draw histograms essentially does nothing: no window…

According to the replies there, I checked that the subdirectory “etc/root” is there and contains ROOT’s stuff.  
(the reply 5/6 mentions about “config.log” file, but I couldn’t find such a file in my root directory.)

What should I do to solve this?

Actually, I have another MacBook and the ROOT on it works correctly.  
The software environment is the same;  
OS: macOS Mojave 10.14.3  
ROOT: 6.16.00  
Xcode: 10.1  
XQuartz: 2.7.11 (org-server 1.18.4)  
(And what else should I check?)

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [March 20, 2019, 10:19am UTC](https://root-forum.cern.ch/t/create-tcanvas-but-no-window-appears/33248/2 "2019-03-20T10:19:49Z")

</div>

You are using the X11 version ? not the cocoa one ?

---

<div class="post-metadata">

**Author:** ![kash](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/k/7ab992/32.png) [@kash](https://root-forum.cern.ch/u/kash)\
**Post date:** [March 20, 2019, 1:35pm UTC](https://root-forum.cern.ch/t/create-tcanvas-but-no-window-appears/33248/3 "2019-03-20T13:35:34Z")

</div>

Thank you very much for your help.

Problem has been solved.

It was completely my fault that an old .rootrc existed at home directory,  
and Gui.IconPath was linked to the old version of ROOT.

(I had this problem just after I upgraded macOS from Sierra to Mojave and ROOT from 5.34.10 to 6.16.00, too)

After commenting out the line (or removing the .rootrc), a canvas does show up correctly.

I’m sorry for bothering you and thank you again for looking after my topic.

Best,  
Kash

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [April 3, 2019, 1:35pm UTC](https://root-forum.cern.ch/t/create-tcanvas-but-no-window-appears/33248/4 "2019-04-03T13:35:38Z")

</div>

Closed on April 3, 2019, 1:35pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
