On Sat, Aug 25, 2012 at 9:59 AM, Art Heimsoth <artst...@artheimsoth.com> wrote: >> On Sat, Aug 25, 2012 at 6:04 AM, Art Heimsoth >> <artst...@artheimsoth.com> wrote: >> >> If you use the setData() method the dialog disappears and if you >> take it out it works, correct? >> > No, if I have the setData() in the initDialog method, then I get the error: > 7299 *-* return self~setDlgDataFromStem(InternDlgData.) > 159 *-* self~SetData > 44 *-* MyDialog = .MyDialogClass~new(version,message) > Error 93 running C:\rexx\mitch\mac\loadlist.rex line 44: Incorrect call to > meth > od > Error 93.900: The SETDLGDATAFROMSTEM method can not be invoked on a > MYDIALOGCLA > SS when the Windows dialog does not exist
You have one of two things wrong here. Either you are misspeaking and the setData() method is not in initDialog(), or you have incorrectly put createCenter() in initDialog(). createCenter() has to come *before* the underlying Windows dialog is created. initDialog() comes *after* the underlying Windows dialog exists. Probably, your code below is in the init() method, not the initDialog() method. If so move the setData() to an initDialog() method. If on the other hand, if you do have createCenter() in the initDialog() method, you should move that to the init() method, or move it to the line immediately after the MyDialog = .MyDialogClass~new(version,message) line. Either way is common. > That area of code looks like: > parse var defaultsize xsize ysize > self~CreateCenter(xsize,ysize,progtitle "-" version, , > "THICKFRAME NOTMODAL MINIMIZEBOX MAXIMIZEBOX",,,8,100) > > /* connect to method if size/position/focus changes */ > self~ConnectPosChanged("Moved") If the above is your init() method, you can not invoke methods on self until you initialize the superclass. The above code does not show you initializing the super class. You should have posted the start of the method. Like: ::method myMethod parse var defaultsize xsize ysize self~CreateCenter(xsize,ysize,progtitle "-" version, , "THICKFRAME NOTMODAL MINIMIZEBOX MAXIMIZEBOX",,,8,100) .. Don't do the below. The ooDialog framework always makes those connections for every dialog. You're just putting 2 connections in the message table for those 3 events. > /* Connect dialog control items to class methods */ > self~ConnectButton(1,"Ok") > self~ConnectButton(2,"Cancel") > self~ConnectButton(9,"Help") At this point, from what you posted, the underlying Windows dialog you are trying to create with createCenter() does not exist. You can not do setData() until after the underlying Windows dialog exists. Which is exactly what the error condition says. > self~SetData > return InitRet > > Running without that specific setData() allows the program to display > the dialog and accept input from the first entry panel. When I select > "Ok" to process the input, it appears that the code goes to my "Ok" > method, but also returns to the statement following the > MyDialog~Execute("SHOWTOP") statement which then causes the > program to exit. The 'Ok' button closes the dialog. The execute method runs until the user closes the dialog. So, what you are seeing is exactly the way things are documented to work. Windows users expect the dialog to close when they press the Ok button. If you do not want the dialog to close when you process the input, the normal thing to do would be to add another push button, say with a label 'Process'. Connect that button to a method in your dialog and do you processing there. > The code depends on an external text file and Word from Office but > I should be able to eliminate most of that or generate a simpler test > program. Am working on that, but do not yet have it so am missing > some dependency to create the problem. Well, I have Word, so if it is not too private of a text file, you could just send it along with the program. I'd like to see the original program, to see what it is really doing under 4.1.1. Whatever it is doing, it is not doing what you think it is. For instance, in 4.1.1 when you do your setData() it is doing absolutely nothing. It can not work when the underlying Windows dialog doesn't exist. -- Mark Miesfeld ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Oorexx-users mailing list Oorexx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-users