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: elliottcable <me...@el...> - 2008-09-06 22:31:16
|
I have very simple requirements: I need a tiny, absolutely simple tool to pass handling of URLs, OS X style, to a more complicated, actually- ruby (not RubyCocoa, GUI-less) tool. I've started my first RubyCocoa app as a non-document-based, Core Data RubyCocoa application in Xcode, and I've played around with some RubyCocoa tutorials on the net, so I've got the basics down. The only thing I can't figure out is *where* to place the following snippets that I've put together from various Ruby and/or ObjC code relating to this topic: http://gist.github.com/9058 I've got the Info.plist code worked out, so after a build in Xcode, OS X will open MyApp.app when I type myapp:test into Safari's location bar. I've also placed the `registerMyApp` snippet into rb_main.rb, and a call to that `registerMyApp` method in the `rb_main_init` method in said file; I've placed the `getUrl_withReplyEvent` method in my AppDelegate class in myappAppDelegate.rb However, my hook code (the meat of `getUrl_withReplyEvent`, which should `say` the URL out loud [the only way I know of to get information out of the app, because printing it won't show anywhere] and allow me to work with the URL at some point in the future) never seems to get run. Also, I have no idea if the `registerMyApp` code was successfully executed or not - I don't get any errors as it is currently structured. First of all, does anybody have any prior experience with working with URLs like this in a RubyCocoa app; second, the (ObjC focused) documentation for this stuff says to place this code within the ObjC `init()` function - where's the equivalent of that for a RubyCocoa app? --------------------------------------------------------- elliott cable _ _ +1.919.636.4204 ( \---/ ) elliottcable.name ) . . ( me...@el... ____________________,--._(___Y___)_,--.__________________ `--' `--' THIS MESSAGE (and any attached materials) IS INTENDED ONLY FOR THE USE OF THE INDIVIDUAL OR ENTITY TO WHICH IT IS ADDRESSED AND MAY CONTAIN INFORMATION THAT IS PRIVILEGED, CONFIDENTIAL, AND EXEMPT FROM DISCLOSURE UNDER APPLICABLE LAW. If you, the reader of this message, are not the intended recipient or the agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify me immediately by replying to this message and deleting all traces of it from your computer. Thank you. five.sentenc.es _________________________________________________________ Signature licensed under Creative Commons BY-NC-SA 3.0 Do not use it, unless you follow those terms! 〆 |
From: Brian M. <ma...@ex...> - 2008-08-27 15:29:05
|
On Aug 27, 2008, at 9:37 AM, Allison Newman wrote: > How are you populating @preferences.translator_display_names[]? Like this: archived = NSUserDefaults.standardUserDefaults.objectForKey(:translators) @translator_preferences = archived.collect do | nsdatum | NSKeyedUnarchiver.unarchiveObjectWithData(nsdatum) end @translator_preferences.collect { | t | t.display_name } ----- Brian Marick, independent consultant Mostly on agile methods with a testing slant www.exampler.com, www.exampler.com/blog, www.twitter.com/marick |
From: Brian M. <ma...@ex...> - 2008-08-27 14:15:15
|
On Aug 27, 2008, at 12:04 AM, Allison Newman wrote: > In my (admittedly limited) experience with RubyCocoa, the bug most > likely to make the internals of Cocoa blow up is when you hand Cocoa > a Ruby Object that has been generated by a factory class. My > personal favourite of these is objects generated by YAML, but I'm > sure there are others. > > Is your problem always associated with NSNotificationCenter? How > are you generating the observer objects? Can you post that code? The interesting thing here is that I'm not causing the notification to be sent. It's happening on a mouse-down. None of my code observes those notifications. Here's the code that manages the combo boxes. It's in a controller (loaded from main nib). It talks to a class that loads-and-decodes user preferences. (Not using NSUserDefaultsController yet.) def awakeFromNib @comboBox.usesDataSource = true @comboBox.dataSource = self @comboBox.stringValue = @preferences.display_name_of_favorite_translator super end # In role as data source def numberOfItemsInComboBox(ignored) @preferences.translator_display_names.size end def comboBox_objectValueForItemAtIndex(ignored, index) @preferences.translator_display_names[index] end def comboBox_indexOfItemWithStringValue(ignored, string) @preferences.translator_display_names.index(string) || NSNotFound end ----- Brian Marick, independent consultant Mostly on agile methods with a testing slant www.exampler.com, www.exampler.com/blog, www.twitter.com/marick |
From: Allison N. <dem...@ma...> - 2008-08-27 05:04:25
|
Hi Brian, In my (admittedly limited) experience with RubyCocoa, the bug most likely to make the internals of Cocoa blow up is when you hand Cocoa a Ruby Object that has been generated by a factory class. My personal favourite of these is objects generated by YAML, but I'm sure there are others. Is your problem always associated with NSNotificationCenter? How are you generating the observer objects? Can you post that code? Hope that helps, Alli Le 27 août 08 à 00:55, Brian Marick a écrit : > I occasionally get the following dump when using my app. It happens > when I repeatedly and alternately click a combo box and a button, but > not after a predictable number of clicks. It seems to always happen in > a combo box click. Ideas? Could this have anything to do with > RubyCocoa? > > #0 0x9566beba in _objc_error () > #1 0x9566bef0 in __objc_error () > #2 0x9566a8f7 in _freedHandler () > #3 0x92c9b54a in _nsnote_callback () > #4 0x94692aba in __CFXNotificationPost () > #5 0x94692d93 in _CFXNotificationPostNotification () > #6 0x92c987b0 in -[NSNotificationCenter > postNotificationName:object:userInfo:] () > #7 0x96b661dd in .LCFI1 () > #8 0x96b66771 in ffi_call () > #9 0x00042a6c in rb_ffi_dispatch () > #10 0x0002db65 in objcptr_s_new_with_cptr () > #11 0x0002ee44 in init_mdl_OCObjWrapper () > #12 0x96b66424 in ffi_closure_SYSV () > #13 0x000dc1d8 in rb_eval_string_wrap () > #14 0x000dcdec in rb_eval_string_wrap () > #15 0x000da06d in rb_eval_string_wrap () > #16 0x000dc9de in rb_eval_string_wrap () > #17 0x000dcdec in rb_eval_string_wrap () > #18 0x000da06d in rb_eval_string_wrap () > #19 0x000dc9de in rb_eval_string_wrap () > #20 0x000dcdec in rb_eval_string_wrap () > #21 0x000da06d in rb_eval_string_wrap () > #22 0x000e01fc in rb_thread_trap_eval () > #23 0x000e086a in rb_thread_trap_eval () > #24 0x000dc43a in rb_eval_string_wrap () > #25 0x000dcdec in rb_eval_string_wrap () > #26 0x000e6347 in rb_apply () > #27 0x00035371 in install_ovmix_hooks () > #28 0x000d1fe5 in rb_protect () > #29 0x00036449 in rbobj_call_ruby () > #30 0x00036ad9 in rbobj_call_ruby () > #31 0x00035ce6 in install_ovmix_hooks () > #32 0x0003414f in ovmix_register_ruby_method () > #33 0x947309aa in ___forwarding___ () > #34 0x94730a12 in __forwarding_prep_0___ () > #35 0x93f15c23 in -[NSApplication sendAction:to:from:] () > #36 0x93f15b60 in -[NSControl sendAction:to:] () > #37 0x93f159e6 in -[NSCell _sendActionFrom:] () > #38 0x93f1503f in -[NSCell trackMouse:inRect:ofView:untilMouseUp:] () > #39 0x93f14892 in -[NSButtonCell > trackMouse:inRect:ofView:untilMouseUp:] () > #40 0x93f1414c in -[NSControl mouseDown:] () > #41 0x93f1288b in -[NSWindow sendEvent:] () > #42 0x93edf431 in -[NSApplication sendEvent:] () > #43 0x93e3ce27 in -[NSApplication run] () > #44 0x93e0a030 in NSApplicationMain () > #45 0x96b661dd in .LCFI1 () > #46 0x96b66771 in ffi_call () > #47 0x00042a6c in rb_ffi_dispatch () > #48 0x0003b2ed in find_bs_boxed_by_encoding () > #49 0x000d2c47 in rb_with_disable_interrupt () > #50 0x000dc1d8 in rb_eval_string_wrap () > #51 0x000dcdec in rb_eval_string_wrap () > #52 0x000da06d in rb_eval_string_wrap () > #53 0x000e8f62 in rb_load_protect () > #54 0x000e8f93 in ruby_exec () > #55 0x000e8fbf in ruby_run () > #56 0x000386ac in RBApplicationMain () > #57 0x00001fed in main (argc=1, argv=0xbfffe3ac) at /Users/marick/ > writing/rubycocoa-book/Book/code/fenestra/preferred-list/main.m:14 > > ----- > Brian Marick, independent consultant > Mostly on agile methods with a testing slant > www.exampler.com, www.exampler.com/blog, www.twitter.com/marick > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win > great prizes > Grand prize is a trip for two to an Open Source event anywhere in > the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk |
From: Brian M. <ma...@ex...> - 2008-08-26 23:03:51
|
Note: the problem isn't always in _freedHandler(). Sometimes it's in objc_msgSend: (gdb) bt #0 0x9567b6e8 in objc_msgSend () #1 0x92c9b54a in _nsnote_callback () #2 0x94692aba in __CFXNotificationPost () #3 0x94692d93 in _CFXNotificationPostNotification () #4 0x92c987b0 in -[NSNotificationCenter postNotificationName:object:userInfo:] () ----- Brian Marick, independent consultant Mostly on agile methods with a testing slant www.exampler.com, www.exampler.com/blog, www.twitter.com/marick |
From: Brian M. <ma...@ex...> - 2008-08-26 22:56:05
|
I occasionally get the following dump when using my app. It happens when I repeatedly and alternately click a combo box and a button, but not after a predictable number of clicks. It seems to always happen in a combo box click. Ideas? Could this have anything to do with RubyCocoa? #0 0x9566beba in _objc_error () #1 0x9566bef0 in __objc_error () #2 0x9566a8f7 in _freedHandler () #3 0x92c9b54a in _nsnote_callback () #4 0x94692aba in __CFXNotificationPost () #5 0x94692d93 in _CFXNotificationPostNotification () #6 0x92c987b0 in -[NSNotificationCenter postNotificationName:object:userInfo:] () #7 0x96b661dd in .LCFI1 () #8 0x96b66771 in ffi_call () #9 0x00042a6c in rb_ffi_dispatch () #10 0x0002db65 in objcptr_s_new_with_cptr () #11 0x0002ee44 in init_mdl_OCObjWrapper () #12 0x96b66424 in ffi_closure_SYSV () #13 0x000dc1d8 in rb_eval_string_wrap () #14 0x000dcdec in rb_eval_string_wrap () #15 0x000da06d in rb_eval_string_wrap () #16 0x000dc9de in rb_eval_string_wrap () #17 0x000dcdec in rb_eval_string_wrap () #18 0x000da06d in rb_eval_string_wrap () #19 0x000dc9de in rb_eval_string_wrap () #20 0x000dcdec in rb_eval_string_wrap () #21 0x000da06d in rb_eval_string_wrap () #22 0x000e01fc in rb_thread_trap_eval () #23 0x000e086a in rb_thread_trap_eval () #24 0x000dc43a in rb_eval_string_wrap () #25 0x000dcdec in rb_eval_string_wrap () #26 0x000e6347 in rb_apply () #27 0x00035371 in install_ovmix_hooks () #28 0x000d1fe5 in rb_protect () #29 0x00036449 in rbobj_call_ruby () #30 0x00036ad9 in rbobj_call_ruby () #31 0x00035ce6 in install_ovmix_hooks () #32 0x0003414f in ovmix_register_ruby_method () #33 0x947309aa in ___forwarding___ () #34 0x94730a12 in __forwarding_prep_0___ () #35 0x93f15c23 in -[NSApplication sendAction:to:from:] () #36 0x93f15b60 in -[NSControl sendAction:to:] () #37 0x93f159e6 in -[NSCell _sendActionFrom:] () #38 0x93f1503f in -[NSCell trackMouse:inRect:ofView:untilMouseUp:] () #39 0x93f14892 in -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] () #40 0x93f1414c in -[NSControl mouseDown:] () #41 0x93f1288b in -[NSWindow sendEvent:] () #42 0x93edf431 in -[NSApplication sendEvent:] () #43 0x93e3ce27 in -[NSApplication run] () #44 0x93e0a030 in NSApplicationMain () #45 0x96b661dd in .LCFI1 () #46 0x96b66771 in ffi_call () #47 0x00042a6c in rb_ffi_dispatch () #48 0x0003b2ed in find_bs_boxed_by_encoding () #49 0x000d2c47 in rb_with_disable_interrupt () #50 0x000dc1d8 in rb_eval_string_wrap () #51 0x000dcdec in rb_eval_string_wrap () #52 0x000da06d in rb_eval_string_wrap () #53 0x000e8f62 in rb_load_protect () #54 0x000e8f93 in ruby_exec () #55 0x000e8fbf in ruby_run () #56 0x000386ac in RBApplicationMain () #57 0x00001fed in main (argc=1, argv=0xbfffe3ac) at /Users/marick/ writing/rubycocoa-book/Book/code/fenestra/preferred-list/main.m:14 ----- Brian Marick, independent consultant Mostly on agile methods with a testing slant www.exampler.com, www.exampler.com/blog, www.twitter.com/marick |
From: Allison N. <dem...@ma...> - 2008-08-26 10:50:08
|
I've just finished writing a little snippet of code that made me remember why I love programming in Ruby so much, and how great it is that RubyCocoa lets me do so whilst accessing all the glory that is Cocoa :-) So I thought I'd share :-) It's an application of open classes in Ruby. Basically I wanted a method that would give me an NSImage of any NSView that I wanted. So here it is: require 'osx/cocoa' include OSX class NSView < NSResponder def captureImage bit_image_rep = self.bitImageRepForCachingDisplayInRect(self.visibleRect) self.cacheDisplayInRect_toBitmapImageRep(self.visibleRect, bit_image_rep) image = NSImage.alloc.initWithSize(bit_image_rep.size) image.addRepresentation(bit_image_rep) image end end And to use it: frame = NSRect.new(0, 0, 100, 100) some_view = NSButton.alloc.initWithFrame(frame) image = some_view.captureImage Although why you'd want to capture the image of a button is beyond me... Actually, being a bit of a Cocoa newbie, is there a simpler way of doing this? Alli |
From: Satoshi N. <ps...@li...> - 2008-08-20 10:01:21
|
Growl Notifier 1.0.1 has been released. http://rubyforge.org/projects/growlnotifier/ http://growlnotifier.rubyforge.org/ Growl Notifier allows your application to post Growl notifications. It can then receive clicked and timed out notifications from Growl. Or you can give it a block, which will then be used as a clicked callback. It is an extraction and clean up of the Growl code from LimeChat. The option to pass procs is extracted from WebApp. LimeChat: http://github.com/psychs/limechat/tree/master WebApp: http://github.com/alloy/webapp-app/tree/master == Installation gem install growlnotifier == Requirements * Mac OS X 10.4 or 10.5 * Ruby 1.8 * RubyCocoa 0.13.1 == Example require 'rubygems' require 'growl' class GrowlController < OSX::NSObject HELLO_TYPE = 'Hello message received' def init if super_init @g = Growl::Notifier.sharedInstance @g.delegate = self @g.register('GrowlSample', [HELLO_TYPE]) @g.notify(HELLO_TYPE, 'Sticky', 'Hello world', :sticky => true, :click_context => Time.now.to_s ) @g.notify(HELLO_TYPE, 'Timed out', 'Hello world', :click_context => Time.now.to_s ) @count = 2 self end end def growlNotifierClicked_context(sender, context) puts "Clicked: #{context}" checkCount end def growlNotifierTimedOut_context(sender, context) puts "Timed out: #{context}" checkCount end def checkCount @count -= 1 OSX::NSApp.terminate(nil) if @count == 0 end end g = GrowlController.alloc.init OSX::NSApp.run -- Satoshi Nakagawa |
From: Craig W. <cwi...@ma...> - 2008-08-19 15:53:53
|
A friend of mine wrote a Python script to access the DictionaryServices framework. It was a little slow so I wrote one in Ruby and Obj-C to compare. With Ruby I am getting the error as shown below. Any suggestions as to what I am missing here? Toda, (thanks) Craig Obj-C code that works: NSString *searchword = [args objectAtIndex:1]; CFRange range = CFRangeMake(0, [searchword length]); CFStringRef def = DCSCopyTextDefinition(NULL, searchword, range); Python code that works: searchword = sys.argv[1].decode('utf-8') wordrange = (0, len(searchword)) dictresult = DCSCopyTextDefinition(None, searchword, wordrange) Ruby code: word = 'History' # also tried as NSString word_len = NSRange.new(0, word.length) # also tried as CFRange puts DCSCopyTextDefinition(nil, word, word_len) The error: OSX::OCDataConvException: Cannot convert the argument #2 as '{?=ii}' to Objective-C Frameworks: require 'osx/cocoa'; include OSX require_framework '/System/Library/Frameworks/CoreServices.framework/ Frameworks/DictionaryServices.framework' DictionaryServices would not load without the full path. |
From: Stephyn B. <ste...@co...> - 2008-08-19 14:51:57
|
Greg, I gave your suggestion a try. require 'rubygems' require 'osx/cocoa' require 'rexml/document' Interestingly, this delayed the crash until I actually called exportModel whereas before the application crashed instantly. I tried using rexml via require 'rexml/document' in a toy application I had sitting around and everything worked out just fine. Because I am had similar issues with builder (although at seemingly random places), this leads me to believe that there is something wrong with this project....but just what that could be completely escapes me. The only clue I have is the backtrace--which isn't very useful to me. Can a project file get corrupted? Has anyone observed a similar behavior? Cheers, Steve On Aug 19, 2008, at 7:35 AM, rub...@li... wrote: > Message: 1 > Date: Mon, 18 Aug 2008 17:11:40 -0700 > From: Gregory Clarke <gr...@in...> > Subject: Re: [Rubycocoa-talk] problems when "require"-ing libraries or > gems > To: rub...@li... > Message-ID: > <6D6...@in...> > Content-Type: text/plain; charset="us-ascii" > > Hi Steve, > > You might need a require 'rubygems' before the require 'rexml/ > document'. Certainly that's true for Builder. I've used REXML in my > latest RubyCocoa projects, along with other gems, and require > 'rubygems' is my first line. > > Hope this helps, > Greg |
From: Eloy D. <elo...@gm...> - 2008-08-19 13:40:54
|
I always explicitly require the bridgesupport files in this way. Actually this is most of the times the way I load a framework, so I don't add it in the xcode project unless it's really needed. So afaik if you load a framework by adding it to the linked frameworks in your xcode project, you still need to tell the bridge to load the bridgesupport file. Laurent, any input on this matter? Eloy On Aug 19, 2008, at 2:32 PM, Allison Newman wrote: > Yup, everything worked fine after I called require_framework 'QTKit' > > Actually, do you know why we have to do this manually? I would have > thought that all of the frameworks that are loaded automatically > should also load the .bridgesupport files. Am I actually looking at > a bug do you think? > > Alli |
From: Allison N. <dem...@ma...> - 2008-08-19 12:07:04
|
Oh, never mind, I just added a: require_framework 'QTKit' to the top of my file, and it works fine now... Thanks for the help Eloy. On Tuesday, August 19, 2008, at 01:35PM, "Eloy Duran" <elo...@gm...> wrote: >Hi Alli, > >Normally you'd cerate a bridge support file like so: > >$ gen_bridge_metadata -f QTKit > QTKit.bridgesupport > >Where -f stands for a framework name in one of the default load paths. >However, trying to wrap QTKit results in the following error: >"undefined local variable or method `trans' for <UNDEFINED> ... </ > >:REXML::Document" > >So I guess you'd need to debug this to get it to completely wrap the >framework. > >- Eloy > >On Aug 19, 2008, at 12:56 PM, Allison Newman wrote: > >> Hi everyone, >> >> I'm currently having trouble with writing some code to generate a >> Quicktime movie file. When I wish to add an image to the file, I >> have to create a QTTime struct. >> >> When I do this for most of the standard Cocoa structs, such as >> NSRect, NSPoint etc, I can simply do: >> >> point = NSPoint.new(1, 2) >> >> This works. However if I try the same idea with a QTTime: >> >> qt_time = QTTime.new(1, 10, 0) >> >> RubyCocoa dies, claiming it doesn't know the constant QTTime. >> >> I have tried looking inside the RubyCocoa framework to see how the >> magic is done for the NSxxxx structs, but I found the following >> comment in oc_types.rb: >> >> # This module adds syntax-sugar APIs on top of the Cocoa structures. >> # This is mostly to preserve backwards compatibility with previous >> versions >> # of RubyCocoa where the C structures support was hardcoded in the >> bridge. >> # Now structures are automatically handled via the metadata >> mechanism, but >> # the API is not compatible with what we used to have. >> >> If I understand correctly, this means that QTKit has not had >> metadata generated for it to handle things such as structs etc. Can >> anyone confirm that this is the case, and if so, point me in the >> direction of some documentation explaining how it is done. With a >> bit of luck, I'll even be able to add the QTKit metadata back into >> the RubyCocoa project. >> >> Thanks for any help. >> >> Alli >> >> ------------------------------------------------------------------------- >> This SF.Net email is sponsored by the Moblin Your Move Developer's >> challenge >> Build the coolest Linux based applications with Moblin SDK & win >> great prizes >> Grand prize is a trip for two to an Open Source event anywhere in >> the world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> Rubycocoa-talk mailing list >> Rub...@li... >> https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > > >------------------------------------------------------------------------- >This SF.Net email is sponsored by the Moblin Your Move Developer's challenge >Build the coolest Linux based applications with Moblin SDK & win great prizes >Grand prize is a trip for two to an Open Source event anywhere in the world >http://moblin-contest.org/redirect.php?banner_id=100&url=/ >_______________________________________________ >Rubycocoa-talk mailing list >Rub...@li... >https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > > |
From: Eloy D. <e....@su...> - 2008-08-19 12:05:32
|
Hi Alli, No problem, thanks! I should have known though, but solving that issue was beyond the scope of giving you the answer :) So did it wrap everything correctly? If so, you might want to file a radar ticket with apple to get the bridgesupport file added in an update. - Eloy On Aug 19, 2008, at 1:59 PM, Allison Newman wrote: > Eloy, > > Apparently you need to patch your rexml/document.rb. See here: > http://rubycocoa.sourceforge.net/GettingStarted > > (Sorry to send you to the newbie site, but it describes your result > perfectly - gen_bridge_metadata on QTKit works on my system.) > > Alli > > On Tuesday, August 19, 2008, at 01:35PM, "Eloy Duran" <elo...@gm... > > wrote: >> Hi Alli, >> >> Normally you'd cerate a bridge support file like so: >> >> $ gen_bridge_metadata -f QTKit > QTKit.bridgesupport >> >> Where -f stands for a framework name in one of the default load >> paths. >> However, trying to wrap QTKit results in the following error: >> "undefined local variable or method `trans' for <UNDEFINED> ... </ >>> :REXML::Document" >> >> So I guess you'd need to debug this to get it to completely wrap the >> framework. >> >> - Eloy >> >> On Aug 19, 2008, at 12:56 PM, Allison Newman wrote: >> >>> Hi everyone, >>> >>> I'm currently having trouble with writing some code to generate a >>> Quicktime movie file. When I wish to add an image to the file, I >>> have to create a QTTime struct. >>> >>> When I do this for most of the standard Cocoa structs, such as >>> NSRect, NSPoint etc, I can simply do: >>> >>> point = NSPoint.new(1, 2) >>> >>> This works. However if I try the same idea with a QTTime: >>> >>> qt_time = QTTime.new(1, 10, 0) >>> >>> RubyCocoa dies, claiming it doesn't know the constant QTTime. >>> >>> I have tried looking inside the RubyCocoa framework to see how the >>> magic is done for the NSxxxx structs, but I found the following >>> comment in oc_types.rb: >>> >>> # This module adds syntax-sugar APIs on top of the Cocoa structures. >>> # This is mostly to preserve backwards compatibility with previous >>> versions >>> # of RubyCocoa where the C structures support was hardcoded in the >>> bridge. >>> # Now structures are automatically handled via the metadata >>> mechanism, but >>> # the API is not compatible with what we used to have. >>> >>> If I understand correctly, this means that QTKit has not had >>> metadata generated for it to handle things such as structs etc. Can >>> anyone confirm that this is the case, and if so, point me in the >>> direction of some documentation explaining how it is done. With a >>> bit of luck, I'll even be able to add the QTKit metadata back into >>> the RubyCocoa project. >>> >>> Thanks for any help. >>> >>> Alli >>> >>> ------------------------------------------------------------------------- >>> This SF.Net email is sponsored by the Moblin Your Move Developer's >>> challenge >>> Build the coolest Linux based applications with Moblin SDK & win >>> great prizes >>> Grand prize is a trip for two to an Open Source event anywhere in >>> the world >>> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >>> _______________________________________________ >>> Rubycocoa-talk mailing list >>> Rub...@li... >>> https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk >> >> >> ------------------------------------------------------------------------- >> This SF.Net email is sponsored by the Moblin Your Move Developer's >> challenge >> Build the coolest Linux based applications with Moblin SDK & win >> great prizes >> Grand prize is a trip for two to an Open Source event anywhere in >> the world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> Rubycocoa-talk mailing list >> Rub...@li... >> https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk >> >> > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win > great prizes > Grand prize is a trip for two to an Open Source event anywhere in > the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk |
From: Allison N. <dem...@ma...> - 2008-08-19 11:59:05
|
Eloy, Apparently you need to patch your rexml/document.rb. See here: http://rubycocoa.sourceforge.net/GettingStarted (Sorry to send you to the newbie site, but it describes your result perfectly - gen_bridge_metadata on QTKit works on my system.) Alli On Tuesday, August 19, 2008, at 01:35PM, "Eloy Duran" <elo...@gm...> wrote: >Hi Alli, > >Normally you'd cerate a bridge support file like so: > >$ gen_bridge_metadata -f QTKit > QTKit.bridgesupport > >Where -f stands for a framework name in one of the default load paths. >However, trying to wrap QTKit results in the following error: >"undefined local variable or method `trans' for <UNDEFINED> ... </ > >:REXML::Document" > >So I guess you'd need to debug this to get it to completely wrap the >framework. > >- Eloy > >On Aug 19, 2008, at 12:56 PM, Allison Newman wrote: > >> Hi everyone, >> >> I'm currently having trouble with writing some code to generate a >> Quicktime movie file. When I wish to add an image to the file, I >> have to create a QTTime struct. >> >> When I do this for most of the standard Cocoa structs, such as >> NSRect, NSPoint etc, I can simply do: >> >> point = NSPoint.new(1, 2) >> >> This works. However if I try the same idea with a QTTime: >> >> qt_time = QTTime.new(1, 10, 0) >> >> RubyCocoa dies, claiming it doesn't know the constant QTTime. >> >> I have tried looking inside the RubyCocoa framework to see how the >> magic is done for the NSxxxx structs, but I found the following >> comment in oc_types.rb: >> >> # This module adds syntax-sugar APIs on top of the Cocoa structures. >> # This is mostly to preserve backwards compatibility with previous >> versions >> # of RubyCocoa where the C structures support was hardcoded in the >> bridge. >> # Now structures are automatically handled via the metadata >> mechanism, but >> # the API is not compatible with what we used to have. >> >> If I understand correctly, this means that QTKit has not had >> metadata generated for it to handle things such as structs etc. Can >> anyone confirm that this is the case, and if so, point me in the >> direction of some documentation explaining how it is done. With a >> bit of luck, I'll even be able to add the QTKit metadata back into >> the RubyCocoa project. >> >> Thanks for any help. >> >> Alli >> >> ------------------------------------------------------------------------- >> This SF.Net email is sponsored by the Moblin Your Move Developer's >> challenge >> Build the coolest Linux based applications with Moblin SDK & win >> great prizes >> Grand prize is a trip for two to an Open Source event anywhere in >> the world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> Rubycocoa-talk mailing list >> Rub...@li... >> https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > > >------------------------------------------------------------------------- >This SF.Net email is sponsored by the Moblin Your Move Developer's challenge >Build the coolest Linux based applications with Moblin SDK & win great prizes >Grand prize is a trip for two to an Open Source event anywhere in the world >http://moblin-contest.org/redirect.php?banner_id=100&url=/ >_______________________________________________ >Rubycocoa-talk mailing list >Rub...@li... >https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > > |
From: Eloy D. <elo...@gm...> - 2008-08-19 11:35:47
|
Hi Alli, Normally you'd cerate a bridge support file like so: $ gen_bridge_metadata -f QTKit > QTKit.bridgesupport Where -f stands for a framework name in one of the default load paths. However, trying to wrap QTKit results in the following error: "undefined local variable or method `trans' for <UNDEFINED> ... </ >:REXML::Document" So I guess you'd need to debug this to get it to completely wrap the framework. - Eloy On Aug 19, 2008, at 12:56 PM, Allison Newman wrote: > Hi everyone, > > I'm currently having trouble with writing some code to generate a > Quicktime movie file. When I wish to add an image to the file, I > have to create a QTTime struct. > > When I do this for most of the standard Cocoa structs, such as > NSRect, NSPoint etc, I can simply do: > > point = NSPoint.new(1, 2) > > This works. However if I try the same idea with a QTTime: > > qt_time = QTTime.new(1, 10, 0) > > RubyCocoa dies, claiming it doesn't know the constant QTTime. > > I have tried looking inside the RubyCocoa framework to see how the > magic is done for the NSxxxx structs, but I found the following > comment in oc_types.rb: > > # This module adds syntax-sugar APIs on top of the Cocoa structures. > # This is mostly to preserve backwards compatibility with previous > versions > # of RubyCocoa where the C structures support was hardcoded in the > bridge. > # Now structures are automatically handled via the metadata > mechanism, but > # the API is not compatible with what we used to have. > > If I understand correctly, this means that QTKit has not had > metadata generated for it to handle things such as structs etc. Can > anyone confirm that this is the case, and if so, point me in the > direction of some documentation explaining how it is done. With a > bit of luck, I'll even be able to add the QTKit metadata back into > the RubyCocoa project. > > Thanks for any help. > > Alli > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win > great prizes > Grand prize is a trip for two to an Open Source event anywhere in > the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk |
From: Allison N. <dem...@ma...> - 2008-08-19 10:56:42
|
Hi everyone, I'm currently having trouble with writing some code to generate a Quicktime movie file. When I wish to add an image to the file, I have to create a QTTime struct. When I do this for most of the standard Cocoa structs, such as NSRect, NSPoint etc, I can simply do: point = NSPoint.new(1, 2) This works. However if I try the same idea with a QTTime: qt_time = QTTime.new(1, 10, 0) RubyCocoa dies, claiming it doesn't know the constant QTTime. I have tried looking inside the RubyCocoa framework to see how the magic is done for the NSxxxx structs, but I found the following comment in oc_types.rb: # This module adds syntax-sugar APIs on top of the Cocoa structures. # This is mostly to preserve backwards compatibility with previous versions # of RubyCocoa where the C structures support was hardcoded in the bridge. # Now structures are automatically handled via the metadata mechanism, but # the API is not compatible with what we used to have. If I understand correctly, this means that QTKit has not had metadata generated for it to handle things such as structs etc. Can anyone confirm that this is the case, and if so, point me in the direction of some documentation explaining how it is done. With a bit of luck, I'll even be able to add the QTKit metadata back into the RubyCocoa project. Thanks for any help. Alli |
From: Gregory C. <gr...@in...> - 2008-08-19 00:11:59
|
Hi Steve, You might need a require 'rubygems' before the require 'rexml/ document'. Certainly that's true for Builder. I've used REXML in my latest RubyCocoa projects, along with other gems, and require 'rubygems' is my first line. Hope this helps, Greg > Dear all, > > I'm using RubyCocoa 0.13.2 on OS X 10.5.4 > > I have a problem that is driving me batty. I was originally trying > to use XmlBuilder to write out some XML. However, at seemingly > random places, my application would crash while building the XML and > jump into the debugger, always at objc_msgSend. > > Well, I thought perhaps there might be some strange problem with > XmlBuilder so I decided to try using REXML instead. Well now I get > the problem immediately. The following code works perfectly from the > command line using /usr/bin/ruby which points to /System/Library/ > Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby > > require 'osx/cocoa' > require 'rexml/document' > > doc = REXML::Document.new > node = REXML::Element.new( "node") > doc.add_element node > puts "#{doc.to_s}" > > In fact, there's no particular reason to include 'osx/cocoa' as it > stands because I deleted everything down to the simplest terms. > Originally, I had objects that knew how to write themselves to XML. > > However, if I run the following code as part of an XCode project for > a Cocoa application: > > require 'osx/cocoa' > require 'rexml/document' > > class AppController < OSX::NSObject > include OSX > > # big cut of other methods > > def exportModel > return if @modelAlias.selectedObjects.length < 1 > model = @modelAlias.selectedObjects[ 0] > > # panel = NSSavePanel.savePanel > # return if panel.runModalForDirectory_file( nil, "model.xml") != > NSFileHandlingPanelOKButton > > # filename = NSString.stringWithString panel.filename > > doc = REXML::Document.new > node = REXML::Element.new( "node") > doc.add_element node > NSLog( "#{doc.to_s}") > end > ib_action :exportModel > end > > The application barely runs. It starts up but when I attempt to load > a model into the application, the application crashes and goes > immediately into the debugger (dbg) without any other information > about what might have gone wrong. I assume it crashes on openModels > (and not exportModel) because it is the first time that > AppController is interpreted. > > Here are the first 30 lines from the backtrace: > > #0 0x946ef6e8 in objc_msgSend () > #1 0x0002fab4 in rbobj_to_nsobj () > #2 0x0002d327 in objcptr_s_new_with_cptr () > #3 0x000dc1d8 in rb_eval_string_wrap () > #4 0x000dcdec in rb_eval_string_wrap () > #5 0x000da06d in rb_eval_string_wrap () > #6 0x000db17c in rb_eval_string_wrap () > #7 0x000db1c5 in rb_eval_string_wrap () > #8 0x000dc9de in rb_eval_string_wrap () > #9 0x000e641e in rb_apply () > #10 0x000dc323 in rb_eval_string_wrap () > #11 0x000dcdec in rb_eval_string_wrap () > #12 0x000dd871 in rb_respond_to () > #13 0x000dd95a in rb_funcall () > #14 0x00104a55 in rb_inspect () > #15 0x00035bca in rbobj_call_ruby () > #16 0x00034db6 in install_ovmix_hooks () > #17 0x000331ef in ovmix_register_ruby_method () > #18 0x9030e9aa in ___forwarding___ () > #19 0x9030ea12 in __forwarding_prep_0___ () > #20 0x00033319 in ovmix_register_ruby_method () > #21 0x9584a69b in _NSGetUsingKeyValueGetter () > #22 0x9584a1aa in -[NSObject(NSKeyValueCoding) valueForKey:] () > #23 0x95878192 in -[NSArray(NSKeyValueCoding) valueForKey:] () > #24 0x95877d2a in -[NSObject(NSKeyValueCoding) valueForKeyPath:] () > #25 0x958c3548 in -[NSArray(NSKeyValueCoding) valueForKeyPath:] () > #26 0x95877c90 in -[NSObject(NSKeyValueCoding) valueForKeyPath:] () > #27 0x95118cd4 in -[NSBinder > _valueForKeyPath:ofObject:mode:raisesForNotApplicableKeys:] () > #28 0x951188dc in -[NSBinder > valueForBinding:resolveMarkersToPlaceholders:] () > #29 0x951f2b29 in -[NSSelectionBinder > _adjustObject:mode:observedController:observedKeyPath:context:editableState:adjustState > :] () > #30 0x9514d950 in -[NSValueBinder > _observeValueForKeyPath:ofObject:context:] () > > Note that it is not enough to comment out the REXML lines, to make > everything run fine. I have to comment out the require 'rexml/ > document' line as well...then everything will run fine....but REXML > is in the Ruby standard library. I can cd to /System/Library/ > Frameworks/Ruby.framework/Versions/Current/usr/lib/ruby/1.8/rexml/ > and see that document.rb is there. > > Any ideas? > > Cheers, > Steve > > > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win > great prizes > Grand prize is a trip for two to an Open Source event anywhere in > the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/_______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk |
From: Stephyn B. <ste...@co...> - 2008-08-18 22:33:47
|
Dear all, I'm using RubyCocoa 0.13.2 on OS X 10.5.4 I have a problem that is driving me batty. I was originally trying to use XmlBuilder to write out some XML. However, at seemingly random places, my application would crash while building the XML and jump into the debugger, always at objc_msgSend. Well, I thought perhaps there might be some strange problem with XmlBuilder so I decided to try using REXML instead. Well now I get the problem immediately. The following code works perfectly from the command line using /usr/bin/ruby which points to /System/Library/ Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby require 'osx/cocoa' require 'rexml/document' doc = REXML::Document.new node = REXML::Element.new( "node") doc.add_element node puts "#{doc.to_s}" In fact, there's no particular reason to include 'osx/cocoa' as it stands because I deleted everything down to the simplest terms. Originally, I had objects that knew how to write themselves to XML. However, if I run the following code as part of an XCode project for a Cocoa application: require 'osx/cocoa' require 'rexml/document' class AppController < OSX::NSObject include OSX # big cut of other methods def exportModel return if @modelAlias.selectedObjects.length < 1 model = @modelAlias.selectedObjects[ 0] # panel = NSSavePanel.savePanel # return if panel.runModalForDirectory_file( nil, "model.xml") != NSFileHandlingPanelOKButton # filename = NSString.stringWithString panel.filename doc = REXML::Document.new node = REXML::Element.new( "node") doc.add_element node NSLog( "#{doc.to_s}") end ib_action :exportModel end The application barely runs. It starts up but when I attempt to load a model into the application, the application crashes and goes immediately into the debugger (dbg) without any other information about what might have gone wrong. I assume it crashes on openModels (and not exportModel) because it is the first time that AppController is interpreted. Here are the first 30 lines from the backtrace: #0 0x946ef6e8 in objc_msgSend () #1 0x0002fab4 in rbobj_to_nsobj () #2 0x0002d327 in objcptr_s_new_with_cptr () #3 0x000dc1d8 in rb_eval_string_wrap () #4 0x000dcdec in rb_eval_string_wrap () #5 0x000da06d in rb_eval_string_wrap () #6 0x000db17c in rb_eval_string_wrap () #7 0x000db1c5 in rb_eval_string_wrap () #8 0x000dc9de in rb_eval_string_wrap () #9 0x000e641e in rb_apply () #10 0x000dc323 in rb_eval_string_wrap () #11 0x000dcdec in rb_eval_string_wrap () #12 0x000dd871 in rb_respond_to () #13 0x000dd95a in rb_funcall () #14 0x00104a55 in rb_inspect () #15 0x00035bca in rbobj_call_ruby () #16 0x00034db6 in install_ovmix_hooks () #17 0x000331ef in ovmix_register_ruby_method () #18 0x9030e9aa in ___forwarding___ () #19 0x9030ea12 in __forwarding_prep_0___ () #20 0x00033319 in ovmix_register_ruby_method () #21 0x9584a69b in _NSGetUsingKeyValueGetter () #22 0x9584a1aa in -[NSObject(NSKeyValueCoding) valueForKey:] () #23 0x95878192 in -[NSArray(NSKeyValueCoding) valueForKey:] () #24 0x95877d2a in -[NSObject(NSKeyValueCoding) valueForKeyPath:] () #25 0x958c3548 in -[NSArray(NSKeyValueCoding) valueForKeyPath:] () #26 0x95877c90 in -[NSObject(NSKeyValueCoding) valueForKeyPath:] () #27 0x95118cd4 in -[NSBinder _valueForKeyPath:ofObject:mode:raisesForNotApplicableKeys:] () #28 0x951188dc in -[NSBinder valueForBinding:resolveMarkersToPlaceholders:] () #29 0x951f2b29 in -[NSSelectionBinder _adjustObject:mode:observedController:observedKeyPath:context:editableState:adjustState :] () #30 0x9514d950 in -[NSValueBinder _observeValueForKeyPath:ofObject:context:] () Note that it is not enough to comment out the REXML lines, to make everything run fine. I have to comment out the require 'rexml/ document' line as well...then everything will run fine....but REXML is in the Ruby standard library. I can cd to /System/Library/Frameworks/ Ruby.framework/Versions/Current/usr/lib/ruby/1.8/rexml/ and see that document.rb is there. Any ideas? Cheers, Steve |
From: Patrick G. <pge...@wa...> - 2008-08-05 16:06:49
|
> Alternatively, if there isn't such a repository, do people feel that > it would be worthwhile to create one? I'd be happy enough to do the > work to get the ball rolling. YES! if we're talking of a .bridgesupport files repository — you should not need to write code to call existing framework functions. Your calling UpdateSystemActivity should work provided you have a .bridgesupport file exposing it. I've tried gen_bridge_metadata to expose the ObjC runtime functions, without success. I'm working on a JavascriptCore bridge and I've resorted to manually exposing these runtime functions ... This sucks. We need to massage gen_bridge_metadata into exposing any framework function. -Patrick |
From: Allison N. <dem...@ma...> - 2008-08-05 08:50:42
|
OK, that worked like a charm, thanks Marcelo. I actually ended up creating a bundle, as I figure that this will probably be something of fairly general use, at least for my own apps. However, I wanted to ask the list if there isn't already a bundle that the community is using as a one-stop repository for storing an interface for these low-level C functions that I could add the call to. Alternatively, if there isn't such a repository, do people feel that it would be worthwhile to create one? I'd be happy enough to do the work to get the ball rolling. Alli On Monday, August 04, 2008, at 05:17PM, "Marcelo Alves" <mar...@xf...> wrote: > Write (and implement) a category in ObjC or a new class and use it >from RubyCocoa. > > >2008/8/4 Allison Newman <dem...@ma...>: >> Hi everyone, >> >> OK, for those that don't religiously follow cocoadev, I just asked a question over there about how to stop my Mac from going to sleep. The response was not exactly... ideal from the point of view of a RubyCocoa developer. Apparently the answer is to use the following: >> >> UpdateSystemActivity(OverallAct); >> >> Which is a pure C function call, with the prototype being found in power.h >> >> My question is: How do I best go about integrating this into a RubyCocoa app. I have previously written C Extensions to Ruby, but that doesn't seem to be a particularly flexible/reuseable solution. What is considered the best way of accessing this type of code, or better yet, has anyone already exposed this functionality for RubyCocoa? >> >> Thanks in advance for any help/guidance. >> >> Alli >> >> ------------------------------------------------------------------------- >> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge >> Build the coolest Linux based applications with Moblin SDK & win great prizes >> Grand prize is a trip for two to an Open Source event anywhere in the world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> Rubycocoa-talk mailing list >> Rub...@li... >> https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk >> > >------------------------------------------------------------------------- >This SF.Net email is sponsored by the Moblin Your Move Developer's challenge >Build the coolest Linux based applications with Moblin SDK & win great prizes >Grand prize is a trip for two to an Open Source event anywhere in the world >http://moblin-contest.org/redirect.php?banner_id=100&url=/ >_______________________________________________ >Rubycocoa-talk mailing list >Rub...@li... >https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > > |
From: Marcelo A. <mar...@xf...> - 2008-08-04 15:17:18
|
Write (and implement) a category in ObjC or a new class and use it from RubyCocoa. 2008/8/4 Allison Newman <dem...@ma...>: > Hi everyone, > > OK, for those that don't religiously follow cocoadev, I just asked a question over there about how to stop my Mac from going to sleep. The response was not exactly... ideal from the point of view of a RubyCocoa developer. Apparently the answer is to use the following: > > UpdateSystemActivity(OverallAct); > > Which is a pure C function call, with the prototype being found in power.h > > My question is: How do I best go about integrating this into a RubyCocoa app. I have previously written C Extensions to Ruby, but that doesn't seem to be a particularly flexible/reuseable solution. What is considered the best way of accessing this type of code, or better yet, has anyone already exposed this functionality for RubyCocoa? > > Thanks in advance for any help/guidance. > > Alli > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > |
From: Allison N. <dem...@ma...> - 2008-08-04 13:44:59
|
Hi everyone, OK, for those that don't religiously follow cocoadev, I just asked a question over there about how to stop my Mac from going to sleep. The response was not exactly... ideal from the point of view of a RubyCocoa developer. Apparently the answer is to use the following: UpdateSystemActivity(OverallAct); Which is a pure C function call, with the prototype being found in power.h My question is: How do I best go about integrating this into a RubyCocoa app. I have previously written C Extensions to Ruby, but that doesn't seem to be a particularly flexible/reuseable solution. What is considered the best way of accessing this type of code, or better yet, has anyone already exposed this functionality for RubyCocoa? Thanks in advance for any help/guidance. Alli |
From: Patrick G. <pge...@wa...> - 2008-08-03 22:02:00
|
> Just a quick one, but what would be the equivalent of: > > kvc_accessor :authorized > > in obj-c? Just trying to fully understand what that code actually > does! It defines a getter for the instance variable. If authorized is an object, it's equivalent to -(id)authorized { return authorizedInstanceVariable; } BTW, kvc_accessor is defined in RubyCocoa and you can check the source in /System/Library/Frameworks/RubyCocoa.framework/Versions/A/Resources/ ruby/osx/objc/oc_import.rb -Patrick |
From: Tim P. <he...@ti...> - 2008-08-03 21:52:37
|
Hey chaps, Just a quick one, but what would be the equivalent of: kvc_accessor :authorized in obj-c? Just trying to fully understand what that code actually does! Cheers all Tim |
From: Patrick G. <pge...@wa...> - 2008-08-03 13:08:11
|
> For the longest time, I couldn't get the NSOutlineView to > acknowledge the @root object at all. Even though this same code > worked previously without bindings. > I have no idea why the FaultTreeDisplayNode is being sent the > copyWithZone selector nor have I ever seen anything that requires > you to do so for either Bindings or DataSources. When updating values, Bindings try to call setObjectValue on your cell. If that doesn't work, next step is trying to copy the object with copyWithZone. In a ruby project I added this … class ItemTableViewCell < NSTextFieldCell def setObjectValue(obj) @item = obj end … then used @item's contents in drawInteriorWithFrame_inView to draw the cell. If you don't draw yourself, just define a new cell class and add that setObjectValue implementation. -Patrick |