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: Axel M. R. <rub...@ro...> - 2008-04-25 12:41:38
|
Hi, I want to show an alert to the user that the RubyCocoa program needs at least Leopard to run. However, since RubyCocoa could not be installed on a 10.4 system, the dialog needs to be put up in Obj-C. I know how to do that, but not in the main.m file: the application is not inited yet. I know this is not a RC question, but related IMHO: everyone who wants to put out rubycocoa programs either needs to a) bundle the rubycocoa and ruby libraries and/or b) check the OS version and put up a dialog for the user else your application silently fails on older OSes, like LimeChat. Bundling the ruby libraries proved too much work for me, so now i 'simply' want to inform the user that the app needs a newer OS. I use NSAlert alertWithMessageText in the main app, before the RBApplicationMain is called. The alert is never shown. I tried initialising the NSApp environment by calling [NSApplication sharedApplication] to no avail. Probably because the NSApp environment is not yet ready, but how do I otherwise inform the user in a Maclike way that she needs to upgrade? tail -f /var/log/system.log is not what I call userfriendly ;-) Axel -- _________________________ Axel Roest axelloroestello@{AIM/MSN} - Skype:axellofono - XOIP: 084-8749988 |
From: Scott T. <ea...@ma...> - 2008-04-20 19:22:48
|
On Apr 20, 2008, at 1:57 PM, Rupert BARROW wrote: > Scott, > My problem is more related to RubyCocoa : > > I have a RubyCocoa app called MyApp.app. > I would like to be able to call this from the command-line with my > own command-line argument, e.g. > MyApp.app/Contents/MacOS/MyApp --myswitch > > When I do this, I get an error reported by ruby not recognising this > switch. > > How can I get pass the Ruby parser, so that I can later (in my app) > use the ARGV global to recognize which switch was passed to my app ? > I need something like the "-s", but this only works if I tell it to > load a ruby file; I just want it to find rb_main.rb and run away I think I understand. RBApplicationMain will parse the command line arguments as if they were arguments to the Ruby interpreter. If you wish to avoid this, you can use RBApplicationInit instead, and take responsibility for calling NSApplicationMain youself. In other words, change your main routine to: int main(int argc, const char *argv[]) { RBApplicationInit("rb_main.rb", argc, argv, nil); return NSApplicationMain(argc,argv); } This should invoke rb_main (without parsing the arguments as Ruby arguments) and then begin the application as normal. Scott |
From: Rupert B. <rup...@fr...> - 2008-04-20 18:57:27
|
Scott, My problem is more related to RubyCocoa : I have a RubyCocoa app called MyApp.app. I would like to be able to call this from the command-line with my own command-line argument, e.g. MyApp.app/Contents/MacOS/MyApp --myswitch When I do this, I get an error reported by ruby not recognising this switch. How can I get pass the Ruby parser, so that I can later (in my app) use the ARGV global to recognize which switch was passed to my app ? I need something like the "-s", but this only works if I tell it to load a ruby file; I just want it to find rb_main.rb and run away ... Rup Le 20 avr. 08 à 12:31, Rupert BARROW a écrit : > Thanks for the pointer. > Rup > > Le 19 avr. 08 à 04:50, Scott Thompson a écrit : > >> >> On Apr 18, 2008, at 6:39 PM, Rupert BARROW wrote: >> >>> Hi, >>> >>> Is there a useful sample showing how to receive and use command-line >>> argument in Ruby code in RubyCocoa ? >>> How do argc and argv pass the rb_main_init ? >> >> If you are using RBApplicationMain or RBApplicationInit then the >> arguments should be in the standard Ruby "ARGV" array. >> >> http://www.rubycentral.com/pickaxe/rubyworld.html >> >> Scott >> >> > |
From: Rupert B. <rup...@fr...> - 2008-04-20 10:31:47
|
Thanks for the pointer. Rup Le 19 avr. 08 à 04:50, Scott Thompson a écrit : > > On Apr 18, 2008, at 6:39 PM, Rupert BARROW wrote: > >> Hi, >> >> Is there a useful sample showing how to receive and use command-line >> argument in Ruby code in RubyCocoa ? >> How do argc and argv pass the rb_main_init ? > > If you are using RBApplicationMain or RBApplicationInit then the > arguments should be in the standard Ruby "ARGV" array. > > http://www.rubycentral.com/pickaxe/rubyworld.html > > Scott > > |
From: Scott T. <ea...@ma...> - 2008-04-19 02:50:29
|
On Apr 18, 2008, at 6:39 PM, Rupert BARROW wrote: > Hi, > > Is there a useful sample showing how to receive and use command-line > argument in Ruby code in RubyCocoa ? > How do argc and argv pass the rb_main_init ? If you are using RBApplicationMain or RBApplicationInit then the arguments should be in the standard Ruby "ARGV" array. http://www.rubycentral.com/pickaxe/rubyworld.html Scott |
From: Rupert B. <rup...@fr...> - 2008-04-18 23:40:19
|
Hi, Is there a useful sample showing how to receive and use command-line argument in Ruby code in RubyCocoa ? How do argc and argv pass the rb_main_init ? TIA? ʇɹǝdnɹ |
From: Hans-Georg <pan...@ma...> - 2008-04-14 20:33:34
|
Am 14.04.2008 um 21:52 schrieb Hans-Georg: > is_directory = > OSX::NSFileManager.defaultManager.fileExistsAtPath_isDirectory?("/ > usr/local/bin/") I didn't run that code, obviously. This method will return two values: exists, is_directory = OSX::NSFileManager.defaultManager.fileExistsAtPath_isDirectory?("/usr/ local/bin/") p exists, is_directory # true, 1 exists, is_directory = OSX::NSFileManager.defaultManager.fileExistsAtPath_isDirectory?("/usr/ local/bin/gnuplot") p exists, is_directory # true, 0 Only the first returned value is a boolean (which seems to be a bug, because in Ruby "0" is not false, but true). So you have to check for an existing directory like this: if exists && is_directory == 1 #... end Hans-Georg |
From: Hans-Georg <pan...@ma...> - 2008-04-14 19:53:29
|
Am 14.04.2008 um 20:41 schrieb Knud Hinnerk Möller: > how does one call methods like -[NSFileManager > fileExistsAtPath:isDirectory:] from Ruby, where the second parameter > is a pointer (in this case to a BOOL)? The Obj-C use is like this: > > BOOL isDir; > NSFileManager *fileManager = [NSFileManager defaultManager]; > if ([fileManager fileExistsAtPath:@"/bla/blub" isDirectory:&isDir] && > isDir) { > doSomething(); > // ... You should read: http://rubycocoa.sourceforge.net/WorkingWithPointers > Any suggestions? is_directory = OSX::NSFileManager.defaultManager.fileExistsAtPath_isDirectory?("/usr/ local/bin/") Hans-Georg |
From: Knud H. M. <knu...@de...> - 2008-04-14 18:44:57
|
Hi, how does one call methods like -[NSFileManager fileExistsAtPath:isDirectory:] from Ruby, where the second parameter is a pointer (in this case to a BOOL)? The Obj-C use is like this: BOOL isDir; NSFileManager *fileManager = [NSFileManager defaultManager]; if ([fileManager fileExistsAtPath:@"/bla/blub" isDirectory:&isDir] && isDir) { doSomething(); // ... My naive attempt at using this from Ruby: isDirectory = FALSE OSX::NSFileManager.defaultManager.fileExistsAtPath_isDirectory?(path, isDirectory) if (isDirectory) doSomething ... end As expected, this doesn't work. I get: KNTileViewerAppController#scanDirectory: OSX::OCDataConvException: Cannot convert the argument #1 as '^B' to Objective-C /System/Library/Frameworks/RubyCocoa.framework/Resources/ruby/osx/ objc/oc_wrapper.rb:50:in `ocm_send' /System/Library/Frameworks/RubyCocoa.framework/Resources/ruby/osx/ objc/oc_wrapper.rb:50:in `method_missing' Any suggestions? Cheers, Knud ------------------------------------------------- Knud Möller, MA +353 - 91 - 495086 Smile Group: http://smile.deri.ie Digital Enterprise Research Institute National University of Ireland, Galway Institiúid Taighde na Fiontraíochta Digití Ollscoil na hÉireann, Gaillimh |
From: Knud H. M. <knu...@de...> - 2008-04-14 12:56:31
|
Hi Ferhat, thanks, I resolved the problem with the invalid initializer the way you described (a protocol works fine). However, I think my usecase involved another problem: Ruby only knows objects, no simpe datatypes (if I'm not mistaken). So, anything that is returned from Ruby to Obj-C is always an object. Thus, if I have a ruby method: def testNumber 666 end ... and call that from Obj-C, I need to explicitly convert the return value to an integer (if I want that): int aNumber = [[rubyObject testNumber] intValue]; That works. Now, what do I do with structs? E.g.: def dimensions OSX::NSSize.new(1024, 1024) # or: OSX::NSMakeSize(1024, 1024) end And from Obj-C: NSSize dimensions = [rubyObject dimensions]; This compiles (if I use the protocol method: http://www.rubycocoa.com/an-introduction-to-rubycocoa/4) , but results in nonsense data. Is there a way to do this correctly, or should I refrain from using structs alltogether? Cheers, Knud Am 14.04.2008 um 13:32 schrieb Ferhat Ayaz: > Ruby methods indeed do not define return types but Obj-C does. I'm > not sure but I guess the problem is that you are sending an > "unknown" message to dataSource and it treads it as obj-c id type. > So you would see the same compiler error if you try. > > id something; > NSSize originalSize = something; > > You have to define it in an obj-c interface. > > @interface KNTiledMap (ImNotSureButMaybeYouHaveToDoItAsCategory) > - (NSSize)dimensions; > @end > > > Ferhat > > ----- Original Message ---- > From: Knud Hinnerk Möller <knu...@de...> > To: rub...@li... > Sent: Monday, April 14, 2008 1:51:59 PM > Subject: Re: [Rubycocoa-talk] Importing Ruby Classes into Obj-C code > > > Am 14.04.2008 um 12:20 schrieb Ferhat Ayaz: > > > are you sure that [dataSource dimensions]; returns an NSSize? > > No, I can't be - Ruby methods don't define a return type. The error > already happens at compile time, not at runtime. > > Knud > > > > > > > Ferhat > > > > ----- Original Message ---- > > From: Knud Hinnerk Möller <knu...@de...> > > To: rub...@li... > > Sent: Monday, April 14, 2008 12:56:52 PM > > Subject: [Rubycocoa-talk] Importing Ruby Classes into Obj-C code > > > > Hi, > > > > please forgive me if this is a stupid question to ask, but is it > > possible to import a Ruby class definition into Obj-C? What I mean > is > > this: > > > > I have a RubyCocoa class: > > > > class KNTiledMap < OSX::NSObject > > attr_accessor :dimensions > > ... > > end > > > > I have an Obj-C class in which I want to use the Ruby class: > > > > @interface KNTileView : NSView { > > KNTiledMap *dataSource; > > } > > > > @implementation KNTileView > > ... > > NSSize originalSize = [dataSource dimensions]; > > ... > > @end > > > > This leads to a compile "error: invalid initializer". > > > > How can I make this work? > > > > Cheers, > > Knud > > ------------------------------------------------- > > Knud Möller, MA > > +353 - 91 - 495086 > > Smile Group: http://smile.deri.ie > > Digital Enterprise Research Institute > > National University of Ireland, Galway > > Institiúid Taighde na Fiontraíochta Digití > > Ollscoil na hÉireann, Gaillimh > > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > > Don't miss this year's exciting event. There's still time to save > > $100. > > Use priority code J8TL2D2. > > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > > _______________________________________________ > > Rubycocoa-talk mailing list > > Rub...@li... > > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > > > > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > > Don't miss this year's exciting event. There's still time to save > > $100. > > Use priority code J8TL2D2. > > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone_______________________________________________ > > Rubycocoa-talk mailing list > > Rub...@li... > > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > > ------------------------------------------------- > Knud Möller, MA > +353 - 91 - 495086 > Smile Group: http://smile.deri.ie > Digital Enterprise Research Institute > National University of Ireland, Galway > Institiúid Taighde na Fiontraíochta Digití > Ollscoil na hÉireann, Gaillimh > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save > $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save > $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone_______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk ------------------------------------------------- Knud Möller, MA +353 - 91 - 495086 Smile Group: http://smile.deri.ie Digital Enterprise Research Institute National University of Ireland, Galway Institiúid Taighde na Fiontraíochta Digití Ollscoil na hÉireann, Gaillimh |
From: Ferhat A. <fer...@ya...> - 2008-04-14 12:32:12
|
Ruby methods indeed do not define return types but Obj-C does. I'm not sure but I guess the problem is that you are sending an "unknown" message to dataSource and it treads it as obj-c id type. So you would see the same compiler error if you try. id something; NSSize originalSize = something; You have to define it in an obj-c interface. @interface KNTiledMap (ImNotSureButMaybeYouHaveToDoItAsCategory) - (NSSize)dimensions; @end Ferhat ----- Original Message ---- From: Knud Hinnerk Möller <knu...@de...> To: rub...@li... Sent: Monday, April 14, 2008 1:51:59 PM Subject: Re: [Rubycocoa-talk] Importing Ruby Classes into Obj-C code Am 14.04.2008 um 12:20 schrieb Ferhat Ayaz: > are you sure that [dataSource dimensions]; returns an NSSize? No, I can't be - Ruby methods don't define a return type. The error already happens at compile time, not at runtime. Knud > > > Ferhat > > ----- Original Message ---- > From: Knud Hinnerk Möller <knu...@de...> > To: rub...@li... > Sent: Monday, April 14, 2008 12:56:52 PM > Subject: [Rubycocoa-talk] Importing Ruby Classes into Obj-C code > > Hi, > > please forgive me if this is a stupid question to ask, but is it > possible to import a Ruby class definition into Obj-C? What I mean is > this: > > I have a RubyCocoa class: > > class KNTiledMap < OSX::NSObject > attr_accessor :dimensions > ... > end > > I have an Obj-C class in which I want to use the Ruby class: > > @interface KNTileView : NSView { > KNTiledMap *dataSource; > } > > @implementation KNTileView > ... > NSSize originalSize = [dataSource dimensions]; > ... > @end > > This leads to a compile "error: invalid initializer". > > How can I make this work? > > Cheers, > Knud > ------------------------------------------------- > Knud Möller, MA > +353 - 91 - 495086 > Smile Group: http://smile.deri.ie > Digital Enterprise Research Institute > National University of Ireland, Galway > Institiúid Taighde na Fiontraíochta Digití > Ollscoil na hÉireann, Gaillimh > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save > $100. > Use priority code J8TL2D2. > http://ad.doubleclick..net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save > $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone_______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk ------------------------------------------------- Knud Möller, MA +353 - 91 - 495086 Smile Group: http://smile.deri.ie Digital Enterprise Research Institute National University of Ireland, Galway Institiúid Taighde na Fiontraíochta Digití Ollscoil na hÉireann, Gaillimh ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ Rubycocoa-talk mailing list Rub...@li... https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ |
From: Knud H. M. <knu...@de...> - 2008-04-14 12:17:34
|
Am 14.04.2008 um 12:58 schrieb Axel M. Roest: > At 12:51 +0100 14-04-2008, Knud Hinnerk Möller wrote: >> > @implementation KNTileView >>> ... >>> NSSize originalSize = [dataSource dimensions]; >>> ... >>> @end >> > >> > This leads to a compile "error: invalid initializer". > > > How do you initialize the dataSource object? > You can e.g. do 'dataSource=KNTiledMap.new' or use Interface Builder > to instantiate the object from the class. Thanks for the help. Ok, there are three players here. KNTileMap, which is a RubyCocoa class, AppController, also a RubyCocoa class, and KNTileView, an Obj-C class. The view and controller get instantiated through IB. In the controller, there is this code: @map = KNTiledMap.alloc.initWithPath(@pathTextBox.stringValue) @tileView.setDataSource(@map) That works. In the view, I have now made the call to [dataSource dimensions] compile by adding a protocol definition to the view class (as shown here: http://www.rubycocoa.com/an-introduction-to-rubycocoa/ 4) - this seems very awkward. Also, the method call returns a nonsense value. Is there a problem with passing C structs through Ruby? Cheers, Knud ------------------------------------------------- Knud Möller, MA +353 - 91 - 495086 Smile Group: http://smile.deri.ie Digital Enterprise Research Institute National University of Ireland, Galway Institiúid Taighde na Fiontraíochta Digití Ollscoil na hÉireann, Gaillimh |
From: Eloy D. <e....@su...> - 2008-04-14 12:11:01
|
Or dynamically: map = [[NSClassFromString(@"KNTiledMap") alloc] init]; - Eloy On Apr 14, 2008, at 1:58 PM, Axel M. Roest wrote: > At 12:51 +0100 14-04-2008, Knud Hinnerk Möller wrote: >>> @implementation KNTileView >>> ... >>> NSSize originalSize = [dataSource dimensions]; >>> ... >>> @end >>> >>> This leads to a compile "error: invalid initializer". > > > How do you initialize the dataSource object? > You can e.g. do 'dataSource=KNTiledMap.new' or use Interface Builder > to instantiate the object from the class. > > > > Axel > > -- > _________________________ > Axel Roest > axelloroestello@{AIM/MSN} - Skype:axellofono - XOIP: 084-8749988 > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save > $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk |
From: Axel M. R. <rub...@ro...> - 2008-04-14 11:58:30
|
At 12:51 +0100 14-04-2008, Knud Hinnerk Möller wrote: > > @implementation KNTileView >> ... >> NSSize originalSize = [dataSource dimensions]; >> ... >> @end > > > > This leads to a compile "error: invalid initializer". How do you initialize the dataSource object? You can e.g. do 'dataSource=KNTiledMap.new' or use Interface Builder to instantiate the object from the class. Axel -- _________________________ Axel Roest axelloroestello@{AIM/MSN} - Skype:axellofono - XOIP: 084-8749988 |
From: Knud H. M. <knu...@de...> - 2008-04-14 11:52:30
|
Am 14.04.2008 um 12:20 schrieb Ferhat Ayaz: > are you sure that [dataSource dimensions]; returns an NSSize? No, I can't be - Ruby methods don't define a return type. The error already happens at compile time, not at runtime. Knud > > > Ferhat > > ----- Original Message ---- > From: Knud Hinnerk Möller <knu...@de...> > To: rub...@li... > Sent: Monday, April 14, 2008 12:56:52 PM > Subject: [Rubycocoa-talk] Importing Ruby Classes into Obj-C code > > Hi, > > please forgive me if this is a stupid question to ask, but is it > possible to import a Ruby class definition into Obj-C? What I mean is > this: > > I have a RubyCocoa class: > > class KNTiledMap < OSX::NSObject > attr_accessor :dimensions > ... > end > > I have an Obj-C class in which I want to use the Ruby class: > > @interface KNTileView : NSView { > KNTiledMap *dataSource; > } > > @implementation KNTileView > ... > NSSize originalSize = [dataSource dimensions]; > ... > @end > > This leads to a compile "error: invalid initializer". > > How can I make this work? > > Cheers, > Knud > ------------------------------------------------- > Knud Möller, MA > +353 - 91 - 495086 > Smile Group: http://smile.deri.ie > Digital Enterprise Research Institute > National University of Ireland, Galway > Institiúid Taighde na Fiontraíochta Digití > Ollscoil na hÉireann, Gaillimh > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save > $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save > $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone_______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk ------------------------------------------------- Knud Möller, MA +353 - 91 - 495086 Smile Group: http://smile.deri.ie Digital Enterprise Research Institute National University of Ireland, Galway Institiúid Taighde na Fiontraíochta Digití Ollscoil na hÉireann, Gaillimh |
From: Allison N. <dem...@ma...> - 2008-04-14 11:50:38
|
Merci beaucoup! Actually, I thought I had already tried that, with it ending up in an infinite loop... I guess not. On Monday, April 14, 2008, at 10:43AM, "Satoshi Nakagawa" <sna...@in...> wrote: >Hi, > >You can call the method of the super class with "super_" prefix like >super_trackMouse_inRect_ofView_untilMouseUp. > >-- >Satoshi Nakagawa > >On 2008/04/14, at 16:44, Allison Newman wrote: > >> Hi again, >> >> I've got another newbie question to ask. When I override a method >> of a Cocoa class with a Ruby method, how do I call the superclass's >> overridden version of the method? I've tried the standard Ruby >> 'super', but that just ends up with a stack overflow due to an >> infinite recursive loop. >> >> Specifically, I have a subclass of NSCell that overrides >> trackMouse_inRect_ofView_untilMouseUp, but NSCell does some useful >> processing in it's version of the function. How do I call it? >> >> Thanks for any help (or an explanation that what I want to do is not >> possible...) >> >> Alli > > >------------------------------------------------------------------------- >This SF.net email is sponsored by the 2008 JavaOne(SM) Conference >Don't miss this year's exciting event. There's still time to save $100. >Use priority code J8TL2D2. >http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone >_______________________________________________ >Rubycocoa-talk mailing list >Rub...@li... >https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > > |
From: Ferhat A. <fer...@ya...> - 2008-04-14 11:20:17
|
are you sure that [dataSource dimensions]; returns an NSSize? Ferhat ----- Original Message ---- From: Knud Hinnerk Möller <knu...@de...> To: rub...@li... Sent: Monday, April 14, 2008 12:56:52 PM Subject: [Rubycocoa-talk] Importing Ruby Classes into Obj-C code Hi, please forgive me if this is a stupid question to ask, but is it possible to import a Ruby class definition into Obj-C? What I mean is this: I have a RubyCocoa class: class KNTiledMap < OSX::NSObject attr_accessor :dimensions ... end I have an Obj-C class in which I want to use the Ruby class: @interface KNTileView : NSView { KNTiledMap *dataSource; } @implementation KNTileView ... NSSize originalSize = [dataSource dimensions]; ... @end This leads to a compile "error: invalid initializer". How can I make this work? Cheers, Knud ------------------------------------------------- Knud Möller, MA +353 - 91 - 495086 Smile Group: http://smile.deri.ie Digital Enterprise Research Institute National University of Ireland, Galway Institiúid Taighde na Fiontraíochta Digití Ollscoil na hÉireann, Gaillimh ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ Rubycocoa-talk mailing list Rub...@li... https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ |
From: Axel M. R. <rub...@ro...> - 2008-04-14 11:15:06
|
>Hi, > >please forgive me if this is a stupid question to ask, but is it >possible to import a Ruby class definition into Obj-C? What I mean is >this: yes, this is possible, and easy. There's a good example online at http://www.rubycocoa.com/an-introduction-to-rubycocoa/ which explains connecting ruby with Objective-C classes. Some of the material is outdated. It is e.g. not necessary anymore to 'ns_import' the OS X classes. I've just recently written an application with 2 Obj.C NSViews, 5 pure ruby classes and 3 rubycocoa classes (inherited from NSObject) works like a charm :) Axel -- _________________________ Axel Roest axelloroestello@{AIM/MSN} - Skype:axellofono - XOIP: 084-8749988 |
From: Knud H. M. <knu...@de...> - 2008-04-14 10:57:20
|
Hi, please forgive me if this is a stupid question to ask, but is it possible to import a Ruby class definition into Obj-C? What I mean is this: I have a RubyCocoa class: class KNTiledMap < OSX::NSObject attr_accessor :dimensions ... end I have an Obj-C class in which I want to use the Ruby class: @interface KNTileView : NSView { KNTiledMap *dataSource; } @implementation KNTileView ... NSSize originalSize = [dataSource dimensions]; ... @end This leads to a compile "error: invalid initializer". How can I make this work? Cheers, Knud ------------------------------------------------- Knud Möller, MA +353 - 91 - 495086 Smile Group: http://smile.deri.ie Digital Enterprise Research Institute National University of Ireland, Galway Institiúid Taighde na Fiontraíochta Digití Ollscoil na hÉireann, Gaillimh |
From: Satoshi N. <sna...@in...> - 2008-04-14 08:43:18
|
Hi, You can call the method of the super class with "super_" prefix like super_trackMouse_inRect_ofView_untilMouseUp. -- Satoshi Nakagawa On 2008/04/14, at 16:44, Allison Newman wrote: > Hi again, > > I've got another newbie question to ask. When I override a method > of a Cocoa class with a Ruby method, how do I call the superclass's > overridden version of the method? I've tried the standard Ruby > 'super', but that just ends up with a stack overflow due to an > infinite recursive loop. > > Specifically, I have a subclass of NSCell that overrides > trackMouse_inRect_ofView_untilMouseUp, but NSCell does some useful > processing in it's version of the function. How do I call it? > > Thanks for any help (or an explanation that what I want to do is not > possible...) > > Alli |
From: Allison N. <dem...@ma...> - 2008-04-14 07:44:46
|
Hi again, I've got another newbie question to ask. When I override a method of a Cocoa class with a Ruby method, how do I call the superclass's overridden version of the method? I've tried the standard Ruby 'super', but that just ends up with a stack overflow due to an infinite recursive loop. Specifically, I have a subclass of NSCell that overrides trackMouse_inRect_ofView_untilMouseUp, but NSCell does some useful processing in it's version of the function. How do I call it? Thanks for any help (or an explanation that what I want to do is not possible...) Alli |
From: Eloy D. <elo...@gm...> - 2008-04-11 23:31:33
|
Hi, I've put a git mirror of RubyCocoa up on github.com for people that would like to dig through the source with the comfort of Git. http://github.com/alloy/rubycocoa/tree/master Cheers, Eloy |
From: Allison N. <dem...@ma...> - 2008-04-11 11:42:48
|
*blink* *blink* *embarassed blush* Oh crap!, I really should have seen that :-) Thanks for the help. On Friday, April 11, 2008, at 01:27PM, "Eloy Duran" <e....@su...> wrote: >Hi Alli, > >It works fine for me: > > >> class BarCell < NSCell > >> def initTextCell(str) > >> puts 'here' > >> super_initTextCell(str) > >> end > >> end >=> nil > >> BarCell.alloc.initTextCell('foo') >here >=> #<BarCell:0x363df0 class='BarCell' id=0x581390> > >> BarCell.initTextCell('foo') >OSX::OCMessageSendException: Can't get Objective-C method signature >for selector 'initTextCell:' of receiver BarCell > from /Library/Frameworks/RubyCocoa.framework/Resources/ruby/osx/objc/ >oc_wrapper.rb:50:in `ocm_send' > from /Library/Frameworks/RubyCocoa.framework/Resources/ruby/osx/objc/ >oc_wrapper.rb:50:in `method_missing' > from (irb):10 > > >It looks like you are sending the initTextCell: message to the class >BarCell instead of to an instance. >So you should first send it the alloc message to get back an instance >and then send it the initTextCell: message > >Cheers, >Eloy > |
From: Eloy D. <e....@su...> - 2008-04-11 11:27:51
|
Hi Alli, It works fine for me: >> class BarCell < NSCell >> def initTextCell(str) >> puts 'here' >> super_initTextCell(str) >> end >> end => nil >> BarCell.alloc.initTextCell('foo') here => #<BarCell:0x363df0 class='BarCell' id=0x581390> >> BarCell.initTextCell('foo') OSX::OCMessageSendException: Can't get Objective-C method signature for selector 'initTextCell:' of receiver BarCell from /Library/Frameworks/RubyCocoa.framework/Resources/ruby/osx/objc/ oc_wrapper.rb:50:in `ocm_send' from /Library/Frameworks/RubyCocoa.framework/Resources/ruby/osx/objc/ oc_wrapper.rb:50:in `method_missing' from (irb):10 It looks like you are sending the initTextCell: message to the class BarCell instead of to an instance. So you should first send it the alloc message to get back an instance and then send it the initTextCell: message Cheers, Eloy On Apr 11, 2008, at 1:05 PM, Allison Newman wrote: > Hi everyone (on this apparently rather quiet mailing list!) > > I'm having a problem with creating a subclass of NSCell. > Specifically, I am trying to initilise it as follows: > > cell = BarCell.initTextCell_("") > > The class definition for BarCell looks like this: > > class BarCell < NSCell > attr_accessor :highlighted > > def initTextCell_(str) > super_initTextCell_(str) > end > end > > I'm getting back an error that the bridge can't find the Objective-C > method for the init... > > Can't get Objective-C method signature for selector 'initTextCell:' > of receiver BarCell > > I've tried everything that I can think of, including playing around > with the underscore on the end of the function declarations and > references. Can anyone explain to me what is going on? (I've never > had any trouble subclassing NSControls or NSViews) > > Alli > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save > $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk |
From: Allison N. <dem...@ma...> - 2008-04-11 11:05:10
|
Hi everyone (on this apparently rather quiet mailing list!) I'm having a problem with creating a subclass of NSCell. Specifically, I am trying to initilise it as follows: cell = BarCell.initTextCell_("") The class definition for BarCell looks like this: class BarCell < NSCell attr_accessor :highlighted def initTextCell_(str) super_initTextCell_(str) end end I'm getting back an error that the bridge can't find the Objective-C method for the init... Can't get Objective-C method signature for selector 'initTextCell:' of receiver BarCell I've tried everything that I can think of, including playing around with the underscore on the end of the function declarations and references. Can anyone explain to me what is going on? (I've never had any trouble subclassing NSControls or NSViews) Alli |