#include PruebaWin::PruebaWin(char * title, int x, int y, int w, int h) : Fl_Window(x,y,w,h,title) { butt1 = new Fl_Button(50, 30, 150, 30, "Cambia mi color"); butt2 = new Fl_Button(225, 30, 150, 30, "Cambia mi color"); // butt1->callback(buttCb,(void *)this); // butt2->callback(buttCb,(void *)this); box = new Fl_Box(50, 80, 100, 30, "Etiqueta"); box->labelfont(FL_BOLD); box->labelsize(25); buttBox = new Fl_Button(175, 80, 200, 30, "Cambia el color de Etiqueta"); buttBox->callback(buttCb,(void *)this); // end(); // Las siguiente linea debe ir *despues* de end(). ¿Sabes por qué? // colorWin = new ColorWin("Selector de color"); // colorWin->set_modal(); } void PruebaWin::buttBoxCb(Fl_Widget * w, void * data) { // PruebaWin *win = (PruebaWin *)data; // win->colorWin->setColor(win->box->labelcolor()); // win->colorWin->show(notificameBox, win->box); } void PruebaWin::buttCb(Fl_Widget * w, void * data) { // PruebaWin *win = (PruebaWin *)data; // win->colorWin->setColor(w->color()); // win->colorWin->show(notificame, w); } void PruebaWin::notificame(void * w) { // Fl_Button *b = (Fl_Button *)w; // PruebaWin *win = (PruebaWin *)b->parent(); // b->color(win->colorWin->getRGB()); } void PruebaWin::notificameBox(void * w) { // Fl_Box *b = (Fl_Box *)w; // PruebaWin *win = (PruebaWin *)b->parent(); // b->labelcolor(win->colorWin->getRGB()); // b->redraw(); }