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:
+4
-1
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user