From c71738f3f47535492eadcf0e463282b681d2271f Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sun, 16 Feb 2003 12:23:35 +0000 Subject: [PATCH] let you .focus() a messagedialog --- otk/messagedialog.cc | 6 ++++++ otk/messagedialog.hh | 1 + 2 files changed, 7 insertions(+) diff --git a/otk/messagedialog.cc b/otk/messagedialog.cc index 21618981..c11a181e 100644 --- a/otk/messagedialog.cc +++ b/otk/messagedialog.cc @@ -112,6 +112,12 @@ const DialogButton& MessageDialog::run() return *_result; } +void MessageDialog::focus() +{ + if (visible()) + XSetInputFocus(**display, window(), None, CurrentTime); +} + void MessageDialog::show() { std::vector::const_iterator it, end = _buttons.end(); diff --git a/otk/messagedialog.hh b/otk/messagedialog.hh index d68c1726..cc8adc70 100644 --- a/otk/messagedialog.hh +++ b/otk/messagedialog.hh @@ -40,6 +40,7 @@ public: virtual void show(); virtual void hide(); + virtual void focus(); virtual const DialogButton& result() const { return *_result; } virtual void setResult(const DialogButton &result) { _result = &result; } -- 2.45.2