Skip to content

Instantly share code, notes, and snippets.

@dtoebe
Created January 3, 2017 11:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dtoebe/ee08569b7d95ed8ca03ef8da472e212a to your computer and use it in GitHub Desktop.
Save dtoebe/ee08569b7d95ed8ca03ef8da472e212a to your computer and use it in GitHub Desktop.
WRITE A SIMPLE MARKDOWN EDITOR WITH GO-QML - main.go - 6
//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