# Canvas not showing on MacOS 10.15

**URL:** <https://root-forum.cern.ch/t/canvas-not-showing-on-macos-10-15/39281>\
**Category:** ROOT\
**Created:** [May 6, 2020, 7:07am UTC](https://root-forum.cern.ch/t/canvas-not-showing-on-macos-10-15/39281 "2020-05-06T07:07:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lackhole](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/lackhole/32/21866_2.png) [@lackhole](https://root-forum.cern.ch/u/lackhole)\
**Post date:** [May 6, 2020, 7:07am UTC](https://root-forum.cern.ch/t/canvas-not-showing-on-macos-10-15/39281/1 "2020-05-06T07:07:58Z")

</div>

\_ROOT Version: 6.19  
\_Platform: MacOS Catalina 10.15.4  
\_Compiler: clang 11.0.0

When I run without compiling, like `root main.cpp`, everything works well.  
But when I compile using CLion, everything except canvas works well. Only the canvas-thing is not showing.  
I’ve done

- `gSystem->ProcessEvents()`
- `gSystem->ProcessEvents()` x2
- wait for input at the end of draw

CMakeLists.txt

```auto
cmake_minimum_required(VERSION 3.15)
project(nn)
set(CMAKE_CXX_STANDARD 14)

find_package(ROOT 6.19 REQUIRED)
add_executable(nn main.cpp)

target_link_libraries(nn PUBLIC
        ROOT::Core
        ROOT::Imt
        ROOT::RIO
        ROOT::Net
        ROOT::Hist
        ROOT::Graf
        ROOT::Graf3d
        ROOT::Gpad
        ROOT::ROOTVecOps
        ROOT::Tree
        ROOT::TreePlayer
        ROOT::Rint
        ROOT::Postscript
        ROOT::Matrix
        ROOT::Physics
        ROOT::MathCore
        ROOT::Thread
        ROOT::MultiProc
        ROOT::ROOTDataFrame)

```

main.cpp

```auto
#include <iostream>
#include <chrono>
#include "TRandom3.h"
#include "TCanvas.h"
#include "TGraph.h"
#include "TSystem.h"

using std::cout;
using std::endl;

int main() {
    
    auto* rnd = new TRandom3;
    rnd->SetSeed(std::chrono::high_resolution_clock::now().time_since_epoch().count());
    auto* c1 = new TCanvas("c1","c1");
    
    cout << rnd->Gaus() << endl;
    cout << rnd->Rndm() << endl;
    
    int x[] = {1,2,3};
    int y[] = {1,2,3};
    
    c1->cd();
    auto* graph = new TGraph(3, x, y);
    graph->Draw();
    c1->Update();
    gSystem->ProcessEvents();
    gSystem->ProcessEvents();
    
    
    return 0;
}

```

CLion build messages

```auto
Compiling 'main.cpp' ...
/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake --build /Users/yonggyulee/CLionProjects/nn/cmake-build-debug --target CMakeFiles/nn.dir/main.cpp.o -- -j 6 -f /Users/yonggyulee/CLionProjects/nn/cmake-build-debug/CMakeFiles/nn.dir/build.make --always-make
Building CXX object CMakeFiles/nn.dir/main.cpp.o
/Library/Developer/CommandLineTools/usr/bin/c++ -DVECCORE_ENABLE_VC -isystem /Applications/root_v6.19.02/include -g -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -std=gnu++14 -o CMakeFiles/nn.dir/main.cpp.o -c /Users/yonggyulee/CLionProjects/nn/main.cpp

Compilation of 'main.cpp' finished

```

---

<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:** [May 6, 2020, 8:22am UTC](https://root-forum.cern.ch/t/canvas-not-showing-on-macos-10-15/39281/2 "2020-05-06T08:22:05Z")

</div>

You need a TApplication

> [@Updating canvas using TApplication](https://root-forum.cern.ch/t/updating-canvas-using-tapplication/14596):
>
> I would like to display graphics in a compiled program (using TApplication) where I can update the canvas with a press of a key. I tried this simple code (see below), but the line c1-\>Update() does not seem to display the new graphics nor does using the Draw() method. How can I refresh the canvas graphics? #include \<iostream\> #include "TMarker.h" #include "TApplication.h" #include "TCanvas.h" using namespace std; int main(int argc, char \*argv[]) { TApplication \*app = new TApplication("app",…

---

<div class="post-metadata">

**Author:** ![lackhole](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/lackhole/32/21866_2.png) [@lackhole](https://root-forum.cern.ch/u/lackhole)\
**Post date:** [May 6, 2020, 8:37am UTC](https://root-forum.cern.ch/t/canvas-not-showing-on-macos-10-15/39281/3 "2020-05-06T08:37:27Z")

</div>

That worked. Thanks!

---

<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:** [May 20, 2020, 8:37am UTC](https://root-forum.cern.ch/t/canvas-not-showing-on-macos-10-15/39281/4 "2020-05-20T08:37:27Z")

</div>

Closed on May 20, 2020, 8:37am UTC

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