The following appears to work - perhaps it is not what you want, though?
Also, this code is hard coded to assume a 1280x1024 monitor, as that
happens to be what this screen is...

-----------
// fltk-config --compile full-sc.cxx
#include <FL/Fl.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Input.H>

Fl_Double_Window *main_win=(Fl_Double_Window *)0;
Fl_Double_Window *sub_win=(Fl_Double_Window *)0;
Fl_Button *exit_bt=(Fl_Button *)0;
Fl_Input *inp_tst=(Fl_Input *)0;
Fl_Button *show_bt=(Fl_Button *)0;
Fl_Button *hide_bt=(Fl_Button *)0;

static void cb_exit_bt(Fl_Button*, void*) {
  sub_win->hide();
  main_win->hide();
}

static void cb_show_bt(Fl_Button*, void*) {
  sub_win->show();
}

static void cb_hide_bt(Fl_Button*, void*) {
  sub_win->hide();
}

int main(int argc, char **argv) {
  main_win = new Fl_Double_Window(1280, 1024); // hard coded for now
  main_win->begin();

  exit_bt = new Fl_Button(40, 395, 64, 20, "Quit");
  exit_bt->box(FL_THIN_UP_BOX);
  exit_bt->callback((Fl_Callback*)cb_exit_bt);
  exit_bt->clear_visible_focus();

  inp_tst = new Fl_Input(40, 46, 155, 34);
  inp_tst->box(FL_THIN_DOWN_BOX);

  show_bt = new Fl_Button(215, 395, 64, 20, "Show");
  show_bt->box(FL_THIN_UP_BOX);
  show_bt->callback((Fl_Callback*)cb_show_bt);
  show_bt->clear_visible_focus();

  hide_bt = new Fl_Button(285, 395, 64, 20, "Hide");
  hide_bt->box(FL_THIN_UP_BOX);
  hide_bt->callback((Fl_Callback*)cb_hide_bt);
  hide_bt->clear_visible_focus();

  main_win->clear_border();
  main_win->end();
  main_win->show(argc, argv);

  sub_win = new Fl_Double_Window(500, 200, 400, 300); // hard coded for
now
  sub_win->begin();
  Fl_Button *bb;
  bb = new Fl_Button(20, 20, 64, 20, "Click");
  bb->box(FL_THIN_UP_BOX);
  bb->clear_visible_focus();
  bb = new Fl_Button(20, 120, 64, 20, "Hide");
  bb->box(FL_THIN_UP_BOX);
  bb->clear_visible_focus();
  bb->callback((Fl_Callback*)cb_hide_bt);
  sub_win->end();
  sub_win->box(FL_BORDER_BOX);
  sub_win->set_non_modal();
  sub_win->clear_border();

  return Fl::run();
} // main

/* end of file */
SELEX Sensors and Airborne Systems Limited
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 
3EL
A company registered in England & Wales.  Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************

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

Reply via email to