[futurebasic] NIB buttons don't do anything (yet)...

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : February 2010 : Group Archive : Group : All Groups

From: Brian Heibert <heibert@...>
Date: Wed, 10 Feb 2010 17:07:58 -0500
What goes in the Control Signature for a  NIB based button?
Just the NIB ID? or is there a Control signature?



Also do I define the NIB ID as a constant in the program right?

Like _mybuttonID = 3

I am having trouble getting my buttons to do something

The example has me doing this...

local fn DoDialog
'~'1
dim as long evnt, ref
evnt = dialog(0)
ref = dialog(1)
select evnt
case _btnClick
select ref
case _beepBtn : beep
case _helpBtn : beep : button _helpBtn, _grayBtn
end select
end select
end  fn


Where as I have referenced it as 

_QuitBtn = 1
_OpenBtn = 2
_NewProject = 3

local fn DoDialog
'~'1
dim as long evnt, ref
evnt = dialog(0)
ref = dialog(1)
select evnt
case _btnClick
select ref
case _QuitBtn
gFBQuit = _zTrue
case _OpenBtn
beep
case _NewProject
window close #1
end select
end select
end  fn

Here's my BuildUIFromNib fn

local mode
local fn BuildUIFromNib
'~'1
dim as IBNibRef    @ nib
dim as WindowRef   @ w
dim as OSStatus      err

err = fn CreateNibReference( fn CFSTR( "StoryTeller" ), @nib ) 
if err then stop "CreateNibReference error"

err = fn CreateWindowFromNib( nib, fn CFSTR( "ST_Splash" ), @w ) 
DisposeNibReference( nib )
if err then stop "CreateWindowFromNib error"
ShowWindow( w )

// the FB wndNum is determined by MakeIntoFBWindow's second parameter; there is nothing relevant in the nib
fn MakeIntoFBWindow( w, 1 )

end fn

I don't see what I am doing wrong (like usual) sigh
I know it is something that I haven't done or did wrong  
It's not computer error it's user error on my part I just can't finger it

Brian


Attachments: