public
Description: Repository for a PyObjC project built in one of my tutorial series.
Homepage: http://lethain.com/
Clone URL: git://github.com/lethain/metawindow.git
metawindow / MWDragArrayController.py
100644 21 lines (16 sloc) 0.563 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#
# MWDragArrayController.py
# MetaWindow
#
# Created by Will Larson on 8/26/08.
# Copyright (c) 2008 Will Larson. All rights reserved.
#
 
from AppKit import NSStringPboardType
from Foundation import *
 
 
class MWDragArrayController(NSArrayController):
    def tableView_writeRows_toPasteboard_(self,tv,rows,pb):
        arranged = self.arrangedObjects()
        data = ",".join([ arranged[x]['name'] for x in rows ])
        pb.declareTypes_owner_([NSStringPboardType],self)
        pb.setString_forType_(data,NSStringPboardType)
        return True