X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdialog.cpp;h=5e5e390e7cadadf91d3e5af4e978d4e3f333dc33;hb=b4d0a86b77fb5146f5a4f6c76690c16204210f1a;hp=0b22e9874a8d1578266fe6b98a95ddca84cf3cc5;hpb=9ef9547b31544637aca600ac65107d5b8028c39a;p=libs%2Fgltk.git diff --git a/source/dialog.cpp b/source/dialog.cpp index 0b22e98..5e5e390 100644 --- a/source/dialog.cpp +++ b/source/dialog.cpp @@ -6,10 +6,6 @@ using namespace std; namespace Msp { namespace GLtk { -Dialog::Dialog(): - stale(false) -{ } - void Dialog::add_button(Button &button, int code) { add(button); @@ -28,26 +24,11 @@ void Dialog::set_modal(bool m) signal_ungrab_pointer.emit(); } -void Dialog::button_release(int x, int y, unsigned button) -{ - Panel::button_release(x, y, button); - if(stale) - delete this; -} - -bool Dialog::key_release(unsigned key, unsigned mod) -{ - bool result = Panel::key_release(key, mod); - if(stale) - delete this; - return result; -} - void Dialog::response(int code) { on_response(code); signal_response.emit(code); - stale = true; + set_visible(false); } @@ -59,7 +40,7 @@ Dialog::Loader::Loader(Dialog &d, WidgetMap &wm): void Dialog::Loader::action_button(const string &n, int c) { - RefPtr