<div dir="ltr">Another Idea for you Glen,<br><br>Instead of using Close,&nbsp; and Destroy to get rid of the dialog, if it&#39;s a Dialog that is used quite often, I would opt to use show_modal, and end_modal, and after end_modal is called, just call hide, instead of destroy.<br>
<br>An Example of this:<br><br>class MyDialog &lt; Wx::Dialog<br>&nbsp; def initialize(*args)<br>&nbsp;&nbsp;&nbsp; super<br>&nbsp;&nbsp;&nbsp; ok = Wx::Button.new(self,Wx::ID_OK,&quot;&amp;Ok&quot;)<br>&nbsp;&nbsp;&nbsp; cancel = Wx::Button.new(self,Wx::ID_CANCEL,&quot;&amp;Cancel&quot;)<br>
&nbsp;&nbsp;&nbsp; # ...... Add your own controls ......<br>&nbsp;&nbsp;&nbsp; evt_button(Wx::ID_OK) do<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # ...... do whatever processing you need .......<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end_modal(Wx::ID_OK)<br>&nbsp;&nbsp;&nbsp; end<br>&nbsp;&nbsp;&nbsp; evt_button(Wx::ID_CANCEL) do<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # ...... Ask any, &quot;Are you sure you want to cancel&quot; here ........<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Or don&#39;t even put this handler in, as it&#39;s automatically handled by Wx::Dialog<br>&nbsp;&nbsp;&nbsp; end<br>&nbsp; end<br>end<br><br>class MyFrame &lt; Wx::Frame<br>&nbsp; def initialize(*args)<br>&nbsp;&nbsp;&nbsp; super<br>&nbsp;&nbsp;&nbsp; # We create our dialog that we are going to use a lot, and show only<br>
&nbsp;&nbsp;&nbsp; # when needed.<br>&nbsp;&nbsp;&nbsp; @dlg = MyDialog.new(self,-1,&quot;Information Report&quot;)<br>&nbsp;&nbsp;&nbsp; # .... add the rest of the stuff .......<br>&nbsp;&nbsp;&nbsp; evt_button(ID_SHOW_DIALOG) do<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @dlg.show_modal do |response|<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # ..... process response .....<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @dlg.hide<br>&nbsp;&nbsp;&nbsp; end<br>&nbsp; end<br>end<br><br>This is just a bare bone example, that will not work, least you actually put it together.&nbsp; But it gives you an idea of how to use it, especially when you re-use a dialog multiple times.<br>
<br>Hope this helps,<br><br>Mario Steele<br><div class="gmail_quote">On Fri, Oct 10, 2008 at 4:18 PM, Glen Holcomb <span dir="ltr">&lt;<a href="mailto:damnbigman@gmail.com">damnbigman@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr"><div><div></div><div class="Wj3C7c">On Fri, Oct 10, 2008 at 2:54 PM, Glen Holcomb <span dir="ltr">&lt;<a href="mailto:damnbigman@gmail.com" target="_blank">damnbigman@gmail.com</a>&gt;</span> wrote:<br><div class="gmail_quote">
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr"><div><div></div><div>On Fri, Oct 10, 2008 at 3:48 AM, Alex Fenton <span dir="ltr">&lt;<a href="mailto:alex@pressure.to" target="_blank">alex@pressure.to</a>&gt;</span> wrote:<br><div class="gmail_quote">
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Glen<div><br>
<br>
Glen Holcomb wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
It would appear that the only instruction that doesn&#39;t run at the end of on_okay is close, exit works fine. &nbsp;This kind of blows, I suppose I&#39;ll have to start another instance of the app and exit after the populate finishes, not the cleanest solution.<br>



</blockquote>
<br></div>
I&#39;m sure you won&#39;t need to do this.<br>
<br>
Generally, if you want help, please reduce the code to a standalone, runnable, and ideally short sample. I&#39;m very happy to help, but it&#39;s too much to expect people to install extra libraries and second-guess what the rest of your app is doing.<br>



<br>
I did try running your code, pruned of the LDAP stuff. It seems fine to me - there&#39;s nothing in the dialog layout itself. I would suggest checking that the dialog has an explicit parent, not nil - it is better in most cases that the dialog is linked to a parent frame. In the special case that an application consists only of a single dialog, you must use Dialog#destroy to end the app, close is not sufficient.<br>



<br>
If this doesn&#39;t help, I would look further into net/ldap and see whether this is causing it to hang - ie, if ok does nothing but &#39;close&#39; does it work fine?<br>
<br>
cheers<div><div></div><div><br>
alex<br>
<br>
<br>
_______________________________________________<br>
wxruby-users mailing list<br>
<a href="mailto:wxruby-users@rubyforge.org" target="_blank">wxruby-users@rubyforge.org</a><br>
<a href="http://rubyforge.org/mailman/listinfo/wxruby-users" target="_blank">http://rubyforge.org/mailman/listinfo/wxruby-users</a><br>
</div></div></blockquote></div><br></div></div>Hey Alex,<br><br>Thanks for the reply, destroy did the trick.&nbsp; I don&#39;t know why I didn&#39;t try that before, according to my browser I&#39;d looked at the method definition in the API docs.&nbsp; Odd that close doesn&#39;t work, I&#39;m creating this dialog the same way I do all my others and close works for them.<div>

<br clear="all">
<br>-- <br>&quot;Hey brother Christian with your high and mighty errand, Your actions speak so loud, I can&#39;t hear a word you&#39;re saying.&quot; <br><br>-Greg Graffin (Bad Religion)<br>
</div></div>
</blockquote></div><br></div></div>I have another dialog behaving the same way now.&nbsp; My application has one frame and from that frame I&#39;m passing self as the parent argument for the Dialog Windows.&nbsp; I do this for other dialogs created by button events and it works okay.&nbsp; The dialogs that are unresponsive after pressing okay are created through menu events should I be doing something differently when creating a dialog from a menu option?<br>

<br>I will try to pair my code down and post a small working example but it will take a while.&nbsp; If anyone has any ideas off the top of their head I&#39;m all ears.&nbsp; Dialog#destroy does work so I can always do that.<div class="Ih2E3d">
<br clear="all">
<br>-- <br>&quot;Hey brother Christian with your high and mighty errand, Your actions speak so loud, I can&#39;t hear a word you&#39;re saying.&quot; <br><br>-Greg Graffin (Bad Religion)<br>
</div></div>
<br>_______________________________________________<br>
wxruby-users mailing list<br>
<a href="mailto:wxruby-users@rubyforge.org">wxruby-users@rubyforge.org</a><br>
<a href="http://rubyforge.org/mailman/listinfo/wxruby-users" target="_blank">http://rubyforge.org/mailman/listinfo/wxruby-users</a><br></blockquote></div><br><br clear="all"><br>-- <br>Mario Steele<br><a href="http://www.trilake.net">http://www.trilake.net</a><br>
<a href="http://www.ruby-im.net">http://www.ruby-im.net</a><br><a href="http://rubyforge.org/projects/wxruby/">http://rubyforge.org/projects/wxruby/</a><br><a href="http://rubyforge.org/projects/wxride/">http://rubyforge.org/projects/wxride/</a><br>

</div>