[Cl-fltk-cvs] CVS cl-fltk/wrapper/test

dlah dlah at common-lisp.net
Mon Feb 27 08:26:42 UTC 2006


Update of /project/cl-fltk/cvsroot/cl-fltk/wrapper/test
In directory clnet:/tmp/cvs-serv18184/wrapper/test

Added Files:
	hello.cc helloask.cc progressbar.cc 
Log Message:
Initial import



--- /project/cl-fltk/cvsroot/cl-fltk/wrapper/test/hello.cc	2006/02/27 08:26:42	NONE
+++ /project/cl-fltk/cvsroot/cl-fltk/wrapper/test/hello.cc	2006/02/27 08:26:42	1.1
#include "run.h"
#include "window.h"
#include "group.h"
#include "widget.h"
#include "style.h"

int main(int argc , char **argv)
{
  Window* window;
  Widget* box;

  window = new_window(300,180, "bla");
  fl_group_begin(window);

  box = new_widget(20, 40, 260, 100, "Hello, World!");
  fl_widget_box(box, __UP_BOX);
  fl_widget_labelfont(box, __HELVETICA_BOLD_ITALIC);
  fl_widget_labelsize(box, 36);
  fl_widget_labeltype(box, __SHADOW_LABEL);

  fl_group_end(window);
  fl_window_show(window, argc, argv);

  fl_run();
  return 0;
}
--- /project/cl-fltk/cvsroot/cl-fltk/wrapper/test/helloask.cc	2006/02/27 08:26:42	NONE
+++ /project/cl-fltk/cvsroot/cl-fltk/wrapper/test/helloask.cc	2006/02/27 08:26:42	1.1
#include "run.h"
#include "window.h"
#include "group.h"
#include "widget.h"
#include "style.h"
#include "ask.h"
#include <stdlib.h>

void hello(Widget *w, void *data)
{
  if(fl_ask_ask("bla"))
    {
      exit(0);
    }
}

int main(int argc , char **argv)
{
  Window* window;
  Widget* box;

  window = new_window(300,180, "bla");
  callback(window, hello, 0);
  fl_group_begin(window);

  box = new_widget(20, 40, 260, 100, "Hello, World!");
  fl_widget_box(box, __UP_BOX);
  fl_widget_labelfont(box, __HELVETICA_BOLD_ITALIC);
  fl_widget_labelsize(box, 36);
  fl_widget_labeltype(box, __SHADOW_LABEL);

  fl_group_end(window);
  fl_window_show(window, argc, argv);

  fl_run();
  return 0;
}
--- /project/cl-fltk/cvsroot/cl-fltk/wrapper/test/progressbar.cc	2006/02/27 08:26:42	NONE
+++ /project/cl-fltk/cvsroot/cl-fltk/wrapper/test/progressbar.cc	2006/02/27 08:26:42	1.1
#include "run.h"
#include "window.h"
#include "group.h"
#include "widget.h"
#include "style.h"
#include "progressbar.h"

Window* w;

static void ptimer(void *o)
{
	ProgressBar *pbar = (ProgressBar *)o;
	if(pbar->position() < 100)
	{
	  pbar->step(1);
		add_timeout(0.1, ptimer, (void *)pbar);
	}
	else
		w->hide();
}

int main(int argc, char **argv) {
  ProgressBar* pbar;
  {
    Window* o = new_window(400, 100);
    o->begin();
    w = o;
    { ProgressBar* o = new_progressbar(25, 25, 330, 25, "Simple Progress Bar");
      pbar = o;
      fl_widget_box(o, ENGRAVED_BOX);
      fl_widget_clear_flag(o, ALIGN_MASK);
      fl_widget_set_flag(o, ALIGN_BOTTOM);
      fl_widget_selection_color(o, BLUE);
      fl_widget_color(o, WHITE);
      fl_widget_textcolor(o, RED);
    }
    o->end();
  }
  add_timeout(0.1, ptimer, (void *)pbar);
  w->show(argc, argv);

  return run();
}



More information about the Cl-fltk-cvs mailing list