Article View: comp.sys.mac.oop.powerplant
Article #61Closing an LGADialog programmatically
From: Eric Albert
Date: Sun, 29 Oct 2000 13:13
Date: Sun, 29 Oct 2000 13:13
39 lines
2152 bytes
2152 bytes
In my application, I have an StDialogHandler that opens an LGADialog.
That dialog contains a button that, when clicked, creates another
StDialogHandler that opens another LGADialog (yes, I know that nested
dialogs are a poor UI). When that second dialog closes, I want the
first dialog to close as well, but I can't get that to happen. I've
tried all kinds of things:
-calling BroadcastMessage(msg_OK, nil);
-calling mOKButton->SimulateHotSpotClick();
-calling DoClose();
-calling ((StDialogHandler *)
GetSuperCommander())->ListenToMessage(msg_OK, NULL)
among others, and not one of them closes that first dialog (OK, DoClose
does, but not correctly). How do I get this code block to work?
---
StDialogHandler handler(kSecondDialogID, this);
MyDialog *dialog = dynamic_cast<MyDialog *>(handler.GetDialog());
ThrowIfNil_(dialog);
MessageT message;
dialog->Show();
do {
handler.DoDialog();
} while(message != msg_OK && message != msg_Cancel);
if (message == msg_OK) {
// Close the current dialog as well, but how?
...???...
}
---
Thanks in advance,
Eric
--
Eric Albert ejalbert@stanford.edu
http://www.stanford.edu/~ejalbert/
Technical Details
Message-ID:
<ejalbert-3C7D94.05135229102000@nntp.stanford.edu>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!sienna.impulse.net!63.208.208.143.MISMATCH!feed2.onemain.com!feed1.onemain.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.stanford.edu!nntp.stanford.edu!ejalbertShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10bcce,b84d30989c34ff62,start X-Google-Attributes: gid10bcce,public X-Google-Thread: f635e,b84d30989c34ff62,start X-Google-Attributes: gidf635e,public X-Google-Thread: f7f77,b84d30989c34ff62,start X-Google-Attributes: gidf7f77,public X-Google-ArrivalTime: 2000-10-29 05:20:05 PST Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!sienna.impulse.net!63.208.208.143.MISMATCH!feed2.onemain.com!feed1.onemain.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.stanford.edu!nntp.stanford.edu!ejalbert From: Eric Albert <ejalbert@stanford.edu> Newsgroups: comp.sys.mac.oop.powerplant,codewarrior.mac,comp.sys.mac.programmer.codewarrior Subject: Closing an LGADialog programmatically Date: Sun, 29 Oct 2000 05:13:52 -0800 Lines: 39 Message-ID: <ejalbert-3C7D94.05135229102000@nntp.stanford.edu> NNTP-Posting-Host: rivendell.stanford.edu User-Agent: MT-NewsWatcher/3.0 (PPC)