Hello.  I have an application that consists of two windows with some buttons in 
it.  One is MainMenu and the other is ManualMode.

I want to make it so that if I'm in MainMenu and press the button "ManualMode" 
the application will close the MainMenu window and will open up the ManualMode 
window.

I think the window (or GUI) ManualMode should be a function maybe.  And the a 
button inside MainMenu should have a callback with that function in it.  I 
posted thecode in case is of any help.  Both files are working code.  The main 
menu has a callback which I'm trying to follow toachieve my goal.

**********************************************************************
#include "ManualMode2.h"

int main(int argc, char **argv) {
  Fl_Double_Window* w;
  { Fl_Double_Window* o = new Fl_Double_Window(252, 110);
    w = o;
    { Fl_Button* o = new Fl_Button(25, 25, 135, 40, "MAIN MENU");
      o->color(FL_BACKGROUND2_COLOR);
      o->labelcolor((Fl_Color)1);
    }
    o->end();
  }
  w->show(argc, argv);
  return Fl::run();
}
***********************************************************************

#include "MainMenu.h"

#include <FL/fl_ask.H>
#include <stdlib.h>

void ManualMode_Callback(Fl_Widget*, void*) {
  if (!
      fl_choice("Are you sure you want to quit?", "Cancel", "Quit", 0L))return;


  exit(0);
}

int main(int argc, char **argv) {
  Fl_Double_Window* w;
  { Fl_Double_Window* o = new Fl_Double_Window(773, 496);
    w = o;
    o->color((Fl_Color)4);
    new Fl_Button(10, 30, 145, 45, "Fold In");
    new Fl_Button(10, 85, 145, 45, "Fold Out");
    new Fl_Button(10, 140, 145, 55, "Pilot");
    { Fl_Button* o = new Fl_Button(10, 420, 150, 60, "MANUAL");
      o->callback((Fl_Callback*)ManualMode_Callback);
    }
    new Fl_Button(560, 410, 195, 70, "USEFUL FUNCTIONS");
    o->end();
  }
  w->show(argc, argv);
  return Fl::run();
}
***********************************************************************

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to