Last active
December 14, 2015 03:48
-
-
Save aalmiray/5023272 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// View | |
application(title: 'Sample', sizeToScene: true, centerOnScreen: true) { | |
scene(fill: black, width: 400, height: 300) { | |
vbox(padding: 80) { | |
comboBox(id: 'combo') | |
noparent { combo.items = model.monthList } | |
button(loadAction) | |
} | |
} | |
} | |
// Model | |
import javafx.collections.* | |
class SampleModel { | |
List monthList = FXCollections.observableList([new Date()]) | |
} | |
// Controller | |
import griffon.transform.Threading | |
class SampleController { | |
def model | |
@Threading(Threading.Policy.SKIP) | |
def load = { | |
def months = [new Date(), new Date()] | |
model.monthList.addAll(months) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment