advertisement

Article:
  Embedding F-Script into Cocoa Applications
Subject:   Re: thanks, I believe # is F-scripts symbol and have distilled something
Date:   2002-08-14 10:54:48
From:   pmougin
Response to: thanks, I believe # is F-scripts symbol and have distilled something

Basically, what you need is to make the F-Script block a target of the button. Normally, in IB, to make an object a target of a button, you juste control-drag FROM the button TO the object. Here is a somewhat not easy thing to graps with F-Script live mode: the commonly used technique described above is not what you will use to connect a button to a F-Script block! Actually this is a two step process:

First, you let know the F-Script interpreter about the button by control-dragging FROM the F-Script interpreter object TO the button and assigning the button to one of the interpreter outlet (object1 for instance).

Now, you can manipulate the button from within F-Script. This means that you can now type "object1 setTarget:[sys log:'hello'. sys beep]. object1 setAction:#value:]" in the F-Script live mode window. This will establish the block [sys log:’hello’. sys beep] as the target of the button.


Phil