IonicWind Software

Creative Basic => GUI Programs => Topic started by: Doc on December 31, 2011, 06:07:51 PM

Title: SetFont
Post by: Doc on December 31, 2011, 06:07:51 PM
Been trying to sneak my way back into IWB, beginning with using Creative first... and have run into a problem. In the partial code below, why does the "setfont" command under the 1st control not work? I successfully create and display the window, but noting I've tried will change the font on a cntrol.

DEF w:window
WINDOW w,0,0,529,349,@MINBOX,0,"My Stupid window",main
setwindowcolor w,rgb(240,240,240)
centerwindow w
CONTROL w,"T,Heart Rate Calculator,17,18,495,35,0x5000010B,1"
SetFont w,"Verdana",32,800,1
CONTROL w,"T,100% Of Max,13,80,88,20,0x5000010B,2"
CONTROL w,"T, 90% Of Max,13,107,88,20,0x5000010B,3"
CONTROL w,"T, 80% Of Max,13,134,88,20,0x5000010B,4"
......


Any pointers?

-Doc-

Edit: Problem Resolved...  SetFont w,"Verdana",32,800,0,1
...although I don't remember it that way, it seems that you can't leave even the optional flags blank.
Title: Re: SetFont
Post by: LarryMc on December 31, 2011, 06:58:30 PM
you left out a parameter

SetFont w,"Verdana",32,800,1
should be
SetFont w,"Verdana",32,800,0,1

LarryMc
Title: Re: SetFont
Post by: LarryMc on December 31, 2011, 07:01:12 PM
You can't omit an optional parameter AND have a parameter follow it.

The flags parameter can't be omitted for a control because the control ID will fall where the flags slot so it thinks you're trying to change the font of the window.

LarryMc
Title: Re: SetFont
Post by: Doc on December 31, 2011, 11:08:47 PM
Thanks Larry!
...I guess I had already figured it out and was updating my original post while you were posting your advice.

Much appreciated all the same, sir!