Skip to content

Instantly share code, notes, and snippets.

@shadda
Created April 13, 2011 21:03
Show Gist options
  • Select an option

  • Save shadda/918413 to your computer and use it in GitHub Desktop.

Select an option

Save shadda/918413 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<mx:NSWindow xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:stylesheet src="css/main.css" />
<mx:script language="python">
@bind foo = [1,2,3]
@class sourceListItem = [classLoader loadClass: "LeftPaneItemRenderer"]
def sourceListItemClick(item, index):
if(index == len(foo) - 1):
return [NSAlert alertWithMessageText: "Last item"]
</mx:script>
<mx:NSView class="testView" id="mainView">
<mx:NSSplitView vertical="yes">
<mx:NSView id="leftPane">
<mx:NSSourceList dataSource="{foo}" itemRenderer="{sourceListItem}">
</mx:NSSourceList>
</mx:NSView>
<mx:NSView id="rightPane">
</mx:NSView>
</mx:NSSplitView>
</mx:NSView>
</mx:NSWindow>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment