Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!pp!kauai!duanev From: duanev@kauai.ACA.MCC.COM (Duane Voth) Newsgroups: comp.windows.x Subject: Re: Message boxes and other questions Message-ID: <139@kauai.ACA.MCC.COM> Date: 30 Mar 89 17:16:52 GMT References: <1014@esatst.yc.estec.nl> Organization: MCC, Austin, TX Lines: 30 In article <1014@esatst.yc.estec.nl>, arne@yc.estec.nl (Arne Lundberg) writes: > 1) I would like to have a function that displays a message box on the > screen containing several pushbuttons. And returns back to the > calling function an indication of which button the user pressed. > The problem is > that I have to exit the function in order to come back to XtMainLoop > and at that moment I don't which button the user will press. I ran across this problem too. Insisting on returning back to XtMainLoop makes the application code look realy ugly. Calling XtMainLoop from within the function that displays the popup widget implies abuse ala setjmp/longjmp (gag!). XtMainLoop (XtAppMainLoop actually :) however is very straight forward and I can see no problem with duplicating the loop in your own function: while (global_var_that_gets_set_via_a_pushbutton) { XtAppNextEvent(app, &event); XtDispatchEvent(&event); } seems to perform admirably *and* looks pretty too. If the Xaw folks have a better way, I'd like to hear about it. This may also be an R3 only solution - I'm not familiar with R2. -- --- Effectiveness is the measure of Truth: ---- ALL systems are arbitrary! --- duane voth duanev@mcc.com --