Hi,
Don’t write your own main() unless you really have to. You are missing an event loop; you want GUI interaction - all of that is provided if you run your code in ROOT, instead of building your own main().
(You’re missing a TApplication object; its Run() method creates an event loop.)
Axel.