Re: Clock widget not showing when put in Gtk::Grid.
Kjell Ahlstedt via gtkmm-list <[email protected]> Thu, 6 Aug 2020 18:28:17 +0200
| Newsgroups | gmane.comp.gnome.gtkmm |
|---|---|
| Message-ID | <[email protected]> |
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
c.set_hexpand();
c.set_vexpand();
in main.cc: width=200, height=200
On 2020-08-05 20:55, Carlo Wood wrote:
> 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
_______________________________________________
gtkmm-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/gtkmm-list