|
|
I have solved this issue earlier, but whenever I use awake() in a new code, I have this problem.
This is the skeleton of my code and fortunately I am able to recreate the problem here :
#include "dummyClass.h" #include <FL/Fl_Double_Window.H> #include "pthread.h"
using namespace std;
IWindow *win1; int f = 0;
static void update(void *p) { cout << "updating..." << endl; win1->setBtnValue(f); f++; }
class AppManager : public IManager {
IWindow *win; public: void setWindow(IWindow *win) { this->win = win; win1 = win; }
static void* doIt(void* p) { while(1) { cout << "doing it!" << endl; int i = 0; Fl::awake(update, (void*)i); sleep(2); } }
void notify() { cout << "process started!" << endl;
pthread_t t; pthread_create(&t, NULL, AppManager::doIt, (void*)this); }
void setData(std::string data) { cout << data << endl; } };
int main(int argc, char **argv) {
IManager *manager = new AppManager(); IWindow *win = new dummyWin();
((dummyWin*)win)->setManager(manager); manager->setWindow(win);
((dummyWin*)win)->show(); return Fl::run(); }
If I use, update without awake(), the changes are not observed on the widget. If I call it in awake(), the function is not called. Where am I going wrong?
Regards Harsh
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
[ Direct Link to Message ] | |
|
| |