[Rubycocoa-devel 696] Re: Script to add ib_outlets to classes.nib so they appear in IB

Back to archive index

Chris Mcgrath c_r_mcgra****@yahoo*****
Thu Jan 25 18:47:14 JST 2007


On 25 Jan 2007, at 06:28, Fujimoto Hisa wrote:

> Hi Guys!
>
> Thanks to Chris, excellent the suggestion also the implementation!
> it's important already it works or not :)
>

Thanks! :)

> Maybe I can agree your suggestion for generation classes.nib idea. But
> currently, I care a bit what ib_action seems required for just
> generating/managing a classes.nib file only. It's not required at
> runtime in fact. Please give me a bit time to consider about the mean.
>
> One of my point is that ib_action can stay or cannot stay as
> *optional* declaration syntax for future.
>
> another my thinking is some diffeent syntax for ib_action. for
> example...
>
>    # as primitive syntax
>    def buttonPressed(sender)
>      ...
>    end
>    ib_action :buttonPressed
>
>    # a sugar
>    ib_action(:buttonPressed) do |sender|
>      ...
>    end
>

I like the sugar :) Especially as it would allow you do do simple  
actions in a single line e.g.

ib_action(:reload) { @tableView.reloadData }

Plus it would make a nice TextMate tab trigger :)

> just now imagine up as one of possibility syntax.
> it may be the ruby way ;)
>
>    module ObjcCWrapper
>      def ib_action(name, &blk)
>        if block_given? then
>          define_method(name,blk)
>        end
>      end
>    end
>
>
> again totally I'm sure ib_action idea is excellent.
>

Looks good to me. I'm wondering if we should alias action and outlet  
to ib_action / ns_outlets too, just for 3 chars less to type and  
slightly prettier code.

> cheers!
> --
> hisa
>

Cheers,

Chris

> On 2007/01/25, at 8:27, Chris Mcgrath wrote:
>
>> (Accidently sent this to the main list first, copying here)
>>
>> I got tired of having to create classes in IB to match the ruby
>> classes I created, and manually add actions/outlets to them so things
>> would sink up so I wrote:
>>
>> http://pastie.textmate.org/35438
>>
>> Run it with -h for the options. It assumes you've only got one class
>> that calls ib/ns_outlets per file.
>>
>> The classes.nib file inside a nib seems to be an old style plist
>> format, so I've assumed that's what it is.  If this turns out not to
>> be true it could possibly mess up the nib, so make sure you have your
>> pristine copy in version control :)
>>
>> If I can find a way for it to automatically work out the class names
>> from the .rb file I will (suggestions welcome)
>>
>> Cheers,
>>
>> Chris
>>
>> _______________________________________________
>> Rubycocoa-devel mailing list
>> Rubyc****@lists*****
>> http://lists.sourceforge.jp/mailman/listinfo/rubycocoa-devel
>
> _______________________________________________
> Rubycocoa-devel mailing list
> Rubyc****@lists*****
> http://lists.sourceforge.jp/mailman/listinfo/rubycocoa-devel




More information about the Rubycocoa-devel mailing list
Back to archive index