Another singleton example

printdialog.C gives another example of using global singleton pointers.

class my_appObj : virtual public x::obj {

public:

// ...
};

typedef x::singletonptr<my_appObj> my_app;

// ..............

x::ptr<my_appObj> app_ptr;

auto main_window=x::w::main_window::create(
    []
    (const auto &main_window)
    {
        // ...

        app_ptr=x::ref<my_appObj>::create(main_window);
    });

my_app app{app_ptr};

printdialog.C uses a global singleton pointer object for: