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

I printed the width and height values in Clock::on_draw().
With the original code: width=200, height=200
After adding a Grid, like you've done: width=1, height=1
After I also added
in width=200, height=200

On 2020-08-05 20:55, Carlo Wood wrote:
Hi all,

I did
which worked.

Then I changed 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;

   return app->run(win);

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


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