Clock widget not showing when put in Gtk::Grid.



Hi all,

I did
https://developer.gnome.org/gtkmm-tutorial/stable/sec-drawing-clock-example.html.en
which worked.

Then I changed main.cc to:

#include "clock.h"
#include <gtkmm/application.h>
#include <gtkmm/window.h>
#include <gtkmm.h>

int main(int argc, char** argv)
{
   auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");

   Gtk::Window win;
   win.set_title("Cairomm Clock");

   Gtk::Grid m_grid;
   Clock c;
   m_grid.add(c);
   win.add(m_grid);
   c.show();
   m_grid.show();

   return app->run(win);
}

But this just gives a totally empty window. The clock is gone.
How can I fix this?

Carlo


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]