--- In iolanguage%40yahoogroups.com">iolanguage
yahoogroups.com, Quentin Mathé <gnustep-quentin
...>
wrote:
>
> Le 29 oct. 06 à 20:32, baptisteheyman a écrit :
> > --- In iolanguage%40yahoogroups.com">iolanguage
yahoogroups.com, "baptisteheyman"
> > <baptisteheyman
>
> > wrote:
> > >
> > >
> > > --- In iolanguage%40yahoogroups.com">iolanguage
yahoogroups.com, Quentin Mathé
> > > gnustep-quentin
wrote:
> > > >
> > > > Le 29 oct. 06 à 12:39, baptisteheyman a écrit :
> > > > >
> > > > > To make your Io variable visible on the Objective-C side you
> > could
> > > > > just add getter/setter methods.
> > > > >
> > > > > NSObject newSubclassNamed:("Controller") do(
> > > > > setTableView: := method(sender, self tableView := sender)
> > > > > setWindow: := method(sender, self window := sender)
> > > > > _myVar := "whatever"
> > > > > myVar := method(_myVar)
> > > > > setMyVar: := method(value, _myVar = value)
> > > > > )
> > > >
> > > > I will try that.
> Well, this solution doesn't work. _myVar slot isn't created, I get
> 'slot not found error' for _myvar when I access myVar.
> I succeedded by declaring myVar in init method somewhat as you
> suggested in this mail. Here is my code:
>
> Controller init := method(
> self do(
> _myVar := "blabla"
> myVar := method(_myVar)
> setMyVar: := method(value, _myVar = value)
> )
> )
>
> > Yes, we could just add instance variables at class creation, but how
> > would you access them from Io then ? We still need getter/setter
> methods
> > so we're stuck unless we allow direct access to Objective-C instance
> > variables. It is feasible, it was even implemented but it was
> really not
> > needed, sharing methods between Io and Objective-C is sufficient.
>
> Direct access to instance vars could be helpful in some cases I think.
>
> > For your last question, well, i'm not sure to get what you want,
> do you
> > want to load non GNUstep Objective-C code ?
>
> Yes. Like GNUstep-based AddressBook framework to take an example.
>
> > If so, bundle loading should
> > do the trick, else you could hack the ObjcBridge build.io and add the
> > dependsOnLib/dependsOnFramework line you need.
>
> ok
>
> > Anyway if your code
> > declare an informal protocol (not compiler enforced methods) you
> should
> > add it at the end of IoObjcBridge.h and in
> > IoObjcBridge_selectorEncoding. Do you want a standalone compiled
> program
> > or a script like in
> > http://www.etoile-project.org/etoile/blog/2006/09/io-and-gnustep.html
>
> Initially a script, I used Calc.app as a template to begin (in fact
> it's a new application to be included in Étoilé project).
>
> Got a new question. I have tried to implement a table view with a
> data source, but I'm currently stumbling on passing a selector as a
> parameter an Objc method when the method is called in Io code. Here
> is my attempt to do it:
>
> Controller awakeFromNib := method(
> // a bunch of code
>
> tableView setDoubleAction:("listViewDoubleClick:")
> tableView setTarget:(self)
> )
>
> Controller listViewDoubleClick: := method(sender,
> "Doucle click!" println
> )
>
> Io interpreter complains about "listViewDoubleClick:" not being of
> the correct type.
>
> Quentin.
>
> --
> Quentin Mathé
> qmathe
...
>
Sorry for the slot problem, I realised afterward it would not work so
I modified my previous message to introduce another method slightly
before you answered.
On the "listViewDoubleClick:" not being of the correct type problem, I
don't have enough code to work it out, could you mail/paste me a
"working" example ? Does the problem occur when you double click in a
tableView cell or is it directly at launch time ?
.