> Am 26.02.2010 10:34, Albrecht Schlosser wrote: > > Am 26.02.2010 10:20, Matthew Lai wrote: > > >> Is there a way to make a Fl_Chart have transparent background? > > > > Maybe > > > > chart2->box(FL_NO_BOX); > > > > or any frame box type. > > > > I didn't try this, though. It may not work. > > At least there is a small drawback: whenever you change the contents > of *any* chart, you must assure that both charts will be drawn (and > chart #1 before chart #2). The easiest way would IMHO be to put both > charts in an Fl_Group like this: > > Fl_Group *chart_group = new Fl_Group(...); > Fl_Chart *chart1 = new Fl_Chart(...); // assuming solid background > Fl_Chart *chart2 = new Fl_Chart(...); > chart2->box(FL_NO_BOX); // transparent > chart_group->end(); > > Whenever you change any chart, call either chart_group->redraw() > directly or call for instance chart2->parent()->redraw(). > > Of course the x/y/w/h values of both charts should be the same, > or chart1 should overlap chart2 completely. > > That said, FLTK doesn't officially support overlapping widgets, but > I think that you wouldn't get problems with this approach. > > Other than that, you would probably have to create your own chart > widget (maybe derived from Fl_Chart). > > Albrecht
That works perfectly. Thank you so much! _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

