[futurebasic] Re: [FB] Problem with a window

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 2004 : Group Archive : Group : All Groups

From: Brian Stevens <brilor@...>
Date: Tue, 26 Oct 2004 18:47:55 -0700
Well, this code has several errors.

1. Unless you defined a new runtime FN (which I doubt you did), there 
is no such thing as DEF FN doDialog
      a) You probably meant to type FN doDialog but this is also wrong 
because you don't call your dialog handler from within
           a local FN
      b) ON DIALOG FN doDialog  should be in your MAIN and it should 
execute ONLY once (which is accomplished by
           putting it at the beginning of your MAIN. As it is, it is 
only executed when this FN is executed and also EVERYTIME this
           FN is executed. Both are bad ideas.
      c) The RESOURCES statement should be in your main, typically at 
the beginnning. Again, this is a global compiler
           directive and isn't a part of a local FN.

2. The button names and picture field resource numbers look like 
PG-generated. Be careful mixing PG code and non-PG code. PG expects the 
PG runtime and non-PG typically expects the appearance manager runtime.

If this response sounds like greek to you, I would suggest doing some 
studying.

Lastly, there is no way for the list to diagnose your reported problem 
based solely on the local FN for the preferences. While the coding 
errors noted above aren't helping your cause, they may not the source 
either.

Brian S.


On Oct 26, 2004, at 5:52 PM, Brian Heibert wrote:

> I still don't understand what I am doing wrong why the contents of my 
> prefs
> window appear in my editor window
> And no prefs window appears
>
> LOCAL FN prefs
> RESOURCES "TBASIC.rsrc"
> '---------------------------------------------------------------
> :                                      'CONSTANTS
> '---------------------------------------------------------------
> _tPrefs           = 7790         'I keep on changing this number to 
> see if '
>
>                                   it was a window already created
> 'Preferences window
> _picFld1class4    = 1
> _btn2WClass4      = 2
> _btn2WClass5      = 3
> _btn2WClass6      = 4
> _btn2WClass7      = 5
> _btn2WClass8      = 6
> _btn2WClass9      = 7
> _picFld9class4    = 9
> _picFld8class4    = 8
> _nameofcompiledapp= 10
> _btn11WClass4     = 11
> _picFld12class4   = 12
> _SNO              = 13
>
>
>
>   WINDOW _tPrefs,"Preferences",( 363, 215)-( 705, 599), _dialogFrame
>   PICTURE FIELD _picFld1class4,%4002,( -12,   4)-( 330,  32), 
> 7,_cropPict
>   BUTTON _btn2WClass4,_enable,"Times New Roman",(  33,  96)-( 192, 
> 112), 3
>   BUTTON _btn2WClass5,_enable,"Times",(  33, 112)-( 192, 128), 3
>   BUTTON _btn2WClass6,_enable,"New York",(  33, 128)-( 192, 144), 3
>   BUTTON _btn2WClass7,_enable,"Geneva",(  33, 144)-( 176, 160), 3
>   BUTTON _btn2WClass8,_enable,"Arial",(  33, 160)-( 192, 176), 3
>   BUTTON _btn2WClass9,_enable,"Helvetica",(  33, 176)-( 176, 192), 3
>   PICTURE FIELD _picFld9class4,%4004,(  36,  68)-( 217,  80), 
> 7,_cropPict
>   PICTURE FIELD _picFld8class4,%4003,(  36, 212)-( 210, 224), 
> 7,_cropPict
>   EDIT FIELD _nameofcompiledapp,%4002,(  32, 224)-( 208, 240), 
> 1,_leftJust
>   BUTTON _btn11WClass4,_enable,"Save",( 144, 320)-( 224, 340), 4
>   PICTURE FIELD _picFld12class4,%4005,(  36, 260)-(  74, 272), 
> 7,_cropPict
>   EDIT FIELD _SNO,%4003,(  96, 256)-( 288, 272), 1,_leftJust
>   ' If you're not using PG, add...
>   DIM gObjT,gObjL,gObjB,gObjR
> DEF FN doDialog
> ON DIALOG FN doDialog
>
> END FN
>
> --
>