It completely works

This commit is contained in:
Pcornat 2024-10-29 17:44:21 +01:00
parent ad879dd7a3
commit cea2c1296f
Signed by: Pcornat
GPG key ID: E0326CC678A00BDD
8 changed files with 698 additions and 58 deletions

View file

@ -1,23 +1,8 @@
//
// Created by postaron on 27/09/24.
//
#include "hello_world.hpp"
#include <iostream>
#include <gtkmm/box.h>
namespace learn_gtkmm4 {
HelloWorld::HelloWorld(const Glib::RefPtr<Gio::Menu>& menuModel) :
m_VBox(Gtk::Orientation::VERTICAL), m_menu_bar(menuModel), m_button("Hello world!") {
set_title("Hello world!");
set_default_size(1280, 720);
m_button.set_margin(10);
m_button.signal_clicked().connect(sigc::mem_fun(*this, &HelloWorld::on_button_clicked));
m_VBox.append(m_menu_bar);
m_VBox.append(m_button);
set_child(m_VBox);
}
void HelloWorld::on_button_clicked() {
std::cout << "Hello World" << std::endl;
HelloWorld::HelloWorld(BaseObjectType *cobject, const Glib::RefPtr<Gtk::Builder> &builder) :
Gtk::ApplicationWindow(cobject), m_builder(builder) {
}
} // learn_gtkmm4