Gold 6 not displaying text in a static text box that is displayed by 5.32 and 5.42

I created the code below using TBilt (what a great little program, by the way!). The text in CALL TC_SText_Create (stextid_1, "Enter values for degrees of freedom and F", 236, 600, 100, 72) displays when I run this program in versions 5.32 and 5.42, both from the Editor and in their bound versions. But this text is not displayed when it is run from the version 6 Editor, nor is it displayed when I bind it by dragging it on to the version 6 tbsystem.exe. I've also bound it using the version 6 tbsystem.exe and the version 5.42 TrueControl libraries. Still no show -- so it looks like the problem is in the new tbsystem.exe file.

Here's the code. You will no doubt have to alter the location of the libraries

! this program computes eta-square given information from the analysis of variance.
! The formula is taken from the 4th ed of the APA Publication Manual, p. 18
! and is accurate to 4 decimal places

LIBRARY "C:\Program Files\True BASIC Gold Edition v.6.0\TBLibs\truectrl.trc", "C:\Program Files\True BASIC Gold Edition v.6.0\TBLibs\truedial.trc"
LIBRARY "C:\bill\tbasic\library\stat1lib.trc"

DECLARE DEF Fprob

PUBLIC stextid_5b, stextid_4b

CALL TC_Init ! Initialize TrueControls
CALL TC_SetUnitsToPixels ! Temporary...
CALL TC_Show (0) ! So we have something to see

! SECTION 1 *** CREATE WINDOW HERE ***

CALL TC_Win_Create (winid_1, "TITLE|CLOSE|SIZE", 77, 886, 756, 125)
CALL TC_Show (winid_1)
CALL TC_Win_SetTitle (winid_1, "F-to-eta-square")

! SECTION 2 *** INSERT MENU CREATION CODE HERE ***

! SECTION 3 *** CREATE INTERFACE COMPONENTS HERE ***

CALL TC_SText_Create (stextid_5b, "", 553, 644, 232, 208)

CALL TC_SText_Create (stextid_4b, "", 553, 644, 180, 156)

CALL TC_SText_Create (stextid_5a, " p =", 495, 550, 235, 211)

CALL TC_SText_Create (stextid_4a, " eta^2 =", 495, 550, 192, 158)

CALL TC_Edit_Create (editid_3, "", 95, 180, 270, 246)

CALL TC_Edit_Create (editid_2, "", 93, 178, 222, 198)

CALL TC_Edit_Create (editid_1, "", 92, 177, 178, 154)

CALL TC_SText_Create (stextid_3, " F =", 44, 90, 274, 249)

CALL TC_SText_Create (stextid_2, "df 2 =", 43, 90, 224, 199)

CALL TC_SText_Create (stextid_1, "df 1 =", 43, 90, 181, 156)

CALL TC_PushBtn_Create (pbid_1, "Calculate", 334, 436, 230, 191)

CALL TC_PushBtn_Create (pbid_2, "Exit", 335, 437, 383, 344)

CALL TC_Groupbox_Create (grbid_2, "Output", 467, 762, 389, 112)

CALL TC_Groupbox_Create (grbid_1, "Input", 25, 309, 389, 112)

CALL TC_Groupbox_Create (grbid_1, "Effect size for the Analysis of Variance", 155, 623, 110, 40)

CALL TC_SText_Create (stextid_1, "Enter values for degrees of freedom and F", 236, 600, 100, 72)

! SECTION 4 *** OTHER INITIALIZATION ***

! SECTION 5 *** EVENT LOOP ***

DO
CALL TC_Event (timer, event$, window, x1, x2)

SELECT CASE event$
CASE "KEYPRESS"
IF x1 = 27 THEN
EXIT DO ! Exit the event loop when Escape pressed
END IF

CASE "HIDE"
IF window = 0 then
PRINT "Just closed the default output window"
PAUSE 2
EXIT DO ! Alternate exit

END IF

! Window-related events
CASE "MENU" ! x1 = menu number, x2 = menu item
CALL ProcessMenu (window, x1, x2)

! Control-related events. x2 = control id
CASE "CONTROL SINGLE"
CASE "CONTROL DOUBLE"
CASE "CONTROL SELECT"
CASE "CONTROL DESELECTED"
IF x2 = editid_5 then
CALL CB_ListEdit_editid_5 (x1, x2)
ELSE IF x2 = editid_4 then
CALL CB_ListEdit_editid_4 (x1, x2)
ELSE IF x2 = editid_3 then
CALL CB_ListEdit_editid_3 (x1, x2)
ELSE IF x2 = editid_2 then
CALL CB_ListEdit_editid_2 (x1, x2)
ELSE IF x2 = editid_1 then
CALL CB_ListEdit_editid_1 (x1, x2)
ELSE IF x2 = pbid_1 then
CALL CB_PushBtn_pbid_1 (x1, x2)
ELSE IF x2 = pbid_2 then ! exit
LET message$ = "Version 2.0, 12 November 2010. Written by W. L. Roberts."
LET message$ = message$ & "|Updates available at http://www.tru.ca/faculty/wlroberts/"

CALL TD_Message ("Now leaving F-to-eta-square", message$, "Exit|Cancel", default, result)

IF result = 1 then EXIT DO
END IF

CASE ELSE
END SELECT

LOOP

CALL TC_Cleanup

SUB ProcessMenu (w, m, i)

PRINT "You just selected item "; i; " from menu "; m

END SUB

END

MODULE CallBack

! *** INSERT CALL BACK ROUTINES HERE ***

SHARE df1, df2, F
DECLARE DEF Fprob
DECLARE PUBLIC stextid_5b, stextid_4b

SUB CB_ListEdit_editid_5 (x1, x2)

CALL TC_GetText (x2, t$)
PRINT "Now showing in edit field: " & t$

END SUB

SUB CB_ListEdit_editid_4 (x1, x2)

CALL TC_GetText (x2, t$)
PRINT "Now showing in edit field: " & t$

END SUB

SUB CB_ListEdit_editid_3 (x1, x2)

CALL TC_GetText (x2, t$)
LET F = val(t$)

END SUB

SUB CB_ListEdit_editid_2 (x1, x2)

CALL TC_GetText (x2, t$)
LET df2 = val(t$)

END SUB

SUB CB_ListEdit_editid_1 (x1, x2)

CALL TC_GetText (x2, t$)
LET df1 = val(t$)

END SUB

SUB CB_PushBtn_pbid_1 (x1, x2)
WHEN error in
LET eta2 = (df1*F) / (df1*F + df2)
USE
LET message$ = "Error! Check values of degrees of freedom and F"
CALL TD_Message ("Error", message$, "Continue", default, result)
EXIT SUB
END WHEN
LET eta$ = using$("#.###", eta2)
CALL TC_SetText (stextid_4b, eta$)

LET p= 1 - Fprob(df1, df2, F)
LET p$ = using$(".###", p)
CALL TC_SetText (stextid_5b, p$)

END SUB

END MODULE

Comments

cancel this -- I figured it out

In 5.32 and 5.42, TC_Groupbox_Create has to come before TC_SText_Create, and in 5.5 and 6.0, it has to come after. Live and learn.

GROUP BOX

Hi Bill,

The version 6 editor uses the TBsystem file from version 5.5b19 and there is a known Group Box bug in 5.5b19. For this amd many other reasons the version 6 editor can switch TBsystem to version 5.31. This is done with the BINDER option under settings.

As you say, TBILT is a great little program. Wait until you see what FORMS can do - much more and easier.

Regards
Big John