From: Brian M. <ma...@ex...> - 2010-01-04 17:46:45
|
On Jan 3, 2010, at 7:04 AM, sub...@gm... wrote: > > How do i set the fontfamily/fontname for a NSTextField. > I tried it in the interfae builder and in my controller_class.rb - with no result. (tried setFont < NSTextField < NSControl - think i didn't get the syntax right) Another way of writing this in code is like this: @comboBox.font = NSFont.fontWithName_size("Helvetica-BoldOblique", 20) You can replace setFont with Ruby's normal attribute assignment, and the trailing underscore is not (usually) required. You'd usually see a line of code like this in a controller's awakeFromNib method. I wrote a book on RubyCocoa: http://www.pragprog.com/titles/bmrc/programming-cocoa-with-ruby People seem to like it. ----- Brian Marick, independent consultant Mostly on agile methods with a testing slant Author of /Programming Cocoa with Ruby/ www.exampler.com, www.exampler.com/blog, www.twitter.com/marick |