I have a minor problem with activating a label in tab-control. This code lets the user add or remove new tabs via clicking on Add/Remove buttons.
When the user removes the currently active label, I want to re-activate another label. I use:SAY guisetctlvalue('MyTab', newhandle) where newhandle is the label which should become active. But no label becomes activated -- they all remain "unselected". By clicking on it, it works fine.
Any idea, what is wrong?
LIBRARY rexxgui
guierr = "SYNTAX"
guiheading = 1
guicreatewindow()
tabname.0 = 0
addnewtab()
guisetctlplacement(,,,,,,'NORMAL')
again:
DO FOREVER
guigetmsg()
CATCH SYNTAX
CONDITION('M')
SIGNAL again
CATCH HALT
FINALLY
guidestroywindow()
END
RETURN
wm_selchange_mytab:
RETURN
addnewtab:
tabi = tabname.0+1
tabvalue = tab || tabi
tabname.0 = tabi
tabname.tabi = tabvalue
guiaddctltext('MyTab', tabvalue, tabi)
RETURN
removetab:
IF tabname.0 <= 1 THEN RETURN
mytab = "TAB"newhandle
guigetctlvalue('MyTab')
newhandle = tabname.0
DO i=1 TO tabname.0
IF mytable = tabname.i THEN DO
tabname.i = ''
LEAVE
END
ELSE newhandle=i
END
guiremovectltext('myTab','')
guisetctlvalue('MyTab',newhandle) tabname.newhandle 'should be active now'
RETURN
wm_click_newtab:
addnewtab()
RETURN
wm_click_removetab:
removetab()
RETURN |