Hi,

I'm trying to draw into an existing X11 window using fltk2.
I tried to modify the hello.cxx accordingly (see below).
It already draws a small border in the right window when I 
pass it the (decimal) id of an existing window, but
not the whole content is rendered properly.
What am I missing?

Thanks,
Johannes


// hello.cxx (example1)
#include <stdlib.h>
#include <fltk/Window.h>
#include <fltk/Widget.h>
#include <fltk/run.h>
#include <fltk/x11.h>

using namespace fltk;

class ExtWindow : public Window {
  private:
    long id;
  public:
    ExtWindow(long id, int _w, int _h) : Window(_w, _h) {
      this->id = id;
    };
   void create() { CreatedWindow::set_xid(this, id); };
};

int main(int argc, char **argv) {
  Window *window = new ExtWindow(atol(argv[1]), 300, 180);
  window->begin();
  Widget *box = new Widget(20, 40, 260, 100, "Hello, World!");
  box->box(UP_BOX);
  box->labelfont(HELVETICA_BOLD_ITALIC);
  box->labelsize(36);
  box->labeltype(SHADOW_LABEL);
  window->end();
  window->show();
  return run();
}
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to