Created
January 3, 2017 11:56
-
-
Save dtoebe/ee08569b7d95ed8ca03ef8da472e212a to your computer and use it in GitHub Desktop.
WRITE A SIMPLE MARKDOWN EDITOR WITH GO-QML - main.go - 6
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
//main.go | |
... | |
func run() error { | |
qml.RegisterTypes("TextConverter", 1, 0, []qml.TypeSpec{{ | |
// Above creates a importable type with an array of Type (qml.Objects) specifications | |
Init: func (h *HTMLText, obj qml.Object) { // Initializes the object and creates a pointer for HTMLText that we can reference from QML in the method we just created | |
h.Text = "Rich Text" //Sets default value... Could be anything | |
}, | |
}}) | |
... | |
} | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment