mirror of https://github.com/adamdruppe/arsd.git
dont litter as many sprite objects
This commit is contained in:
parent
017b1d9759
commit
69dc43f6bc
15
minigui.d
15
minigui.d
|
@ -3133,6 +3133,7 @@ version(win32_widgets) {
|
||||||
// eh kinda lying but i like the real time update display
|
// eh kinda lying but i like the real time update display
|
||||||
auto ev = new ScrollToPositionEvent(*widgetp, pos);
|
auto ev = new ScrollToPositionEvent(*widgetp, pos);
|
||||||
ev.dispatch();
|
ev.dispatch();
|
||||||
|
|
||||||
// the event loop doesn't seem to carry on with a requested redraw..
|
// the event loop doesn't seem to carry on with a requested redraw..
|
||||||
// so we request it to get our dirty bit set...
|
// so we request it to get our dirty bit set...
|
||||||
// then we need to immediately actually redraw it too for instant feedback to user
|
// then we need to immediately actually redraw it too for instant feedback to user
|
||||||
|
@ -3140,6 +3141,15 @@ version(win32_widgets) {
|
||||||
SimpleWindow.processAllCustomEvents();
|
SimpleWindow.processAllCustomEvents();
|
||||||
//if(this_.parentWindow)
|
//if(this_.parentWindow)
|
||||||
//this_.parentWindow.actualRedraw();
|
//this_.parentWindow.actualRedraw();
|
||||||
|
|
||||||
|
// and this ensures the WM_PAINT message is sent fairly quickly
|
||||||
|
// still seems to lag a little in large windows but meh it basically works.
|
||||||
|
if(this_.parentWindow) {
|
||||||
|
// FIXME: if painting is slow, this does still lag
|
||||||
|
// we probably will want to expose some user hook to ScrollWindowEx
|
||||||
|
// or something.
|
||||||
|
UpdateWindow(this_.parentWindow.hwnd);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
@ -10990,8 +11000,11 @@ class ImageBox : Widget {
|
||||||
///
|
///
|
||||||
public void setImage(MemoryImage image){
|
public void setImage(MemoryImage image){
|
||||||
this.image_ = image;
|
this.image_ = image;
|
||||||
if(this.parentWindow && this.parentWindow.win)
|
if(this.parentWindow && this.parentWindow.win) {
|
||||||
|
if(sprite)
|
||||||
|
sprite.dispose();
|
||||||
sprite = new Sprite(this.parentWindow.win, Image.fromMemoryImage(image_));
|
sprite = new Sprite(this.parentWindow.win, Image.fromMemoryImage(image_));
|
||||||
|
}
|
||||||
redraw();
|
redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue