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: Jonathan P. <jp...@dc...> - 2006-02-22 10:37:53
|
On 22 Feb 2006, at 6:43, Yvon Thoraval wrote: > Le 22 f=E9vr. 06 =E0 00:49, Jonathan Paisley a =E9crit : > >> i.e., you must make the array assignment in awakeFromNib > > that's ok now, however when i do ; > > @buttons.each { |b| b.setEnabled false} > > the appearance of the buttons doesn't change, i've seen an =20 > appearance change only in awakeFromNib (in Interface Buider i did =20 > set all the the buttons to enabled false) > > because i want to disable the buttons when a long time action. I'm afraid I'm not sure what's going on here. More complete code =20 would be helpful to understand how things are put together. Cheers, Jonathan |
From: Jonathan P. <jp...@dc...> - 2006-02-22 10:37:20
|
On 22 Feb 2006, at 7:23, Tim Burks wrote: > This evening I spoke to the San Francisco Ruby Meetup group about > RubyCocoa. I thought it would be fun to describe RubyCocoa with an > example, so I presented a simple arcade-style game written in Ruby > that uses RubyCocoa to draw and handle user events. I also wrote > it up as a tutorial and put it online here: http:// > www.rubycocoa.com/ruby-rocks. Great stuff! A few comments on the tutorial: Probably worth mentioning up front that a game wouldn't normally be a document-based application (and say at the end what would be different to use a non-document application template). Rather than editing the pbxproj file manually: Targets inspector -> rubyrocks -> Info.plist Entries -> Document Types -> Document Class I couldn't see any instructions for binding GameView.game to the Game instance (File's Owner) in Interface Builder. The instructions for adding the 'game' outlet aren't as detailed as the result of the instructions in Interface Builder. You can just use [a,b,c,d] instead of OSX::NSRect.new(a,b,c,d) (similarly for NSPoint), unless you want to hang on to the object and use .x, .y etc. The moveWithBounds_ and initWithPosition_ methods etc don't need a trailing underscore. The model objects (Sprite and descendents) can be plain Ruby objects rather than NSObject descendents. This means you can use a normal ruby initialize method (instead of .alloc.initWith...). Cheers, Jonathan |
From: Ezra Z. <ezm...@gm...> - 2006-02-22 07:42:49
|
On Feb 21, 2006, at 11:23 PM, Tim Burks wrote: > > This evening I spoke to the San Francisco Ruby Meetup group about > RubyCocoa. I thought it would be fun to describe RubyCocoa with an > example, so I presented a simple arcade-style game written in Ruby > that uses RubyCocoa to draw and handle user events. I also wrote > it up as a tutorial and put it online here: http:// > www.rubycocoa.com/ruby-rocks. > > Tim > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through > log files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD > SPLUNK! > http://sel.as-us.falkag.net/sel? > cmd=lnk&kid=103432&bid=230486&dat=121642 > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > Tim- This is super cool! Thanks for your great tutorials, they really are helping me get a handle on rubycocoa. And now I have a fun game to customize and play with even more, sweet ;) Thanks -Ezra |
From: Tim B. <tim...@gm...> - 2006-02-22 07:23:54
|
This evening I spoke to the San Francisco Ruby Meetup group about RubyCocoa. I thought it would be fun to describe RubyCocoa with an example, so I presented a simple arcade-style game written in Ruby that uses RubyCocoa to draw and handle user events. I also wrote it up as a tutorial and put it online here: http://www.rubycocoa.com/ ruby-rocks. Tim |
From: Yvon T. <tho...@fr...> - 2006-02-22 06:44:52
|
Le 22 f=E9vr. 06 =E0 00:49, Jonathan Paisley a =E9crit : > i.e., you must make the array assignment in awakeFromNib that's ok now, however when i do ; @buttons.each { |b| b.setEnabled false} the appearance of the buttons doesn't change, i've seen an appearance =20= change only in awakeFromNib (in Interface Buider i did set all the =20 the buttons to enabled false) because i want to disable the buttons when a long time action. best, Yvon= |
From: Jonathan P. <jp...@dc...> - 2006-02-21 23:49:56
|
On 21 Feb 2006, at 18:10, Yvon Thoraval wrote: > @buttons = [@nonVideButtonGauche, @uniqueButtonGauche, > @fusionButtonGauche, @loadButtonGauche, @nonVideButtonDroite, > @uniqueButtonDroite, @fusionButtonDroite, @loadButtonDroite] When do you execute this line? You should do it inside awakeFromNib, since before that method is called the buttons will not be set from Interface Builder. i.e., you must make the array assignment in awakeFromNib |
From: Yvon T. <tho...@fr...> - 2006-02-21 18:12:04
|
in my gui i've a lot of NSButtons i've arranged theme into an Array : @buttons = [@nonVideButtonGauche, @uniqueButtonGauche, @fusionButtonGauche, @loadButtonGauche, @nonVideButtonDroite, @uniqueButtonDroite, @fusionButtonDroite, @loadButtonDroite] if i do (by the end of awakeFromNib) : def enableAllButtons @buttons.each { |b| p b.class.to_s} end i get "NilClass" for each NSButton however doing : def enableAllButtons p "@nonVideButtonGauche " + @nonVideButtonGauche.class.to_s p "@uniqueButtonGauche " + @uniqueButtonGauche.class.to_s p "@fusionButtonGauche " + @fusionButtonGauche.class.to_s p "@loadButtonGauche " + @loadButtonGauche.class.to_s p "@nonVideButtonDroite " + @nonVideButtonDroite.class.to_s p "@uniqueButtonDroite " + @uniqueButtonDroite.class.to_s p "@fusionButtonDroite " + @fusionButtonDroite.class.to_s p "@loadButtonDroite " + @loadButtonDroite.class.to_s end i get the right "OSX::NSButton" for all the buttons : "@nonVideButtonGauche OSX::NSButton" "@uniqueButtonGauche OSX::NSButton" "@fusionButtonGauche OSX::NSButton" "@loadButtonGauche OSX::NSButton" "@nonVideButtonDroite OSX::NSButton" "@uniqueButtonDroite OSX::NSButton" "@fusionButtonDroite OSX::NSButton" "@loadButtonDroite OSX::NSButton" does that means we have also to use a proxy class ? Yvon |
From: Yvon T. <tho...@fr...> - 2006-02-21 09:24:08
|
Le 20 f=E9vr. 06 =E0 20:56, Jonathan Paisley a =E9crit : > > Even better, reduce it to a plain ruby script that produces the =20 > same error if possible. > Thanks for your replu, in fact the prob comes only indirectly from =20 the line given in error )) this was some stupid writting of me )) sorry for the noise, Yvon= |
From: Jonathan P. <jp...@dc...> - 2006-02-20 19:57:10
|
On 20 Feb 2006, at 18:26, Yvon Thoraval wrote: > i think this has nothing to do with RubyCocoa rather with ruby > only, but in case of, because i'm stuck by this strange prob. Hi, Can you post a more complete example of the code, and indicate specifically which line the exception is coming from? Even better, reduce it to a plain ruby script that produces the same error if possible. Cheers, Jonathan |
From: Yvon T. <tho...@fr...> - 2006-02-20 18:27:37
|
i think this has nothing to do with RubyCocoa rather with ruby only, but in case of, because i'm stuck by this strange prob. i have a hash like that : @label_list={} with only one key for the time being : @label_list["BookmarksBar"]=[] then, the value is an Array populated like that : @label_list["BookmarksBar"] << folder.attributes["label"].gsub (/"(.*)"/, '\1') then, i want to use this hash-value by : if !@label_list["BookmarksBar"].include?(label_) # <= line 143 this works a number of times (above 20 times; it's within an each loop) until label_ = "files" where i get : /Users/yvon/work/RubyCocoa/BookmarksMerge/build/Development/BookmarksMer ge.app/Contents/Resources/Controller.rb:143:in `NSApplicationMain': NSApplicationMain - RBException_TypeError - can't convert String into Integer (OSX::OCException) label_ are always strings... i don't understand )) |
From: Jonathan P. <jp...@dc...> - 2006-02-20 10:13:13
|
On 20 Feb 2006, at 9:27, Hunter Kelly wrote: > Does Interface Builder have some kind of hook that we could modify to > make it recognize .rb files? Even cooler would be a way to tell it > that it would be a ruby file, and have it generate the skeleton .rb > file... I don't think so. However, it's possible that you could do the drive Interface Builder via AppleScript to create the classes as required. You could probably also create a ruby script that parses the output from 'nibtool -c' (and other options) to create a skeleton .rb file. |
From: Hunter K. <re...@gm...> - 2006-02-20 09:53:25
|
Yah, I figured as much over the weekend. Thanks for the reply though... Does Interface Builder have some kind of hook that we could modify to make it recognize .rb files? Even cooler would be a way to tell it that it would be a ruby file, and have it generate the skeleton .rb file... H On 2/17/06, Jonathan Paisley <jp...@dc...> wrote: > On 17 Feb 2006, at 14:53, Hunter Kelly wrote: > > > For example, I opened up the simpleapp example. Interface Builder can > > "see" AppController and MyView. However, in XCode, if I create a new > > Ruby subclass of NSObject, I can't figure out how to tell Interface > > Builder about this new class. If it were Obj-C, I'd just drag the .h > > file onto Interface Builder, but when I try that with the .rb file > > Interface Builder flicks over to the sounds tab or something. > > > > What do I need to be able to do to make Interface Builder aware of my > > Ruby classes? > > You can do it manually in Interface Builder. You need to create a > subclass of NSObject with the appropriate name, and then instantiate > it. This is described in the Interface Builder help. I've pasted a > fragment of it below. You'll have to add the actions and outlet names > manually too. > > Hope that helps, > Jonathan > > > Creating a Class > > To create a class that inherits from a Coca class, follow the steps > in each of these sections, in order: > > "Subclass an existing class." > "Add actions and outlets to the new class." > "Create an instance of the new class." > "Connect the class's actions and outlets." > "Generate the class's source code files." > > Subclass an existing class. > > In the Classes pane of the nib file window, Control-click the class > you want your class to inherit from, and choose Subclass from the > menu that appears. A new subclass is added with a default name. Type > in a new name for the subclass. > > ... > > > > |
From: Jonathan P. <jp...@dc...> - 2006-02-17 23:52:32
|
On 17 Feb 2006, at 14:53, Hunter Kelly wrote: > For example, I opened up the simpleapp example. Interface Builder can > "see" AppController and MyView. However, in XCode, if I create a new > Ruby subclass of NSObject, I can't figure out how to tell Interface > Builder about this new class. If it were Obj-C, I'd just drag the .h > file onto Interface Builder, but when I try that with the .rb file > Interface Builder flicks over to the sounds tab or something. > > What do I need to be able to do to make Interface Builder aware of my > Ruby classes? You can do it manually in Interface Builder. You need to create a =20 subclass of NSObject with the appropriate name, and then instantiate =20 it. This is described in the Interface Builder help. I've pasted a =20 fragment of it below. You'll have to add the actions and outlet names =20= manually too. Hope that helps, Jonathan Creating a Class To create a class that inherits from a Coca class, follow the steps =20 in each of these sections, in order: =93Subclass an existing class.=94 =93Add actions and outlets to the new class.=94 =93Create an instance of the new class.=94 =93Connect the class=92s actions and outlets.=94 =93Generate the class=92s source code files.=94 Subclass an existing class. In the Classes pane of the nib file window, Control-click the class =20 you want your class to inherit from, and choose Subclass from the =20 menu that appears. A new subclass is added with a default name. Type =20 in a new name for the subclass. ... |
From: Hunter K. <re...@gm...> - 2006-02-17 23:43:15
|
Hiya, I'm fairly new to Cocoa programming. I'm using XCode + Interface Builder, and have been working through "Cocoa Programming for Mac OS X". I'm a long time ruby fan, and have started playing around with the RubyCocoa bindings. Ruby and Objective-C look like a really natural fit, and the binding seems really good. However, I'm having a problem figuring out what I assume must be a pretty simple thing - how do I make a Interface Builder "see" my ruby classes, so I can create an instance of it, and tie it into the nib file? For example, I opened up the simpleapp example. Interface Builder can "see" AppController and MyView. However, in XCode, if I create a new Ruby subclass of NSObject, I can't figure out how to tell Interface Builder about this new class. If it were Obj-C, I'd just drag the .h file onto Interface Builder, but when I try that with the .rb file Interface Builder flicks over to the sounds tab or something. What do I need to be able to do to make Interface Builder aware of my Ruby classes? Cheers, Hunter |
From: Jonathan P. <jp...@dc...> - 2006-02-17 10:16:30
|
On 17 Feb 2006, at 10:11, Yvon Thoraval wrote: >> Hope that helps, > > yes a lot ! > > see <http://cjoint.com/data/crllPJBmH2.htm> > > again, thanks for your help ! > Great - glad you got it working. |
From: Yvon T. <tho...@fr...> - 2006-02-17 10:13:08
|
Le 17 f=E9vr. 06 =E0 11:04, Jonathan Paisley a =E9crit : > Hope that helps, yes a lot ! see <http://cjoint.com/data/crllPJBmH2.htm> again, thanks for your help ! Yvon= |
From: Yvon T. <tho...@fr...> - 2006-02-17 10:06:53
|
Le 17 f=E9vr. 06 =E0 11:04, Jonathan Paisley a =E9crit : > Did you not remove the extra 'include' line? : > right ! that works now )) best, Yvon= |
From: Jonathan P. <jp...@dc...> - 2006-02-17 10:04:27
|
On 17 Feb 2006, at 9:43, Yvon Thoraval wrote: > > Le 17 f=E9vr. 06 =E0 09:55, Jonathan Paisley a =E9crit : > >> >> That should hopefully fix it. >> > > yes it fix that prob, however, i got a new one )) : Did you not remove the extra 'include' line? : > require 'OutlineViewProxyClass.rb' > include NSOutlineViewable # probably not usefull ? This would cause the behaviour you're seeing. *Only* REXML::Element =20 should have NSOutlineViewable included. By including it at the top =20 level the strings you're returning as values are becoming converted =20 to OutlineViewProxy objects, which confuses NSOutlineView. Hope that helps, Jonathan |
From: Yvon T. <tho...@fr...> - 2006-02-17 09:44:22
|
Le 17 f=E9vr. 06 =E0 09:55, Jonathan Paisley a =E9crit : > > That should hopefully fix it. > yes it fix that prob, however, i got a new one )) : "bookmark.class =3D OutlineViewProxy" "is folder title =3D BookmarksBar" /Users/yvon/work/RubyCocoa/BookmarksMerge/build/Development/=20 BookmarksMerge.app/Contents/Resources/rb_main.rb:44:in `method': =20 undefined method `copyWithZone:' for class =20 `OutlineViewProxy' (NameError) from = /Users/yvon/work/RubyCocoa/BookmarksMerge/build/Development/=20 BookmarksMerge.app/Contents/Resources/rb_main.rb:44 in the "outlineView_objectValueForTableColumn_byItem(aTree, =20 tableColumn, bookmark)" where i do : tableColumnIdentifier =3D tableColumn.identifier.to_s p "bookmark.class =3D " + bookmark.class.to_s # =3D> = printed out if (bookmark.slave.class =3D=3D REXML::Element) # for = debugging only if (bookmark.slave.attributes.length =3D=3D 1) p "is folder title =3D " + bookmark.slave.attributes["title"] = # =20 =3D> printed out return bookmark.slave.attributes["title"] if =20 (tableColumnIdentifier =3D=3D "Label") # <=3D the prob comes after that return "" if (tableColumnIdentifier =3D=3D "Url") end if (bookmark.slave.attributes.length =3D=3D 2) p "is url label =3D " + bookmark.slave.attributes["label"] + " =20 href =3D " + bookmark.slave.attributes["href"] return bookmark.slave.attributes["label"] if =20 (tableColumnIdentifier =3D=3D "Label") return bookmark.slave.attributes["href"] if =20 (tableColumnIdentifier =3D=3D "Url") end end return "not an element" # for debugging only thanks for your help Yvon= |
From: Jonathan P. <jp...@dc...> - 2006-02-17 08:55:52
|
On 17 Feb 2006, at 8:33, Yvon Thoraval wrote: > in my previous Controller.rb, i've added : > > require 'OutlineViewProxyClass.rb' > include NSOutlineViewable # probably not usefull ? Yeah, you need to add it specifically to the Ruby class you are returning from the outline view (after requiring rexml first): require 'rexml/document' module REXML class Element include NSOutlineViewable end end I see you already have that in 'OutlineViewProxyClass.rb' so it should be fine. > i've transformed each bookmark to bookmark.slave seems to be no > probs here. > > However for "def outlineView_child_ofItem(aTree, index, bookmark)" > i've done : > > return @folder.to_nsobj if bookmark.class == NilClass # case of > root element @folder being a REXML::Element By including 'to_nsobj' in the REXML::Element class you shouldn't need to call it explicitly. RubyCocoa looks for a 'to_nsobj' method when passing a Ruby instance to Cocoa. Also, since 'nil' evaluates as false in ruby, you could do: if bookmark then children = bookmark.slave.get_elements("*") return children[index] else return @folder end > and i get an error : > > /Users/yvon/work/RubyCocoa/BookmarksMerge/build/Development/ > BookmarksMerge.app/Contents/Resources/OutlineViewProxyClass.rb: > 14:in `NSApplicationMain': NSApplicationMain - > RBException_TypeError - can't convert REXML::Element into Integer > (OSX::OCException) > from /Users/yvon/work/RubyCocoa/BookmarksMerge/build/Development/ > BookmarksMerge.app/Contents/Resources/rb_main.rb:44 Ah, my fault. A copying-to-Mail.app error crept in. This line from OutlineViewProxy#init: @slave = slave should be @slave = slave.object_id That should hopefully fix it. Jonathan |
From: Yvon T. <tho...@fr...> - 2006-02-17 08:34:54
|
Le 16 f=E9vr. 06 =E0 20:35, Jonathan Paisley a =E9crit : > > Let me know if that works for you. in my previous Controller.rb, i've added : require 'OutlineViewProxyClass.rb' include NSOutlineViewable # probably not usefull ? i've transformed each bookmark to bookmark.slave seems to be no =20 probs here. However for "def outlineView_child_ofItem(aTree, index, bookmark)" =20 i've done : return @folder.to_nsobj if bookmark.class =3D=3D NilClass # case of = root =20 element @folder being a REXML::Element children =3D bookmark.slave.get_elements("*") return children[index].to_nsobj and i get an error : /Users/yvon/work/RubyCocoa/BookmarksMerge/build/Development/=20 BookmarksMerge.app/Contents/Resources/OutlineViewProxyClass.rb:14:in =20 `NSApplicationMain': NSApplicationMain - RBException_TypeError - =20 can't convert REXML::Element into Integer (OSX::OCException) from = /Users/yvon/work/RubyCocoa/BookmarksMerge/build/Development/=20 BookmarksMerge.app/Contents/Resources/rb_main.rb:44 OutlineViewProxyClass.rb:14 being : ObjectSpace._id2ref(@slave) # used to prevent GC cycle quiet, that's the first time i'm using a proxy ;-) then i'm not sure on how to use it )) best, Yvon ---------------------- OutlineViewProxyClass.rb =20 ------------------------------------------------------------------ require 'rexml/document' include REXML # Define helper class class OutlineViewProxy < OSX::NSObject ns_overrides :init def init(slave) super_init @slave =3D slave self end def slave ObjectSpace._id2ref(@slave) # used to prevent GC cycle end end # One instance of helper class per plain ruby object being helped module NSOutlineViewable def to_nsobj # This will be released with ruby instance is GC-ed @__nsoutlineviewproxy ||=3D OutlineViewProxy.alloc.init(self) end end # Include the helper module in REXML::Element module REXML class Element include NSOutlineViewable end end ---------------------- OutlineViewProxyClass.rb =20 ------------------------------------------------------------------ |
From: Jonathan P. <jp...@dc...> - 2006-02-16 19:36:46
|
On 16 Feb 2006, at 16:28, Yvon Thoraval wrote: >> How are these methods implemented, and what types of values are >> the items you are returning? They must be NSObject subclasses, and >> you must keep a reference to them somewhere - otherwise they will >> be garbage collected and things will go wrong. > > for : > def outlineView_child_ofItem(aTree, index, bookmark) > i return a REXML::Element : > return children[index] OK, this is the problem. NSOutlineView doesn't retain the object returned from this method. Since REXML::Element is not derived from NSObject, the object NSOutlineView sees is a temporary proxy for the ruby instance. Since the proxy is temporary, NSOutlineView gets confused because it expects to see the same object later. Here's a workaround for the moment (until there's a better solution in RubyCocoa core): # Define helper class class OutlineViewProxy < OSX::NSObject ns_overrides :init def init(slave) super_init @slave = slave self end def slave ObjectSpace._id2ref(@slave) # used to prevent GC cycle end end # One instance of helper class per plain ruby object being helped module NSOutlineViewable def to_nsobj # This will be released with ruby instance is GC-ed @__nsoutlineviewproxy ||= OutlineViewProxy.alloc.init(self) end end # Include the helper module in REXML::Element module REXML class Element include NSOutlineViewable end end # Now, in any of your outlineView methods that takes an 'item' argument, # you must get at the real object by using 'slave' first. # e.g., def outlineView_isItemExpandable(aTree, bookmark) return bookmark.slave.has_elements? end Let me know if that works for you. Jonathan |
From: Yvon T. <tho...@fr...> - 2006-02-16 16:29:30
|
Le 16 f=E9vr. 06 =E0 16:58, Jonathan Paisley a =E9crit : > > How are these methods implemented, and what types of values are the =20= > items you are returning? They must be NSObject subclasses, and you =20 > must keep a reference to them somewhere - otherwise they will be =20 > garbage collected and things will go wrong. NOT AT ALL ;-) for : def outlineView_numberOfChildrenOfItem(aTree, bookmark) i return a fixnum for : def outlineView_isItemExpandable(aTree, bookmark) i return a boolean (ruby) like that : return bookmark.has_elements?() or : return false for : def outlineView_child_ofItem(aTree, index, bookmark) i return a REXML::Element : return children[index] for : =09 def outlineView_objectValueForTableColumn_byItem(aTree, = tableColumn, =20 bookmark) i return ruby string : for example : return bookmark.attributes["label"] if =20 (tableColumnIdentifier =3D=3D "Label") return bookmark.attributes["href"] if (tableColumnIdentifier =20= =3D=3D "Url") and finally for : def outlineView_shouldEditTableColumn_item(aTree, tableColumn, =20= bookmark) i return a ruby boolean always as : return false thaks for your help ! Yvon > >> and GDB underlines the line : >> 0x909bf120 <+0032> lwz r11,0(r2) >> >> (seems to be asm which i don't understand...) > > Assuming that after these messages you are able to type commands to =20= > gdb, please type 'bt'<RETURN> and include the results in an email. Here it is : (gdb) bt #0 0x909bf120 in objc_msgSend () #1 0x0023a6a4 in ocid_get_rbobj () #2 0x00209278 in ocid_to_rbobj () #3 0x0020a354 in ocdata_to_rbobj () #4 0x0020ba8c in override_mixin_method_list () #5 0x0020bf0c in override_mixin_method_list () #6 0x0020c2d4 in override_mixin_method_list () #7 0x0020afe8 in override_mixin_class_method_list () #8 0x928db254 in -[NSObject(NSForwardInvocation) forward::] () #9 0x909c40d0 in _objc_msgForward () #10 0x9373f3f4 in -[NSTableView _drawContentsAtRow:column:clipRect:] () #11 0x937e4ae0 in -[NSOutlineView =20 _drawContentsAtRow:column:clipRect:] () #12 0x9373ee78 in -[NSTableView drawRow:clipRect:] () #13 0x937e49d8 in -[NSOutlineView drawRow:clipRect:] () #14 0x9373ec34 in -[NSTableView drawRowIndexes:clipRect:] () #15 0x9373e2bc in -[NSTableView drawRect:] () #16 0x936d2e78 in -[NSView _drawRect:clip:] () #17 0x936d1c1c in -[NSView =20 _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisible=20= RectForView:topView:] () #18 0x936d1fc8 in -[NSView =20 _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisible=20= RectForView:topView:] () #19 0x936d1fc8 in -[NSView =20 _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisible=20= RectForView:topView:] () #20 0x936d1fc8 in -[NSView =20 _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisible=20= RectForView:topView:] () #21 0x936d1fc8 in -[NSView =20 _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisible=20= RectForView:topView:] () #22 0x936f2664 in -[NSThemeFrame =20 _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisible=20= RectForView:topView:] () #23 0x936cb674 in -[NSView =20 _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] () #24 0x936c0968 in -[NSView displayIfNeeded] () #25 0x936c07d8 in -[NSWindow displayIfNeeded] () #26 0x936c0684 in _handleWindowNeedsDisplay () #27 0x9075ccd8 in __CFRunLoopDoObservers () #28 0x9075cf78 in __CFRunLoopRun () #29 0x9075ca18 in CFRunLoopRunSpecific () #30 0x9318f1e0 in RunCurrentEventLoopInMode () #31 0x9318e7ec in ReceiveNextEventCommon () #32 0x9318e6e0 in BlockUntilNextEventMatchingListInMode () #33 0x9368d104 in _DPSNextEvent () #34 0x9368cdc8 in -[NSApplication =20 nextEventMatchingMask:untilDate:inMode:dequeue:] () #35 0x93892e6c in -[NSMouseTracker =20 trackWithEvent:inView:withDelegate:] () #36 0x93808a00 in -[NSOutlineView mouseDown:] () #37 0x936e8eb0 in -[NSWindow sendEvent:] () #38 0x93691ef4 in -[NSApplication sendEvent:] () #39 0x93689330 in -[NSApplication run] () #40 0x93779e68 in NSApplicationMain () #41 0x00210f68 in init_NSAlert () #42 0x002570ec in rb_frozen_class_p () #43 0x00257ad4 in rb_frozen_class_p () #44 0x00254d50 in rb_frozen_class_p () #45 0x00264140 in rb_load_protect () #46 0x00264188 in ruby_exec () #47 0x002641d0 in ruby_run () #48 0x0020c7a8 in RBApplicationMain () #49 0x00002d00 in main (argc=3D1, argv=3D0xbffff948) at main.m:13 #50 0x00002528 in _start (argc=3D1, argv=3D0xbffff948, envp=3D0xbffff950) = =20 at /SourceCache/Csu/Csu-58/crt.c:272 #51 0x000023d0 in start () |
From: Jonathan P. <jp...@dc...> - 2006-02-16 15:58:50
|
On 16 Feb 2006, at 15:35, Yvon Thoraval wrote: > def outlineView_numberOfChildrenOfItem(aTree, bookmark) > def outlineView_isItemExpandable(aTree, bookmark) > def outlineView_child_ofItem(aTree, index, bookmark) > def outlineView_objectValueForTableColumn_byItem(aTree, > tableColumn, bookmark) > def outlineView_shouldEditTableColumn_item(aTree, tableColumn, > bookmark) How are these methods implemented, and what types of values are the items you are returning? They must be NSObject subclasses, and you must keep a reference to them somewhere - otherwise they will be garbage collected and things will go wrong. > and GDB underlines the line : > 0x909bf120 <+0032> lwz r11,0(r2) > > (seems to be asm which i don't understand...) Assuming that after these messages you are able to type commands to gdb, please type 'bt'<RETURN> and include the results in an email. Jonathan |
From: Yvon T. <tho...@fr...> - 2006-02-16 15:36:54
|
Hey all, i want to show the content of an bookmarks xml file in a NSOutlineView. i've done all the : @safTree.setDelegate(self) @safTree.setDataSource(self) @safTree.reloadData() @safTree being the NSOutlineView and also : def outlineView_numberOfChildrenOfItem(aTree, bookmark) def outlineView_isItemExpandable(aTree, bookmark) def outlineView_child_ofItem(aTree, index, bookmark) def outlineView_objectValueForTableColumn_byItem(aTree, tableColumn, bookmark) def outlineView_shouldEditTableColumn_item(aTree, tableColumn, bookmark) after "@safTree.reloadData()" the root element is correctly displayed however, when clicking on it, i get the GDB (gnu debugger) and no Ruby message at all; the GDB console says : warning: Unable to read symbols for "@executable_path/../Frameworks/RubyCocoa.framework/Versions/A/RubyCocoa " (file not found). Program loaded. sharedlibrary apply-load-rules all Attaching to program: `/Users/yvon/work/RubyCocoa/BookmarksMerge/build/Development/BookmarksMe rge.app/Contents/MacOS/BookmarksMerge', process 2267. and GDB underlines the line : 0x909bf120 <+0032> lwz r11,0(r2) (seems to be asm which i don't understand...) is it a way not to get GDB ? also, after clicking, on root element in NSOutlineView, i get no call to either : def outlineView_numberOfChildrenOfItem(aTree, bookmark) def outlineView_isItemExpandable(aTree, bookmark) def outlineView_child_ofItem(aTree, index, bookmark) def outlineView_objectValueForTableColumn_byItem(aTree, tableColumn, bookmark) def outlineView_shouldEditTableColumn_item(aTree, tableColumn, bookmark) only the GDB is launched.... if someone has experienced such thing... Yvon |