| Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next 1 | 1. Child Window layout causes crash #9131 Posted by: misi01 2006-12-03 20:49:46 Last edited by: Jeff Glatt 2006-12-13 12:08:34 (Total edited 3 times) | Run the following script. Select the OK button, then select the option FRED from the combo list. I'm getting a crash every time.
LIBRARY rexxgui
guierr = "SYNTAX"
guiheading = 1
guicreatewindow('NORMAL')
guiaddctl("COMBO 157, 33, 117, 60, DROP|VSCROLL|TABSTOP, , variable_combo")
cobol_vars.1 = 'FRED'
guiaddctltext("variable_combo", "cobol_vars")
again:
DO FOREVER
guigetmsg()
CATCH SYNTAX
CONDITION('M')
SIGNAL again
CATCH HALT
FINALLY
guidestroywindow()
END
RETURN
wm_select_variable_combo:
guiremovectl("variable_combo")
RETURN Michael | 2. A (different) crash in RPC #9158 Posted by: misi01 2006-12-05 20:43:25 Last edited by: Jeff Glatt 2006-12-12 16:15:36 (Total edited 2 times) | Try the following script...
LIBRARY rexxgui, rexxinet
guierr = "SYNTAX"
guiheading = 1
guicreatewindow('NORMAL')
again:
DO FOREVER
guigetmsg()
IF EXISTS('GuiObject') \== 0 THEN DO
IF EXISTS('GuiSignal') == 0 THEN DROP (guiobject)
tso_password = password.password_entry
END
CATCH SYNTAX
CONDITION('M')
SIGNAL again
CATCH HALT
guidestroywindow()
END
RETURN
wm_click_ok_button:
createobject("password.rex", "password.")
RETURN And the password child script...
create:
guierr = "SYNTAX"
guiheading = 1
guicreatewindow('NORMAL', -1)
RETURN
destroy:
guidestroywindow()
RETURN
wm_click_ok_button:
guigetctlvalue('password_entry')
guiwake('POST CLOSE')
RETURN What I'm seeing is a crash on the GuiGetMsg call after the user types in the password and presses RETURN.Michael | 3. #9177 Posted by: Jeff Glatt 2006-12-06 10:12:14 Last edited by: Jeff Glatt 2006-12-12 14:10:25 (Total edited 3 times) | Omg. You have a really odd user interface. You have a control appear in a window, and then when the user operates that very control, it disappears. You really should use a popup window for that sort of thing.
Anyway, the crash is due to deleting a control from within one of its own handlers. That is a very, very bad thing to do. You work at a bank, so let me give you an analogy. A customer decides to pay for some banking fee with a check. Right as he is handing you the check, you're canceling his checking account.
Don't do what you're doing. If you really insist on having controls mysteriously appearing and disappearing in your windows, just show/hide them. Or at least delete the control outside of one of its handlers, for example like this:
LIBRARY rexxgui
guicreatewindow('NORMAL')
guiaddctl("COMBO 157, 33, 117, 60, DROP|VSCROLL|TABSTOP, , variable_combo")
cobol_vars.0 = 1
cobol_vars.1 = 'FRED'
guiaddctltext("variable_combo", "cobol_vars")
again:
DO FOREVER
guigetmsg()
IF EXISTS('GuiObject') == 0 THEN DO
IF EXISTS('GuiSignal') THEN SELECT guisignal
WHEN 'DELETECOMBO' THEN guiremovectl("variable_combo")
END
END
END
RETURN
wm_select_variable_combo:
guiwake("DELETECOMBO")
RETURN | 4. #9180 Posted by: Jeff Glatt 2006-12-06 11:55:03 Last edited by: Jeff Glatt 2006-12-12 16:21:04 (Total edited 1 time) | In regard to your second problem, this is caused by the following two lines:
IF EXISTS('GuiSignal') == 0 THEN DROP (guiobject)
tso_password = password.password_entry You end up DROP'ing your "PASSWORD." child object, and then you go on to access the password_entry variable in that very child script.
Think about it. How can that variable exist if you've dropped the object? The problem is that the "password." variable in your main script still refers to an object, but one that doesn't exist any more. Bang.
If you had gotten the variable first, then things would have gone differently. Make sure you do what you need to do with the object before you DROP it. | Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next 1 |
|
|