From: Alistair H. <ali...@gm...> - 2007-10-28 16:22:26
|
Hello, I'm trying to implement a NSTableView with Drag and Drop capabilities in RubyCocoa. I have been trying to follow http://developer.apple.com/documentation/Cocoa/Conceptual/TableView/Tasks/UsingDragAndDrop.htmland http://www.corbinstreehouse.com/blog/?p=21 but I just can not figure out how to translate the Objective-C code into RubyCocoa. Can anyone help me out? Thanks -- Alistair Holt ali...@gm... |
From: Eloy D. <elo...@gm...> - 2007-10-28 19:08:18
|
Hi Alistair, Is there a specific part that you don't understand about the translation? Or could you mail some code of what you thought it would be, so we can see what it is that you can't figure out? Cheers, Eloy On 28 okt 2007, at 17:22, Alistair Holt wrote: > Hello, > > I'm trying to implement a NSTableView with Drag and Drop > capabilities in RubyCocoa. > > I have been trying to follow http://developer.apple.com/documentation/Cocoa/Conceptual/TableView/Tasks/UsingDragAndDrop.html > and http://www.corbinstreehouse.com/blog/?p=21 but I just can not > figure out how to translate the Objective-C code into RubyCocoa. > > > Can anyone help me out? > > Thanks > > -- > Alistair Holt > ali...@gm... > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a > browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/_______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk |
From: Alistair H. <ali...@gm...> - 2007-10-28 20:24:03
|
Thanks Eloy. I've been told that part one of http://www.corbinstreehouse.com/blog/?p=21would translate into: MyPrivateTableViewDataType = "MyPrivateTableViewDataType" def awakeFromNib myTableView.registerForDraggedTypes([MyPrivateTableViewDataType]) end ..which would make sense to me. Although I'm still not sure what the fist line actually does. I also have no idea how to implement the rest of the code in that example. I'm new to Objective-C and Cocoa and have found it fairly easy to translate code so far but this has really got me. Cheers On 28/10/2007, Eloy Duran <elo...@gm...> wrote: > > Hi Alistair, > > Is there a specific part that you don't understand about the translation? > Or could you mail some code of what you thought it would be, so we can see > what it is that you can't figure out? > > > Cheers, > Eloy > > On 28 okt 2007, at 17:22, Alistair Holt wrote: > > Hello, > > I'm trying to implement a NSTableView with Drag and Drop capabilities in > RubyCocoa. > > > I have been trying to follow > http://developer.apple.com/documentation/Cocoa/Conceptual/TableView/Tasks/UsingDragAndDrop.htmland http://www.corbinstreehouse.com/blog/?p=21but I just can not figure out how to translate the Objective-C code into > RubyCocoa. > > > Can anyone help me out? > > Thanks > > -- > Alistair Holt > ali...@gm... > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> > http://get.splunk.com/_______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > > -- Alistair Holt ali...@gm... |
From: Eloy D. <elo...@gm...> - 2007-10-28 20:42:15
|
Hmm, well myTableView is probably a outlet in IB? If so you are not referencing it. You should do @myTableView ABout the other code the next one would be like: def tableView_writeRowsWithIndexes_toPasteboard(tv, rowIndexes, pboard) data = OSX::NSKeyedArchiver.archivedDataWithRootObject(rowIndexes) pboard.declareTypes_owner [BasicTableViewDragAndDropDataType], self pboard.setData_forType data, BasicTableViewDragAndDropDataType true end Eloy On 28 okt 2007, at 21:23, Alistair Holt wrote: > Thanks Eloy. > > I've been told that part one of http://www.corbinstreehouse.com/blog/?p=21 > would translate into: > > MyPrivateTableViewDataType = "MyPrivateTableViewDataType" > > def awakeFromNib > myTableView.registerForDraggedTypes([MyPrivateTableViewDataType]) > end > > ..which would make sense to me. Although I'm still not sure what the > fist line actually does. I also have no idea how to implement the > rest of the code in that example. I'm new to Objective-C and Cocoa > and have found it fairly easy to translate code so far but this has > really got me. > > Cheers > > On 28/10/2007, Eloy Duran <elo...@gm... > wrote: > Hi Alistair, > > > Is there a specific part that you don't understand about the > translation? > Or could you mail some code of what you thought it would be, so we > can see what it is that you can't figure out? > > > Cheers, > Eloy > > On 28 okt 2007, at 17:22, Alistair Holt wrote: > >> Hello, >> >> >> I'm trying to implement a NSTableView with Drag and Drop >> capabilities in RubyCocoa. >> >> >> I have been trying to follow http://developer.apple.com/documentation/Cocoa/Conceptual/TableView/Tasks/UsingDragAndDrop.html >> and http://www.corbinstreehouse.com/blog/?p=21 but I just can not >> figure out how to translate the Objective-C code into RubyCocoa. >> >> >> Can anyone help me out? >> >> Thanks >> >> -- >> Alistair Holt >> ali...@gm... >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by: Splunk Inc. >> Still grepping through log files to find problems? Stop. >> Now Search log events and configuration files using AJAX and a >> browser. >> Download your FREE copy of Splunk now >> http://get.splunk.com/_______________________________________________ >> Rubycocoa-talk mailing list >> Rub...@li... >> https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a > browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > > > > > -- > Alistair Holt > ali...@gm... > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a > browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/_______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk |
From: Eloy D. <elo...@gm...> - 2007-10-28 20:48:04
|
Ok.... :) the others would be: def tableView_validateDrop_proposedRow_proposedDropOperation(tv, info, row, op) # Add code here to validate the drop puts 'validate drop' OSX::NSDragOperationEvery end def tableView_acceptDrop_row_dropOperation(tv, info, row, op) # Add code here to accept the drop puts 'acceptDrop' true end Eloy On 28 okt 2007, at 21:23, Alistair Holt wrote: > Thanks Eloy. > > I've been told that part one of http://www.corbinstreehouse.com/blog/?p=21 > would translate into: > > MyPrivateTableViewDataType = "MyPrivateTableViewDataType" > > def awakeFromNib > myTableView.registerForDraggedTypes([MyPrivateTableViewDataType]) > end > > ..which would make sense to me. Although I'm still not sure what the > fist line actually does. I also have no idea how to implement the > rest of the code in that example. I'm new to Objective-C and Cocoa > and have found it fairly easy to translate code so far but this has > really got me. > > Cheers > > On 28/10/2007, Eloy Duran <elo...@gm... > wrote: > Hi Alistair, > > > Is there a specific part that you don't understand about the > translation? > Or could you mail some code of what you thought it would be, so we > can see what it is that you can't figure out? > > > Cheers, > Eloy > > On 28 okt 2007, at 17:22, Alistair Holt wrote: > >> Hello, >> >> >> I'm trying to implement a NSTableView with Drag and Drop >> capabilities in RubyCocoa. >> >> >> I have been trying to follow http://developer.apple.com/documentation/Cocoa/Conceptual/TableView/Tasks/UsingDragAndDrop.html >> and http://www.corbinstreehouse.com/blog/?p=21 but I just can not >> figure out how to translate the Objective-C code into RubyCocoa. >> >> >> Can anyone help me out? >> >> Thanks >> >> -- >> Alistair Holt >> ali...@gm... >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by: Splunk Inc. >> Still grepping through log files to find problems? Stop. >> Now Search log events and configuration files using AJAX and a >> browser. >> Download your FREE copy of Splunk now >> http://get.splunk.com/_______________________________________________ >> Rubycocoa-talk mailing list >> Rub...@li... >> https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a > browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > > > > > -- > Alistair Holt > ali...@gm... > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a > browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/_______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk |
From: Alistair H. <ali...@gm...> - 2007-10-28 21:29:32
|
That is fantastic Eloy. Thank you very much for that! You've helped my understanding of translating Objective-C immensely. :) On 28/10/2007, Eloy Duran <elo...@gm...> wrote: > > Ok.... :) the others would be: > > def tableView_validateDrop_proposedRow_proposedDropOperation(tv, info, > row, op) > # Add code here to validate the drop > puts 'validate drop' > OSX::NSDragOperationEvery > end > > > def tableView_acceptDrop_row_dropOperation(tv, info, row, op) > # Add code here to accept the drop > puts 'acceptDrop' > true > end > > > Eloy > > > On 28 okt 2007, at 21:23, Alistair Holt wrote: > > Thanks Eloy. > > I've been told that part one of http://www.corbinstreehouse.com/blog/?p=21would translate into: > > > MyPrivateTableViewDataType = "MyPrivateTableViewDataType" > > > def awakeFromNib > myTableView.registerForDraggedTypes([MyPrivateTableViewDataType]) > end > > > ..which would make sense to me. Although I'm still not sure what the fist > line actually does. I also have no idea how to implement the rest of the > code in that example. I'm new to Objective-C and Cocoa and have found it > fairly easy to translate code so far but this has really got me. > > > Cheers > > On 28/10/2007, Eloy Duran <elo...@gm... > wrote: > > > > Hi Alistair, > > > > Is there a specific part that you don't understand about the > > translation? > > Or could you mail some code of what you thought it would be, so we can > > see what it is that you can't figure out? > > > > > > Cheers, > > Eloy > > > > On 28 okt 2007, at 17:22, Alistair Holt wrote: > > > > Hello, > > > > I'm trying to implement a NSTableView with Drag and Drop capabilities in > > RubyCocoa. > > > > > > I have been trying to follow > > http://developer.apple.com/documentation/Cocoa/Conceptual/TableView/Tasks/UsingDragAndDrop.htmland http://www.corbinstreehouse.com/blog/?p=21but I just can not figure out how to translate the Objective-C code into > > RubyCocoa. > > > > > > Can anyone help me out? > > > > Thanks > > > > -- > > Alistair Holt > > ali...@gm... > > ------------------------------------------------------------------------- > > > > This SF.net email is sponsored by: Splunk Inc. > > Still grepping through log files to find problems? Stop. > > Now Search log events and configuration files using AJAX and a browser. > > Download your FREE copy of Splunk now >> > > http://get.splunk.com/_______________________________________________ > > Rubycocoa-talk mailing list > > Rub...@li... > > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > > > > > > > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by: Splunk Inc. > > Still grepping through log files to find problems? Stop. > > Now Search log events and configuration files using AJAX and a browser. > > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > _______________________________________________ > > Rubycocoa-talk mailing list > > Rub...@li... > > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > > > > > > > -- > Alistair Holt > ali...@gm... > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> > http://get.splunk.com/_______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > > -- Alistair Holt ali...@gm... |
From: Eloy D. <elo...@gm...> - 2007-10-28 21:46:36
|
Have fun! :) On 28 okt 2007, at 22:29, Alistair Holt wrote: > That is fantastic Eloy. Thank you very much for that! You've helped > my understanding of translating Objective-C immensely. :) > > On 28/10/2007, Eloy Duran <elo...@gm...> wrote: > Ok.... :) the others would be: > > > def tableView_validateDrop_proposedRow_proposedDropOperation(tv, > info, row, op) > # Add code here to validate the drop > puts 'validate drop' > OSX::NSDragOperationEvery > end > > > def tableView_acceptDrop_row_dropOperation(tv, info, row, op) > # Add code here to accept the drop > puts 'acceptDrop' > true > end > > > Eloy > > > On 28 okt 2007, at 21:23, Alistair Holt wrote: > >> Thanks Eloy. >> >> >> I've been told that part one of http://www.corbinstreehouse.com/blog/?p=21 >> would translate into: >> >> >> MyPrivateTableViewDataType = "MyPrivateTableViewDataType" >> >> >> def awakeFromNib >> myTableView.registerForDraggedTypes([MyPrivateTableViewDataType]) >> end >> >> >> ..which would make sense to me. Although I'm still not sure what >> the fist line actually does. I also have no idea how to implement >> the rest of the code in that example. I'm new to Objective-C and >> Cocoa and have found it fairly easy to translate code so far but >> this has really got me. >> >> >> Cheers >> >> On 28/10/2007, Eloy Duran < elo...@gm... > wrote: >> Hi Alistair, >> >> >> Is there a specific part that you don't understand about the >> translation? >> Or could you mail some code of what you thought it would be, so we >> can see what it is that you can't figure out? >> >> >> Cheers, >> Eloy >> >> On 28 okt 2007, at 17:22, Alistair Holt wrote: >> >>> Hello, >>> >>> >>> I'm trying to implement a NSTableView with Drag and Drop >>> capabilities in RubyCocoa. >>> >>> >>> I have been trying to follow http://developer.apple.com/documentation/Cocoa/Conceptual/TableView/Tasks/UsingDragAndDrop.html >>> and http://www.corbinstreehouse.com/blog/?p=21 but I just can >>> not figure out how to translate the Objective-C code into RubyCocoa. >>> >>> >>> Can anyone help me out? >>> >>> Thanks >>> >>> -- >>> Alistair Holt >>> ali...@gm... >>> ------------------------------------------------------------------------- >>> This SF.net email is sponsored by: Splunk Inc. >>> Still grepping through log files to find problems? Stop. >>> Now Search log events and configuration files using AJAX and a >>> browser. >>> Download your FREE copy of Splunk now >> http://get.splunk.com/_______________________________________________ >>> Rubycocoa-talk mailing list >>> Rub...@li... >>> https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk >> >> >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by: Splunk Inc. >> Still grepping through log files to find problems? Stop. >> Now Search log events and configuration files using AJAX and a >> browser. >> Download your FREE copy of Splunk now >> http://get.splunk.com/ >> _______________________________________________ >> Rubycocoa-talk mailing list >> Rub...@li... >> https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk >> >> >> >> >> -- >> Alistair Holt >> ali...@gm... >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by: Splunk Inc. >> Still grepping through log files to find problems? Stop. >> Now Search log events and configuration files using AJAX and a >> browser. >> Download your FREE copy of Splunk now >> http://get.splunk.com/_______________________________________________ >> Rubycocoa-talk mailing list >> Rub...@li... >> https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a > browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > > > > > -- > Alistair Holt > ali...@gm... > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a > browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/_______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk |
From: Jon B. <jo...@gm...> - 2007-10-29 00:51:41
|
Hi Alistair - You might also be able to pick up hints from this small sample ... http://jonbaer.textdriven.com/rubycocoa/SimpleDrag.zip (not sure if this works in Leopard) I was going to use the technique in an an actual app (http://jonbaer.textdriven.com/facetastic/ ) but could not keep up w/ APIs and Framework fell behind so Ive abandoned it, if I can relocate the source will gladly post. - Jon |
From: Alistair H. <ali...@gm...> - 2007-10-29 01:35:59
|
Hi Jon, Thanks for that zip - it was very interesting to look over, I'm sure I can gain some more knowledge from it. Facetastic looks pretty cool. I'd be interested in taking a look at it and it's source if you can find it :) Alistair Holt On 29/10/2007, Jon Baer <jo...@gm...> wrote: > > Hi Alistair - > > You might also be able to pick up hints from this small sample ... > > http://jonbaer.textdriven.com/rubycocoa/SimpleDrag.zip (not sure if > this works in Leopard) > > I was going to use the technique in an an actual app ( > http://jonbaer.textdriven.com/facetastic/ > ) but could not keep up w/ APIs and Framework fell behind so Ive > abandoned it, if I can relocate the source will gladly post. > > - Jon > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > -- Alistair Holt ali...@gm... |