Dear All,
I want to set a picture as the background image of the browser, I have modify 
the fltk2.0/src/Browser.cxx as follows:

void Browser::draw_clip(const Rectangle& r) {
  ......

  int bottom_y = interior.y()+HERE.position-yposition_;

+ /*
  if (bottom_y < r.b()) {
    setcolor(color());
    fillrect(r.x(), bottom_y, r.w(), r.b()-bottom_y);
  }
+ */

  .....

}

And  my code is as follows:

#include <fltk/Window.h>
#include <fltk/Browser.h>
#include <fltk/SharedImage.h>
#include <fltk/run.h>

using namespace fltk;

Window *g_win;
Browser *listBrowser;

void Select_cb(Widget *w, void *o) {

}

int main(int argc, char *argv[]) {
    g_win = new Window(0, 0, 800, 600);
    g_win->begin();

    listBrowser = new Browser(200, 0, 400, 600);
    listBrowser->image(SharedImage::get("./background.bmp"));

    listBrowser->box(NO_BOX);


    g_win->end();
    g_win->show();
    run();
    return 0;
}

I test it in X86 environment. The compile toolchain is gcc. Why the background 
image can't display?

Best regards,
Leo
_______________________________________________
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to