Habileté labels in struct

This commit is contained in:
Pcornat 2026-03-16 21:10:46 +01:00
commit a6b6e0d5bf
Signed by: Pcornat
GPG key ID: E0326CC678A00BDD
2 changed files with 20 additions and 6 deletions

View file

@ -5,6 +5,7 @@
#include <glibmm/refptr.h>
#include <gtkmm/application.h>
#include <gtkmm/builder.h>
#include <gtkmm/checkbutton.h>
#include <billy_objects.hpp>
@ -15,18 +16,26 @@ namespace learn_gtkmm4 {
}
namespace Gtk {
class Builder;
class Label;
class Button;
}
namespace gui_to_app {
template<typename T>
struct CaracInterface {
struct CaracInterface final {
T *base{ nullptr };
T *carac{ nullptr };
T *mat{ nullptr };
T *total{ nullptr };
CaracInterface() = default;
explicit CaracInterface(const std::array<std::string_view, 4> &list,
const Glib::RefPtr<Gtk::Builder> &builder) :
base(builder->get_widget<T>(list[0].data())),
carac(builder->get_widget<T>(list[1].data())),
mat(builder->get_widget<T>(list[2].data())),
total(builder->get_widget<T>(list[3].data())) {}
};
class AppWin2Back final : public Gtk::Application {