DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2084
Version: 2.0-current


The attached program exposes a bug if you comment out the call to 
redraw() in the callback: after the clicked button is deleted and 
the list has shrunk there is still an image of the orginal bottom 
button, even though there is no button there any more.  It should
not be necessary to explicitly call redraw().

The Dillo team has also seen this problem when the widget is
deleted from a timeout callback, though this seems harder to 
reproduce.


Link: http://www.fltk.org/str.php?L2084
Version: 2.0-current
#include <sstream>

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

class Window : public fltk::Window {
public:
  Window();
  ~Window();
};

Window::Window() : fltk::Window(100,150,"FLTK2 Browser") {
  begin();
}

Window::~Window() {
}

class Browser : public fltk::Browser {
public:
  Browser(Window *win);
  ~Browser();
};

Browser::Browser(Window *win) :
  fltk::Browser(0,0,win->w(),win->h())
{
  begin();
}

Browser::~Browser() {
}

class App {
private:
  Window *win;
  Browser *browser;
public:
  App();
  ~App();
};

App::App() :
  win(new Window) ,
  browser(new Browser(win))
{
  for (int ii = 0; ii < 10; ii++) {
    std::ostringstream ss;
    ss << "item " << ii;
    fltk::Item *item = new fltk::Item;
    item->copy_label(ss.str().c_str());
  }
  win->show();
}

App::~App()
{
  delete win;
}

int main(void)
{
  App app;
  return fltk::run();
}
_______________________________________________
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs

Reply via email to