RubyCocoa : RubyWithInterfaceBuilder

Most recent edit on 2007-11-22 06:21:22 by LaurentSansonetti

Deletions:
pasdro
roractrocdo




Edited on 2007-11-15 23:49:53 by RicviAlalv

Additions:
pasdro



Edited on 2007-11-09 20:57:44 by AccoeLolos

Additions:
roractrocdo



Edited on 2007-05-21 14:16:15 by LaurentSansonetti

Additions:
~- Name it (this must match your later RubyCocoa declaration).

Deletions:
~- Name it (this must match your later RubyCococa declaration).



Edited on 2007-05-21 09:12:57 by LaurentSansonetti

Additions:
Using InterfaceBuilder 2.x or older
  • Launch IB.
  • Select the 'Classes' tab and navigate to the the superclass you wish to create a RubyCocoa subclass of.
  • Control/right click the superclass and select the 'Subclass NS<Name>' menu item.
  • Name it (this must match your later RubyCococa declaration).
  • With your subclass selected, open the inspector (command-1) and add the desire outlets and actions.
  • Instantiate or set it as the class for an existing element (eg: view) used in the nib.
  • Wire it up (control drag from source to target).
  • Write code to describe the subclass (alternatively, use the script mentioned below).
Alternatively, you can use the rb_nibtool.rb script, which you can find in the framework/tool directory of the RubyCocoa sources. Usage is simple:
$ ruby -r <any extra lib> rb_nibtool.rb --update --nib=SomeNib.nib --file=lib/SomeClass.rb

Using InterfaceBuilder 3.x or later
Newer versions of InterfaceBuilder are still under development and cannot be discussed here.


Deletions:
(some rough thoughts on IB 2.5 usage)
  • launch IB
  • select the 'Classes' tab and navigate to the the superclass you wish to create a RubyCocoa subclass of
  • control/right click the superclass and select the 'Subclass NS<Name>' menu item
  • name it (this must match your later RubyCococa declaration)
  • with your subclass selected, open the inspector (command-1) and add the desire outlets and actions
  • instantiate or set it as the class for an existing element (eg: view) used in the nib
  • wire it up (control drag from source to target)
  • write code to describe the subclass (alternatively, use the script mentioned below)
( give an example where we use a custom view and two controllers (which
(mention chris' script to generate ruby files from InterfaceBuilder defined subclasses, /framework/tool/rb_nibtool.rb message reference)




Edited on 2007-05-20 15:02:25 by JeanPierre [nano tweak]

Additions:
- with your subclass selected, open the inspector (command-1) and add the desire outlets and actions
  • instantiate or set it as the class for an existing element (eg: view) used in the nib
  • write code to describe the subclass (alternatively, use the script mentioned below)
( give an example where we use a custom view and two controllers (which


Deletions:
- with your subclass selected, open the inspector (command-1) and add desire outlets and actions
  • instantiate/set the custom class, as necessary
  • save



    Edited on 2007-05-20 14:49:14 by JeanPierre [micro tweaks]

    Additions:
    - select the 'Classes' tab and navigate to the the superclass you wish to create a RubyCocoa subclass of
  • control/right click the superclass and select the 'Subclass NS<Name>' menu item
  • name it (this must match your later RubyCococa declaration)
  • with your subclass selected, open the inspector (command-1) and add desire outlets and actions
  • instantiate/set the custom class, as necessary
  • save

    Deletions:
    - select the classes tab and choose the superclass for your rubycocoa defined subclass
  • control/right click the superclass and select the 'Subclass NS<Name>' option
  • name it
  • add outlets
  • add actions
  • instantiate as necessary



    Edited on 2007-05-20 11:10:21 by JeanPierre [more minor cleanup]

    Additions:
    Unlike ObjectiveC projects where the user may simply drag+drop existing headers files of classes she wishes to expose in InterfaceBuilder, with RubyCocoa she needs to define the classes in InterfaceBuilder to make use of them.

  • control/right click the superclass and select the 'Subclass NS<Name>' option
(mention chris' script to generate ruby files from InterfaceBuilder defined subclasses, /framework/tool/rb_nibtool.rb message reference)


Deletions:
unlike ObjectiveC projects where one can simply drag+drop already coded header files of classes they wished to expose/instantiate/wireup in InterfaceBuilder, with RubyCocoa one needs to define the classes in InterfaceBuilder to make use of them. (objc-based projects can be developed this way as well but i have not found that it is typically used).
(mention chris' script to generate ruby files from IB-defined subclasses, /framework/tool/rb_nibtool.rb message reference)
  • control/right click and select the 'Subclass NSSomething' option.



    Edited on 2007-05-19 22:51:31 by JeanPierre [minor cleanups]

    Additions:
    unlike ObjectiveC projects where one can simply drag+drop already coded header files of classes they wished to expose/instantiate/wireup in InterfaceBuilder, with RubyCocoa one needs to define the classes in InterfaceBuilder to make use of them. (objc-based projects can be developed this way as well but i have not found that it is typically used).
(mention chris' script to generate ruby files from IB-defined subclasses, /framework/tool/rb_nibtool.rb message reference)
  • launch IB
  • select the classes tab and choose the superclass for your rubycocoa defined subclass
  • control/right click and select the 'Subclass NSSomething' option.
  • name it
  • add outlets
  • add actions
  • instantiate as necessary
  • wire it up (control drag from source to target)

    Deletions:
    unlike ObjectiveC projects where one can simply drag+drop already coded header files of classes they wished to expose/instantiate/wireup in InterfaceBuilder, with RubyCocoa one needs to define the classes in InterfaceBuilder to make use of them. (objc-based projects can be developed this way as well but i have not found that it is typically used). (mention chris' script to generate ruby files from IB-defined subclasses, /framework/tool/rb_nibtool.rb http://lists.sourceforge.jp/mailman/archives/rubycocoa-devel/2007-January/000714.html)
launch IB
select the classes tab and choose the superclass for your rubycocoa defined subclass
control/right click and select the 'Subclass NSSomething' option.
name it
add outlets
add actions
instantiate it as necessary
wire it up




Oldest known version of this page was edited on 2007-05-18 17:02:25 by JeanPierre [hacked out a rough outline, please feel free to edit/modify/delete as desired]
Page view:
(some rough thoughts on IB 2.5 usage)

unlike ObjectiveC projects where one can simply drag+drop already coded header files of classes they wished to expose/instantiate/wireup in InterfaceBuilder, with RubyCocoa one needs to define the classes in InterfaceBuilder to make use of them. (objc-based projects can be developed this way as well but i have not found that it is typically used). (mention chris' script to generate ruby files from IB-defined subclasses, /framework/tool/rb_nibtool.rb http://lists.sourceforge.jp/mailman/archives/rubycocoa-devel/2007-January/000714.html)

launch IB

select the classes tab and choose the superclass for your rubycocoa defined subclass

control/right click and select the 'Subclass NSSomething' option.

name it

add outlets
add actions

instantiate it as necessary

wire it up
© 2001-2007 The RubyCocoa Project. Powered by Wikka Wakka Wiki 1.1.6.3
SourceForge.net Logo
Page was generated in 0.0836 seconds