Fixing the clock signal to use GLib::Dispatcher to emit the signal so the main thread updates the clockLabel widget

This commit is contained in:
Bernardo Magri
2025-03-11 17:14:32 +00:00
parent b6a6e16d3a
commit 4ff86eb027
4 changed files with 36 additions and 19 deletions
+4 -1
View File
@@ -1,5 +1,6 @@
#pragma once
#include "glibmm/dispatcher.h"
#include "minefield.hpp"
#include <memory>
#include <gtkmm.h>
@@ -32,10 +33,12 @@ class MainWindow : public Gtk::Window
void updateCell(int x, int y);
void openBombs();
void updateFlagsLabel(int flags);
void updateClockLabel(size_t time);
void updateClockLabel();
void handleClockSig(size_t);
void gameWon();
void gameOver();
sigc::connection clockSignalConn;
Glib::Dispatcher m_clockDispatch;
// void OpenNearCells(int index);
// void Explode();xo
// bool AllCellsOpened();