You can subscribe to this list here.
2002 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
(3) |
Nov
|
Dec
(2) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(1) |
Feb
(11) |
Mar
(9) |
Apr
(1) |
May
(5) |
Jun
(5) |
Jul
(4) |
Aug
(3) |
Sep
(15) |
Oct
(8) |
Nov
(9) |
Dec
(11) |
2004 |
Jan
(5) |
Feb
(2) |
Mar
(1) |
Apr
(3) |
May
(6) |
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
(9) |
Nov
|
Dec
(3) |
2005 |
Jan
(1) |
Feb
(7) |
Mar
(6) |
Apr
(36) |
May
(20) |
Jun
(42) |
Jul
(21) |
Aug
(12) |
Sep
(56) |
Oct
(5) |
Nov
(55) |
Dec
(53) |
2006 |
Jan
(43) |
Feb
(83) |
Mar
(98) |
Apr
(42) |
May
(68) |
Jun
(55) |
Jul
(50) |
Aug
(104) |
Sep
(13) |
Oct
(70) |
Nov
(37) |
Dec
(42) |
2007 |
Jan
(56) |
Feb
(18) |
Mar
(43) |
Apr
(80) |
May
(65) |
Jun
(149) |
Jul
(103) |
Aug
(71) |
Sep
(62) |
Oct
(67) |
Nov
(72) |
Dec
(63) |
2008 |
Jan
(64) |
Feb
(63) |
Mar
(31) |
Apr
(42) |
May
(71) |
Jun
(62) |
Jul
(37) |
Aug
(25) |
Sep
(5) |
Oct
(2) |
Nov
(7) |
Dec
(14) |
2009 |
Jan
(20) |
Feb
(15) |
Mar
(19) |
Apr
(8) |
May
(7) |
Jun
|
Jul
(37) |
Aug
(12) |
Sep
(19) |
Oct
(5) |
Nov
(1) |
Dec
(4) |
2010 |
Jan
(5) |
Feb
(24) |
Mar
(16) |
Apr
(9) |
May
(4) |
Jun
|
Jul
|
Aug
(6) |
Sep
(2) |
Oct
(1) |
Nov
|
Dec
|
2011 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(7) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(6) |
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(2) |
Aug
(1) |
Sep
(2) |
Oct
|
Nov
(5) |
Dec
|
2016 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
(1) |
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
From: Rich W. <rw...@gm...> - 2007-12-14 08:50:33
|
I'm fairly familiar with both Ruby and Cocoa, but I've never really played around with RubyCocoa before. I read the "Ruby and Python on Mac OS X" article from the Apple Developer Connection, and I'm looking for more in-depth documentation. I'm using the version of RubyCocoa that comes with Leopard. It seems that the documentation is...missing? I found the example code at /Developer/Examples/Ruby/RubyCocoa, but the documentation at /Developer/Documentation/RubyCocoa has only three smallish HTML files in Japanese. ri doesn't seem to work for any OSX::* items. How do I find/load the documentation into Leopard? Are there any other good sources of RubyCocoa documentation? In particular, I'm looking for some information on CoreData and Key Value compliance. In short, I have a parent entity that has a to many relationship with a child entity. I currently display all the parents in a table. I would like to have one column bind to the child count for each parent. In Cocoa, I would do this by giving the parent a transient "count" attribute. I would then make a subclass of NSManagedObject and have the parent use my subclass. In my subclass, I would create a - (int_32t)count method that returned the child count. This would get called, through the magic of KVC for my parent's count value. In RubyCocoa I tried the same. But it didn't work. My sample code is below. require 'osx/cocoa' class ManagedParent < OSX::NSManagedObject def count() puts "Getting The Count" return 5 end end Yes, yes. I know. I'm not actually getting the child count. But I wanted to get this, simpler version working before I tried to tackle the whole valueForKey_("child") mess. When I run my code, I'm not getting 5 for the count, nor am I seeing "Getting The Count" in the console. How do I get this to work? Thanks, -Rich- |
From: David B. <dba...@gm...> - 2007-12-12 04:01:19
|
Hello. I am attempting to use a ruby library in an Objective-C/Cocoa application. I am having some difficulty figuring out calling conventions. For example, if the ruby class has the class initializer: def initialize(empid = "", key = "", manid = "") How do I properly initialize this from objective-c? I was doing: Class helperClass = NSClassFromString(@"EmpClass"); id helperInstance = [[helperClass alloc] init]; I am also wondering how I accesses my_url defined in the ruby class such as: class MyRubyClass < OSX::NSObject @@my_url = 'http://mywebsite.com' cattr_accessor :my_url end and while I am asking I have a method defined as def employees(opts = {}) how do I call that with the helperInstance in obj-c? Is there some reference material somewhere that would explain how to call ruby methods from objective-c somewhere? Most of the information/ examples I see assume your entire program is written in ruby but using the cocoa framework. Thank you. |
From: Lon B. <lo...@ma...> - 2007-12-10 18:48:21
|
Thanks. On 12/10/07, Alistair Holt <ali...@gm...> wrote: > > I have made one using NSStatusBar.. > > def awakeFromNib > @menuItem = NSStatusBar.systemStatusBar.statusItemWithLength -1 > > > bundle = NSBundle.bundleForClass (self.class) > path = bundle.pathForResource_ofType("AhoyIcon5", "tif") > altPath = bundle.pathForResource_ofType("AhoyIcon5Alt", "tif") > > menuIcon = NSImage.alloc.initWithContentsOfFile(path) > menuIconAlt = NSImage.alloc.initWithContentsOfFile(altPath) > > @menuItem.setHighlightMode :YES > @ahoyItem.setTitle "" > @menuItem.setImage menuIcon > @menuItem.setAlternateImage menuIconAlt > @menuItem.setEnabled :YES > @menuItem.setToolTip "Ahoy menulet baby! oh yea!" > > @menuItem.setMenu @menu > end > > On 03/12/2007, Lon Baker <lo...@sp... > wrote: > > > > Curious, has anyone written a menubar item in rubycocoa? > > > > > > -- > > Lon > > > > > > ------------------------------------------------------------------------- > > SF.Net email is sponsored by: The Future of Linux Business White Paper > > from Novell. From the desktop to the data center, Linux is going > > mainstream. Let it simplify your IT future. > > http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 > > _______________________________________________ > > Rubycocoa-talk mailing list > > Rub...@li... > > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > > > > > > > -- > Alistair Holt > ali...@gm... > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > > -- Lon |
From: Stefan M. <ste...@po...> - 2007-12-10 17:51:06
|
Hi again, I'm trying to get RubyCocoa to run in a separate thread, because I need the main thread for user-input in the Obj-C part, while in the background Ruby keeps running. The release-notes for 0.13. mention something about that. I'm still using 0.12. that shipped with Leopard, but I get a variety of crashes when trying to initialise from a new thread. Is it even possible in 0.12. and how should it be done? bye, stefan mueller |
From: Alistair H. <ali...@gm...> - 2007-12-10 17:25:30
|
I have made one using NSStatusBar.. def awakeFromNib @menuItem = NSStatusBar.systemStatusBar.statusItemWithLength -1 bundle = NSBundle.bundleForClass(self.class) path = bundle.pathForResource_ofType("AhoyIcon5", "tif") altPath = bundle.pathForResource_ofType("AhoyIcon5Alt", "tif") menuIcon = NSImage.alloc.initWithContentsOfFile(path) menuIconAlt = NSImage.alloc.initWithContentsOfFile(altPath) @menuItem.setHighlightMode :YES @ahoyItem.setTitle "" @menuItem.setImage menuIcon @menuItem.setAlternateImage menuIconAlt @menuItem.setEnabled :YES @menuItem.setToolTip "Ahoy menulet baby! oh yea!" @menuItem.setMenu @menu end On 03/12/2007, Lon Baker <lo...@sp...> wrote: > > Curious, has anyone written a menubar item in rubycocoa? > > > -- > Lon > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: The Future of Linux Business White Paper > from Novell. From the desktop to the data center, Linux is going > mainstream. Let it simplify your IT future. > http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > > -- Alistair Holt ali...@gm... |
From: Nathan M. <nm...@ma...> - 2007-12-10 17:09:15
|
Greetings! I'm trying to create a Ruby wrapper around the Directory Services API and noticed that it is one of the frameworks that has the Scripting Bridge metadata already exported in Leopard. I'm trying to execute the dsFindDirNodes method but the 4th parameter is supposed to be a pointer to a long, and is technically an in-out parameter. If I leave it out, it complains that there aren't enough parameters, and when I try to put it in, it complains that it can't convert a FixNum to a "^I" which I take is a pointer to a long. I've verified from the metadata that this is what it is expecting, but I don't know how to pass a pointer to a long (or FixNum/BigNum since Ruby doesn't technically have a long). I've seen that there is an "ObjcPtr" class, but that doesn't seem to work either. On the ruby-cocoa site, it says that there should be documentation for all the frameworks that have metadata available, but it is not located in the specified place and the documentation generator that is included with the source is looking for the ADC Documentation folder from Tiger. Does anyone know when the documentation generator is going to be updated for Leopard or any way to generate it in the meantime? Thanks all. Nathan Mellis Application Developer Mission Aviation Fellowship nm...@ma... |
From: Don Oh <dy...@ya...> - 2007-12-10 14:03:34
|
Hi, I'm relatively new to rubycocoa, encountered the following error in my simple (first) test app using rubycocoa: In my NSDocumentController subclass, def openUntitledDocumentAndDisplay_error(displayDocument, outError) ... return super_openUntitledDocumentAndDisplay_error(display, outError); end I get the following runtime error message: <MyDocumentController: 0x3dd560>2007-12-10 04:39:25.617 QTParse[20475:813] MyDocumentController#openUntitledDocumentAndDisplay_error: OSX::OCDataConvException: Cannot convert the argument #1 as '^@' to Objective-C /Builds/Debug/QTParse.app/Contents/Resources/MyDocumentController.rb:25:in `super_openUntitledDocumentAndDisplay_error' /Builds/Debug/QTParse.app/Contents/Resources/MyDocumentController.rb:25:in `openUntitledDocumentAndDisplay_error' /System/Library/Frameworks/RubyCocoa.framework/Resources/ruby/osx/objc/oc_wrapper.rb:51:in `NSApplicationMain' /Builds/Debug/QTParse.app/Contents/Resources/rb_main.rb:22 It appears the outError parameter needs to be converted to the correct type before call into its super method? Can somebody help please? thanks, -don |
From: Satoshi N. <sna...@in...> - 2007-12-09 23:41:24
|
Finally I have found a way. Just include OCObjWrapper. It seems due to an execution order. require 'osx/cocoa' require 'rubygems' require 'active_support' module OSX class CIImage include OCObjWrapper def method_missing_with_example(sym, *args, &block) method_missing_without_example(sym, *args, &block) end alias_method_chain :method_missing, :example end end original =3D OSX::CIImage.imageWithContentsOfURL( OSX::NSURL.fileURLWithPath('/Users/crafterm/Desktop/=20 leaves_desktop.jpg')) p original.extent.size -- Satoshi Nakagawa On 2007/12/10, at 8:13, Satoshi Nakagawa wrote: > I tried to solve this problem, but I cannot find a way to call the > original OCObjWrapper#method_missing. If you copy and paste the code > in oc_wrapper.rb, it works well. > Does anyone know a better way? > > > require 'osx/cocoa' > require 'rubygems' > require 'active_support' > > module OSX > class CIImage > def method_missing_with_example(sym, *args, &block) > method_missing_without_example(sym, *args, &block) > end > > def method_missing(mname, *args) > m_name, m_args, as_predicate =3D analyze_missing(mname, args) > begin > result =3D self.ocm_send(m_name, mname, as_predicate, *m_args) > rescue OCMessageSendException =3D> e > if self.private_methods.include?(mname.to_s) > raise NoMethodError, "private method `#{mname}' called for > ##{self}" > else > raise e > end > end > end > > alias_method_chain :method_missing, :example > end > end > > original =3D > OSX::CIImage.imageWithContentsOfURL(OSX::NSURL.fileURLWithPath('/=20 > Users/ > crafterm/Desktop/leaves_desktop.jp')) > p original.extent.size > > -- > Satoshi Nakagawa > > On 2007/12/10, at 7:33, Satoshi Nakagawa wrote: > >> Hi, >> >> RubyCocoa defines Object.method_missing to realize a transparent >> bridge between Ruby and Cocoa. If you redefine method_missing of a >> class, then=10=10=10=10=10=10 the class won't respond to any ObjC = methods. =20 >> That's >> why alias_method_chain doesn't work. >> >> -- >> Satoshi Nakagawa >> >> On 2007/12/09, at 10:47, Marcus Crafter wrote: >> >>> Hi All, >>> >>> Hope all is going well! >>> >>> I'm trying to extend method_missing on OSX::CIImage using >>> alias_method_chain and are having trouble getting it to work, here's >>> an example to demonstrate it: >>> >>> require 'rubygems' >>> require 'active_support' >>> require 'osx/cocoa' >>> >>> module OSX >>> class CIImage >>> def method_missing_with_example(sym, *args, &block) >>> method_missing_without_example(sym, *args, &block) >>> end >>> >>> alias_method_chain :method_missing, :example >>> end >>> end >>> >>> original =3D >>> OSX::CIImage.imageWithContentsOfURL(OSX::NSURL.fileURLWithPath('/ >>> Users/ >>> crafterm/Desktop/leaves_desktop.jpg')) >>> puts original.extent.size >>> >>> When I run this I get: >>> >>> NoMethodError: undefined method =91extent=92 for =20 >>> #<OSX::CIConcreteImage: >>> 0x117248c> >>> >>> If I comment out the call to alias_method_chain I get the expected >>> result: >>> >>> #<OSX::CGSize:0x1173710> >>> >>> Somehow alias_method_chain breaks it. This is using Ruby & RubyCocoa >>> as per a default install of Leopard, Rails 2.0.1 active support =20 >>> gems. >>> >>> Any thoughts what might be going on or what I could try to get it >>> working? >>> >>> Cheers, >>> >>> Marcus > > > = ------------------------------------------------------------------------- > SF.Net email is sponsored by: > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk |
From: Satoshi N. <sna...@in...> - 2007-12-09 23:14:29
|
I tried to solve this problem, but I cannot find a way to call the =20 original OCObjWrapper#method_missing. If you copy and paste the code =20= in oc_wrapper.rb, it works well. Does anyone know a better way? require 'osx/cocoa' require 'rubygems' require 'active_support' module OSX class CIImage def method_missing_with_example(sym, *args, &block) method_missing_without_example(sym, *args, &block) end def method_missing(mname, *args) m_name, m_args, as_predicate =3D analyze_missing(mname, args) begin result =3D self.ocm_send(m_name, mname, as_predicate, *m_args) rescue OCMessageSendException =3D> e if self.private_methods.include?(mname.to_s) raise NoMethodError, "private method `#{mname}' called for =20= ##{self}" else raise e end end end alias_method_chain :method_missing, :example end end original =3D OSX::CIImage.imageWithContentsOfURL(OSX::NSURL.fileURLWithPath('/Users/=20= crafterm/Desktop/leaves_desktop.jp')) p original.extent.size -- Satoshi Nakagawa On 2007/12/10, at 7:33, Satoshi Nakagawa wrote: > Hi, > > RubyCocoa defines Object.method_missing to realize a transparent > bridge between Ruby and Cocoa. If you redefine method_missing of a > class, then=10=10=10=10=10=10 the class won't respond to any ObjC = methods. That's > why alias_method_chain doesn't work. > > -- > Satoshi Nakagawa > > On 2007/12/09, at 10:47, Marcus Crafter wrote: > >> Hi All, >> >> Hope all is going well! >> >> I'm trying to extend method_missing on OSX::CIImage using >> alias_method_chain and are having trouble getting it to work, here's >> an example to demonstrate it: >> >> require 'rubygems' >> require 'active_support' >> require 'osx/cocoa' >> >> module OSX >> class CIImage >> def method_missing_with_example(sym, *args, &block) >> method_missing_without_example(sym, *args, &block) >> end >> >> alias_method_chain :method_missing, :example >> end >> end >> >> original =3D >> OSX::CIImage.imageWithContentsOfURL(OSX::NSURL.fileURLWithPath('/ >> Users/ >> crafterm/Desktop/leaves_desktop.jpg')) >> puts original.extent.size >> >> When I run this I get: >> >> NoMethodError: undefined method =91extent=92 for = #<OSX::CIConcreteImage: >> 0x117248c> >> >> If I comment out the call to alias_method_chain I get the expected >> result: >> >> #<OSX::CGSize:0x1173710> >> >> Somehow alias_method_chain breaks it. This is using Ruby & RubyCocoa >> as per a default install of Leopard, Rails 2.0.1 active support gems. >> >> Any thoughts what might be going on or what I could try to get it >> working? >> >> Cheers, >> >> Marcus |
From: Satoshi N. <sna...@in...> - 2007-12-09 22:34:43
|
Hi, RubyCocoa defines Object.method_missing to realize a transparent =20 bridge between Ruby and Cocoa. If you redefine method_missing of a =20 class, then=10=10=10=10=10=10 the class won't respond to any ObjC = methods. That's =20 why alias_method_chain doesn't work. -- Satoshi Nakagawa On 2007/12/09, at 10:47, Marcus Crafter wrote: > Hi All, > > Hope all is going well! > > I'm trying to extend method_missing on OSX::CIImage using > alias_method_chain and are having trouble getting it to work, here's > an example to demonstrate it: > > require 'rubygems' > require 'active_support' > require 'osx/cocoa' > > module OSX > class CIImage > def method_missing_with_example(sym, *args, &block) > method_missing_without_example(sym, *args, &block) > end > > alias_method_chain :method_missing, :example > end > end > > original =3D > OSX::CIImage.imageWithContentsOfURL(OSX::NSURL.fileURLWithPath('/=20 > Users/ > crafterm/Desktop/leaves_desktop.jpg')) > puts original.extent.size > > When I run this I get: > > NoMethodError: undefined method =91extent=92 for = #<OSX::CIConcreteImage: > 0x117248c> > > If I comment out the call to alias_method_chain I get the expected > result: > > #<OSX::CGSize:0x1173710> > > Somehow alias_method_chain breaks it. This is using Ruby & RubyCocoa > as per a default install of Leopard, Rails 2.0.1 active support gems. > > Any thoughts what might be going on or what I could try to get it > working? > > Cheers, > > Marcus |
From: Marcus C. <cra...@re...> - 2007-12-09 01:47:24
|
Hi All, Hope all is going well! I'm trying to extend method_missing on OSX::CIImage using =20 alias_method_chain and are having trouble getting it to work, here's =20 an example to demonstrate it: require 'rubygems' require 'active_support' require 'osx/cocoa' module OSX class CIImage def method_missing_with_example(sym, *args, &block) method_missing_without_example(sym, *args, &block) end alias_method_chain :method_missing, :example end end original =3D =20 OSX::CIImage.imageWithContentsOfURL(OSX::NSURL.fileURLWithPath('/Users/=20= crafterm/Desktop/leaves_desktop.jpg')) puts original.extent.size When I run this I get: NoMethodError: undefined method =91extent=92 for = #<OSX::CIConcreteImage:=20 0x117248c> If I comment out the call to alias_method_chain I get the expected =20 result: #<OSX::CGSize:0x1173710> Somehow alias_method_chain breaks it. This is using Ruby & RubyCocoa =20 as per a default install of Leopard, Rails 2.0.1 active support gems. Any thoughts what might be going on or what I could try to get it =20 working? Cheers, Marcus= |
From: Eloy D. <elo...@gm...> - 2007-12-08 18:43:25
|
Hello, We are pleased to announce the third release of Rucola today. http://rucola.rubyforge.org/ This release fixes some critical bugs which were introduced in the =20 combination RubyCocoa 0.13 & Rucola 0.0.2 Cheers, Rucola team. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D A Framework for building Cocoa applications in Ruby Rucola is a light weight framework that helps you write RubyCocoa apps. It allows you to build, test, and deploy applications using rake =20 commands, eliminating the need to use XCode, however you can use XCode if you =20 wish. Rucola provides a set of generators to help you generate controllers, =20= window controllers, and document-based applications. It also provides APIs for simplifying =20= some of Objective-C=92s ways of doing things. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D CHANGES: - Fixed some critical bugs in the xcode & nib manipulation code, which =20= were introduced because the default is to return mutable objects in =20 RubyCocoa again. - InfoPlist#app_name returns a ruby string instead of a NSString, =20 which fixes a bug in the AR generator. |
From: Satoshi N. <sna...@in...> - 2007-12-05 02:06:23
|
Hi, Actually, it is the right way now. > The only difference is, that you convert the NSCFString to String. > Is this step very important? If the NSString has been autoreleased, > will Ruby retain it to keep the AutoreleasePool from dealloc-ing? No. The step is unnecessary in this case. Because to_s will be called for all parameters in instance_eval. For the latter question, yes. Ruby will keep the NSString after the autorelease. You can make a test by yourself like: class AppController < OSX::NSObject def awakeFromNib OSX::TestObject.callback(self) p @s end def keep(s) @s = s end end @implementation TestObject + (void)callback:(id)sender { NSString* s = [[NSString alloc] initWithString:@"foobar"]; [sender keep:s]; [s release]; } @end -- Satoshi Nakagawa On 2007/12/05, at 10:19, Stefan Mueller wrote: > Hello > > Thanks for the quick answer. It looks like the workaround, > that I mentioned at the end of my message was actually the > right way to do it. > > The only difference is, that you convert the NSCFString to String. > Is this step very important? If the NSString has been autoreleased, > will Ruby retain it to keep the AutoreleasePool from dealloc-ing? > > > Knowing about objc_method will also be useful. > > > stefan mueller > > > On Dec 5, 2007, at 01:32 , Satoshi Nakagawa wrote: > >> Hi, >> >> For example, you need to make a callable method from ObjC in a ruby >> class: >> >> def evalScript_source(script, source) >> instance_eval(script.to_s, source.to_s) >> end >> >> -- >> Satoshi Nakagawa >> >> On 2007/12/05, at 6:50, Stefan Mueller wrote: >> >>> Hello >>> >>> >>> I've made a proxy method that's a better fit for bridge and then >>> calls the Ruby method, >>> but I don't think it's ideal. >>> >>> def evaluate_source(script, source) >>> self.instance_eval(script, source) >>> end >>> >>> regards, >>> Stefan Mueller >> > > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: The Future of Linux Business White Paper > from Novell. From the desktop to the data center, Linux is going > mainstream. Let it simplify your IT future. > http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk |
From: Stefan M. <ste...@po...> - 2007-12-05 01:20:06
|
Hello Thanks for the quick answer. It looks like the workaround, that I mentioned at the end of my message was actually the right way to do it. The only difference is, that you convert the NSCFString to String. Is this step very important? If the NSString has been autoreleased, will Ruby retain it to keep the AutoreleasePool from dealloc-ing? Knowing about objc_method will also be useful. stefan mueller On Dec 5, 2007, at 01:32 , Satoshi Nakagawa wrote: > Hi, > > For example, you need to make a callable method from ObjC in a ruby > class: > > def evalScript_source(script, source) > instance_eval(script.to_s, source.to_s) > end > > -- > Satoshi Nakagawa > > On 2007/12/05, at 6:50, Stefan Mueller wrote: > >> Hello >> >> >> I've made a proxy method that's a better fit for bridge and then >> calls the Ruby method, >> but I don't think it's ideal. >> >> def evaluate_source(script, source) >> self.instance_eval(script, source) >> end >> >> regards, >> Stefan Mueller > |
From: Satoshi N. <sna...@in...> - 2007-12-05 00:33:36
|
Hi, For example, you need to make a callable method from ObjC in a ruby class: def evalScript_source(script, source) instance_eval(script.to_s, source.to_s) end Then you can call the method as bellow: [rubyObj evalScript:@"p (0...10).to_a" source:@"file"]; If you want to call three parameters version, define a ruby method like: def evalScript_source_lineNumber(script, source, line) instance_eval(script.to_s, source.to_s, line) end objc_method :evalScript_source_lineNumber, [:void, :id, :id, :int] # The first :void indicates a type of return value. # The rest are types of parameters. Then you can call it: [rubyObj evalScript:@"raise Exception" source:@"file" lineNumber:12]; These are similar except objc_method. In this case we need to specify types of parameters. Because all parameters are assumed as an Object (id), but the third parameter is integer, different from an id. So bridge can know the third parameter is not an id, then it converts the parameter to Integer in the ruby level. -- Satoshi Nakagawa On 2007/12/05, at 6:50, Stefan Mueller wrote: > Hello > > I have a question about calling Ruby methods from Objective-C. > > The Introduction from rubycocoa.com only shows you how to do this > for a user-defined method that uses underscores. > > [helper helpfullyAddX:x toY:y] > => > def helpfullyAddX_toY(i,j) > > But how am I supposed to call a function like Object.instance_eval > It takes multiple arguments, and has not enough underscores. > It can also take a single block. > > obj.instance_eval ( aString <, file <, line> > ) > obj.instance_eval ( { block } ) > > The bridge only tries to call the method with the block. > So how do I call the other Version with 2 or 3 params? > > I've made a proxy method that's a better fit for bridge and then > calls the Ruby method, > but I don't think it's ideal. > > def evaluate_source(script, source) > self.instance_eval(script, source) > end > > regards, > Stefan Mueller |
From: Stefan M. <ste...@po...> - 2007-12-04 21:50:31
|
Hello I have a question about calling Ruby methods from Objective-C. The Introduction from rubycocoa.com only shows you how to do this for a user-defined method that uses underscores. [helper helpfullyAddX:x toY:y] => def helpfullyAddX_toY(i,j) But how am I supposed to call a function like Object.instance_eval It takes multiple arguments, and has not enough underscores. It can also take a single block. obj.instance_eval ( aString <, file <, line> > ) obj.instance_eval ( { block } ) The bridge only tries to call the method with the block. So how do I call the other Version with 2 or 3 params? I've made a proxy method that's a better fit for bridge and then calls the Ruby method, but I don't think it's ideal. def evaluate_source(script, source) self.instance_eval(script, source) end regards, Stefan Mueller |
From: Tim P. <he...@ti...> - 2007-12-03 18:09:39
|
Evening All I just wondered what peoples thoughts are on distributing parts of applications into different nibs? I have been playing with NSView subclasses to read in various NIBs, which works without problem. However, I then started to wonder how you communicate between NIB files? For instance, in my particular circumstance, I have a complex outline view (one nib), then I wanted to put another pretty complex tab view system into another so as not to clutter things up in the main nib. However, the tab views are driven by the selection in the outline view.... Obviously I do not want to instantiate another controller in either component NIB, so im guessing its achieved using outlets to access the other object? Or would it be a case that the links would appear "broken" in IB, but when read it at run time as they would all be owned by the same NIB then get access to its objects? I appreciate this is more a design issue - it would be nice to hear peoples views/thoughts tho :) Cheers Tim |
From: grimmwerks <gr...@gr...> - 2007-12-03 16:49:08
|
There's also a book that deals with the Quartz layer, mostly controlled by python; I'm sure you could use some of those exercises and flip them to ruby...? On Dec 1, 2007, at 8:47 AM, Robert Feldt wrote: > Hi, > > RubyCocoa looks very nice; good work! > > I know Ruby very well but have never really programmed any larger > apps on the Mac platform. I don't know the Cocoa API at all. > > Can anyone recommend a few good resources/book to get started with? > > I also have a more specific question: I want to be able to program > apps with UI:s rendered in OpenGL (to experiment with zoomable GUI > as one example). Would it be wise to go via Cocoa, open a OpenGL > canvas and then call to that? Have anyone tried other approaches to > OpenGL-programming with Ruby on Mac? I tried the different SDL and > OpenGL libs available for Ruby but no one is really easy to install > and/or use. Any tips appreciated. > > -- > Best regards, > > /Robert Feldt > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: The Future of Linux Business White Paper > from Novell. From the desktop to the data center, Linux is going > mainstream. Let it simplify your IT future. > http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4_______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk |
From: Lon B. <lo...@sp...> - 2007-12-03 15:50:12
|
Curious, has anyone written a menubar item in rubycocoa? -- Lon |
From: Laurent S. <lsa...@ap...> - 2007-12-03 15:46:41
|
Hi Tim(s) :-) I suspect the ObjC-only project build is configured for a 10.4 deployment, where the exception won't be raised for compatibility reasons. I didn't try it though, but I think that if you build for 10.5 you will get the exception. Cheers, Laurent On Dec 3, 2007, at 4:55 AM, Tim Burks wrote: > Hi Laurent, > > Thanks, but that doesn't seem to explain why Tim's ObjC-only example > didn't suffer the exception. I've seen the same thing with ObjC-only > applications. You're the only one of us who can see the code in > question -- what's going on? > > best regards (and congratulations, btw!), > > Tim > > On Dec 2, 2007, at 4:32 PM, Laurent Sansonetti wrote: > >> On Dec 3, 2007, at 1:20 AM, Tim Burks wrote: >> >>> >>> Hi Tim, >>> >>> Your post reminded me of a problem that I recently had while working >>> with Nu. So I ported your example to Nu and saw the same message. >>> I think the problem is in the PSMTabBarControl framework. If you >>> look at PSMTabBarControl.m, you'll see this method: >>> >>> - (void)tabViewDidChangeNumberOfTabViewItems:(NSTabView *)aTabView >>> { >>> NSArray *tabItems = [tabView tabViewItems]; >>> // go through cells, remove any whose representedObjects are not >>> in [tabView tabViewItems] >>> NSEnumerator *e = [_cells objectEnumerator]; >>> PSMTabBarCell *cell; >>> while(cell = [e nextObject]){ >>> if(![tabItems containsObject:[cell representedObject]]){ >>> [self removeTabForCell:cell]; >>> } >>> } >>> ... >>> >>> This method is, in fact, mutating the _cells collection while it is >>> enumerating it. I've heard that Leopard treats this more strictly, >>> so that might explain the exception. I modified this method, >>> replacing the call that creates the object enumerator with this: >>> [...] >> >> Definitely, good catch! >> >> FYI, the rationale behind this new exception is explained in http://developer.apple.com/releasenotes/Cocoa/Foundation.html >> in the "Warning about mutations during enumerations" section. >> >> Laurent >> >> ------------------------------------------------------------------------- >> SF.Net email is sponsored by: The Future of Linux Business White >> Paper >> from Novell. From the desktop to the data center, Linux is going >> mainstream. Let it simplify your IT future. >> http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 >> _______________________________________________ >> Rubycocoa-talk mailing list >> Rub...@li... >> https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: The Future of Linux Business White Paper > from Novell. From the desktop to the data center, Linux is going > mainstream. Let it simplify your IT future. > http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk |
From: Tim P. <he...@ti...> - 2007-12-03 11:14:40
|
Hey Tim Thats a seriously good call! I too had read about the issues with 10.5 being a lot stricter on this type of stuff, but had no idea where to start looking and how to fix it. Fixing the framework my example now works no problem at all. It would be interesting to see what the problem with this is however, as Tim points out, the Obj-C example works no problem at all, even with the dodgy framework? Cheers Tim |
From: Tim B. <tim...@gm...> - 2007-12-03 03:55:37
|
Hi Laurent, Thanks, but that doesn't seem to explain why Tim's ObjC-only example didn't suffer the exception. I've seen the same thing with ObjC-only applications. You're the only one of us who can see the code in question -- what's going on? best regards (and congratulations, btw!), Tim On Dec 2, 2007, at 4:32 PM, Laurent Sansonetti wrote: > On Dec 3, 2007, at 1:20 AM, Tim Burks wrote: > >> >> Hi Tim, >> >> Your post reminded me of a problem that I recently had while working >> with Nu. So I ported your example to Nu and saw the same message. >> I think the problem is in the PSMTabBarControl framework. If you >> look at PSMTabBarControl.m, you'll see this method: >> >> - (void)tabViewDidChangeNumberOfTabViewItems:(NSTabView *)aTabView >> { >> NSArray *tabItems = [tabView tabViewItems]; >> // go through cells, remove any whose representedObjects are not >> in [tabView tabViewItems] >> NSEnumerator *e = [_cells objectEnumerator]; >> PSMTabBarCell *cell; >> while(cell = [e nextObject]){ >> if(![tabItems containsObject:[cell representedObject]]){ >> [self removeTabForCell:cell]; >> } >> } >> ... >> >> This method is, in fact, mutating the _cells collection while it is >> enumerating it. I've heard that Leopard treats this more strictly, >> so that might explain the exception. I modified this method, >> replacing the call that creates the object enumerator with this: >> [...] > > Definitely, good catch! > > FYI, the rationale behind this new exception is explained in http://developer.apple.com/releasenotes/Cocoa/Foundation.html > in the "Warning about mutations during enumerations" section. > > Laurent > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: The Future of Linux Business White Paper > from Novell. From the desktop to the data center, Linux is going > mainstream. Let it simplify your IT future. > http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk |
From: Laurent S. <lsa...@ap...> - 2007-12-03 00:32:27
|
On Dec 3, 2007, at 1:20 AM, Tim Burks wrote: > > Hi Tim, > > Your post reminded me of a problem that I recently had while working > with Nu. So I ported your example to Nu and saw the same message. > I think the problem is in the PSMTabBarControl framework. If you > look at PSMTabBarControl.m, you'll see this method: > > - (void)tabViewDidChangeNumberOfTabViewItems:(NSTabView *)aTabView > { > NSArray *tabItems = [tabView tabViewItems]; > // go through cells, remove any whose representedObjects are not > in [tabView tabViewItems] > NSEnumerator *e = [_cells objectEnumerator]; > PSMTabBarCell *cell; > while(cell = [e nextObject]){ > if(![tabItems containsObject:[cell representedObject]]){ > [self removeTabForCell:cell]; > } > } > ... > > This method is, in fact, mutating the _cells collection while it is > enumerating it. I've heard that Leopard treats this more strictly, > so that might explain the exception. I modified this method, > replacing the call that creates the object enumerator with this: > [...] Definitely, good catch! FYI, the rationale behind this new exception is explained in http://developer.apple.com/releasenotes/Cocoa/Foundation.html in the "Warning about mutations during enumerations" section. Laurent |
From: Tim B. <tim...@gm...> - 2007-12-03 00:20:34
|
Hi Tim, Your post reminded me of a problem that I recently had while working with Nu. So I ported your example to Nu and saw the same message. I think the problem is in the PSMTabBarControl framework. If you look at PSMTabBarControl.m, you'll see this method: - (void)tabViewDidChangeNumberOfTabViewItems:(NSTabView *)aTabView { NSArray *tabItems = [tabView tabViewItems]; // go through cells, remove any whose representedObjects are not in [tabView tabViewItems] NSEnumerator *e = [_cells objectEnumerator]; PSMTabBarCell *cell; while(cell = [e nextObject]){ if(![tabItems containsObject:[cell representedObject]]){ [self removeTabForCell:cell]; } } ... This method is, in fact, mutating the _cells collection while it is enumerating it. I've heard that Leopard treats this more strictly, so that might explain the exception. I modified this method, replacing the call that creates the object enumerator with this: NSEnumerator *e = [[[_cells copy] autorelease] objectEnumerator]; After rebuilding and reinstalling the framework, my example worked correctly. The Nu version of your example is here: http://programming.nu/files/NuPSMTabDemo.tgz . -- Tim p.s. All the code that I wrote was in one file, as follows. It should be easy to see the correspondence back to RubyCocoa. ;; main.nu ;; Copyright (c) 2007 Tim Burks, Neon Design Technology, Inc. (load "PSMTabBarControl") (load "Nu:nu") ;; basics (load "Nu:cocoa") ;; cocoa definitions (class TabController is NSObject (ivar (id) tab_bar (id) tab_view) (- awakeFromNib is (self add_new_tab:self) (@tab_bar setStyleNamed:"Aqua") (@tab_bar setHideForSingleTab:NO) (@tab_bar setAllowsDragBetweenWindows:NO)) (- add_new_tab:sender is (set new_item ((NSTabViewItem alloc) init)) (new_item setLabel:"Badger") (@tab_view addTabViewItem:new_item) (@tab_view selectTabViewItem:new_item)) (- close_tab:sender is (@tab_view removeTabViewItem:(@tab_view selectedTabViewItem)))) ;; this makes the application window take focus when we've started it from the terminal ((NSApplication sharedApplication) activateIgnoringOtherApps:YES) ;; run the main Cocoa event loop (NSApplicationMain 0 nil) On Dec 2, 2007, at 2:01 PM, Tim Perrett wrote: > Hey all, > > I've implemented PSMTabBarControl ( http://www.positivespinmedia.com/dev/PSMTabBarControl.html > ) in my application, however I seem to get random failures > complaining like so: > > `NSApplicationMain': NSGenericException - *** Collection <NSCFArray: > 0x5598d0> was mutated while being enumerated. (OSX::OCException) > from /Users/timperrett/Desktop/RubyPSMTabDemo/build/Release/ > RubyPSMTabDemo.app/Contents/Resources/rb_main.rb:22 > > Now, I only see this message (and subsequent crash) when I try to > close a tab that is not currently selected. This however does not > happen in the example that is coded in Obj-C (supplied in that > download from PSM). Ive translated all the relevant code; the main > difference being there example is document based and my translation is > not. The framework obviously works (see the PSM example), but yet the > translation does not. > > Nib wise, I have tried with the PSM delegate both specified, and un- > specified, but it makes no difference. This leads me to think that it > must be trying to either do something back across the bridge thats > illegal, or there might be some kind of conflict with RC? > > Ive posted up a sample app here (and commented out any translated > functionality that isnt essential): http://download.timperrett.com/software/RubyPSMTabDemo.zip > > Anybody's thoughts would be much appreciated :) > > Cheers > > Tim > > > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: The Future of Linux Business White Paper > from Novell. From the desktop to the data center, Linux is going > mainstream. Let it simplify your IT future. > http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk |
From: Tim P. <he...@ti...> - 2007-12-02 22:01:47
|
Hey all, I've implemented PSMTabBarControl ( http://www.positivespinmedia.com/dev/PSMTabBarControl.html ) in my application, however I seem to get random failures complaining like so: `NSApplicationMain': NSGenericException - *** Collection <NSCFArray: 0x5598d0> was mutated while being enumerated. (OSX::OCException) from /Users/timperrett/Desktop/RubyPSMTabDemo/build/Release/ RubyPSMTabDemo.app/Contents/Resources/rb_main.rb:22 Now, I only see this message (and subsequent crash) when I try to close a tab that is not currently selected. This however does not happen in the example that is coded in Obj-C (supplied in that download from PSM). Ive translated all the relevant code; the main difference being there example is document based and my translation is not. The framework obviously works (see the PSM example), but yet the translation does not. Nib wise, I have tried with the PSM delegate both specified, and un- specified, but it makes no difference. This leads me to think that it must be trying to either do something back across the bridge thats illegal, or there might be some kind of conflict with RC? Ive posted up a sample app here (and commented out any translated functionality that isnt essential): http://download.timperrett.com/software/RubyPSMTabDemo.zip Anybody's thoughts would be much appreciated :) Cheers Tim |