Guidance Forums / Reginald Rexx / Setting status bar contents from a called script

Search 搜索
Home Home

Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. Setting status bar contents from a called script
Posted by: Michael S 2010-03-09 16:32:16 Last edited by: Michael S 2010-03-09 16:33:24 (Total edited 2 times)
Assume I have a script A (a GUI script) that calls B. In A I do a GUIINFO to get the handle for the status bar control. I then call B where I want B to be able to write data to A's status bar. I call B with the following:-

PROCEDURE EXPOSE guiwindow status_bar_handle
etc etc

and further down in B I have

	status_bar = 'Default DB2 system is 'selected_database
	guisetctlvalue(status_bar_handle, 1) 

but this doesn't seem to work. Do I have to have the setting of the status bar in A ? I have other scripts with list controls - there, a call (in B) such as

guisendmsg(progress_fld, 'ADDSTRING', , string)

works with no problem, so I tried with that as well, but to no avail.
Posted by: Jeff Glatt 2010-03-11 19:15:54
Probably need to empty out the messages before you see any change.
Message3. Can't remember how to do this
Posted by: Michael S 2011-10-05 18:44:07 Last edited by: Michael S 2011-10-05 18:45:09 (Total edited 2 times)
I'm running into the same problem in another script. In A, I have

statusbarwidths.1 = 100
statusbarwidths.2 = -1
guiaddctltext('status_bar', 2, 'statusbarwidths')

and in B, I have

PROCEDURE EXPOSE sw_array guiwindow status_bar_handle
		status_bar = 'Analyzing line 'curr' of 'sourcecode.0
		guisetctlvalue(status_bar_handle, 1)

but I never see anything. Note that if I add the code to A

			status_bar_handle = get_handle('status_bar')		
			status_bar = 'Hello'

then I never see anything. If I change the code to

			status_bar_handle = get_handle('status_bar')		
			status_bar = 'Hello'

then I see Hello as expected.
Posted by: Jeff Glatt 2011-10-10 11:46:03
The GuiWindow variable first needs to be set to the handle of the window (containing the status bar).
Message5. Sorry, my bad
Posted by: Michael S 2011-10-10 20:46:09
Programming error - I thought I was passing in a valid handle, but I wasn't. Have improved my error handling for that sort of error. Thanx
Message6. I'm going to add this as an append since I fell over again with the same problem (and error)
Posted by: Michael S 2012-01-14 00:24:39
The problem (for me) was the fact that I get the handle by calling GET_HANDLE. This in turn looks through a stem variable called wdw_size.

If the control isn't there, then it won't work. Summa summarum - check the procedure called get_control_size_pos:
Message7. .... plus something Jeff suggested above
Posted by: Michael S 2012-01-14 04:07:31
If you don't see anything in the status field, try adding the following code


after your write to the status bar. That helped just now when I was wasn't seeing anything
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
© Fri 2024-7-19  Guidance Laboratory Inc. Hits:0