May 08, 2024, 08:03:10 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


SetFont

Started by Doc, December 31, 2011, 06:07:51 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Doc

December 31, 2011, 06:07:51 PM Last Edit: December 31, 2011, 06:57:06 PM by Doc
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.

LarryMc

you left out a parameter

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

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

LarryMc

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
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Doc

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!