-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Derek Smart <derek@grindaga.com>
- Loading branch information
Showing
5 changed files
with
181 additions
and
109 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.grindaga.crissaegrim | ||
|
||
import tornadofx.* | ||
import javafx.scene.text.FontWeight | ||
import com.grindaga.crissaegrim.Views.* | ||
|
||
class Crissaegrim : App( | ||
HelloWorld::class, | ||
Styles::class | ||
) | ||
|
||
class Styles : Stylesheet() { | ||
init { | ||
label { | ||
fontSize = 20.px | ||
fontWeight = FontWeight.BOLD | ||
backgroundColor += c("#cecece") | ||
} | ||
} | ||
} | ||
|
||
fun main(args: Array<String>) { | ||
launch<Crissaegrim>(args) | ||
} |
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
21 changes: 21 additions & 0 deletions
21
src/main/kotlin/com/grindaga/crissaegrim/Views/HelloWorld.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.grindaga.crissaegrim.Views | ||
|
||
import javafx.beans.property.SimpleIntegerProperty | ||
import javafx.scene.control.Label | ||
import javafx.scene.layout.BorderPane | ||
import tornadofx.* | ||
|
||
class HelloWorld : View() { | ||
override val root : BorderPane by fxml("/Views/HelloWorld.fxml") | ||
val counter = SimpleIntegerProperty() | ||
val counterInfo: Label by fxid() | ||
|
||
init { | ||
title = "Counter" | ||
counterInfo.bind(counter) | ||
} | ||
|
||
fun increment() { | ||
counter.value += 1 | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import javafx.geometry.Insets?> | ||
<?import javafx.scene.control.Button?> | ||
<?import javafx.scene.control.Label?> | ||
<?import javafx.scene.layout.BorderPane?> | ||
<?import javafx.scene.layout.VBox?> | ||
<?import javafx.scene.text.Font?> | ||
|
||
<BorderPane xmlns="http://javafx.com/javafx/null" xmlns:fx="http://javafx.com/fxml/1"> | ||
<padding> | ||
<Insets top="20" right="20" bottom="20" left="20"/> | ||
</padding> | ||
|
||
<center> | ||
<VBox alignment="CENTER" spacing="10"> | ||
<Label fx:id="counterInfo"> | ||
<font> | ||
<Font size="20"/> | ||
</font> | ||
</Label> | ||
<Button text="Click to increment" onAction="#increment"/> | ||
</VBox> | ||
</center> | ||
</BorderPane> |