Skip to content

Hello, Layout question for you: How can the text editor widget be globally accessible to it? #923

Closed Answered by kkoreilly
ddkwork asked this question in Q&A
Discussion options

You must be logged in to vote

If you are trying to access a widget in an event handler before you make it, you should do something like this:

var logView *texteditor.Editor

gi.NewButton(parent).SetText("Button").OnClick(func(e events.Event) {
     logView.SomeFunction()
})

// later...

logView = texteditor.NewEditor()

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@kkoreilly
Comment options

Answer selected by ddkwork
@ddkwork
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants