WebDialog Question
-
I have found the need to finally use WebDialog to create fairly simple input dialogs for some ruby's I have written. I have been successful (so far) but I have some general house keeping questions.
I will be calling the same WebDialog repeatedly during the course of a modeling session. Do I just create a new WebDialog the first time and set that to an instance variable? Then after that just 'show'? Does ..close just exit the dialoge although it's instance still there?
Do I have to worry about "cleaning it up" and setting it to 'nil' ever?
Depending on user actions my drop down needs to change. Can I just start over by assigning WebDailog.new to the same instance variable as the original?I hope these questions aren't to lame.
-
I've done that for Street Generator. Works fine.
Not sure about the cleaning up though. Not as far as I know.
-
@jhoutman said:
Do I just create a new WebDialog the first time and set that to an instance variable? Then after that just 'show'?
Yes.
Just leave the dialog open. Let the user minimize/restore as needed.
Trust Ruby and the OS to garbage collect appropriately.
If you're not already there, use this little tutorial to get started. Take the first paragraph seriously.
http://www.martinrinehart.com/models/rubies/ruby2javascript_javascript2ruby.html
-
Thanks for the response. I have written ruby's. I found the Webdialog rather obtuse but I am getting text, can tell the difference between OK button and Cancel button etc. I am slowly getting there.
-
@jhoutman said:
I found the Webdialog rather obtuse ...
Spoken like a diplomat. Some might put that more strongly.
Advertisement