Skip to content

Resize the main window #128

Closed Answered by mtp
mtp asked this question in Q&A
Jan 20, 2021 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

Si I looked at the MasterWindow.go file.
I found the following function

// Set position of master window.
func (w *MasterWindow) SetPos(x, y int) {
	if w.platform != nil {
		if glfwPlatform, ok := w.platform.(*imgui.GLFW); ok {
			glfwPlatform.GetWindow().SetPos(x, y)
		}
	}
}

So I used this one to create a SetSize function as :

// Set size of master window.
func (w *MasterWindow) SetSize(width, height int) {
	if w.platform != nil {
		if glfwPlatform, ok := w.platform.(*imgui.GLFW); ok {
			glfwPlatform.GetWindow().SetSize(width, height)
		}
	}
}

But when I call this function when the app is already running, my program is exiting with the following error :

Assertion failed!

Program: C:\x…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@AllenDang
Comment options

@mtp
Comment options

@AllenDang
Comment options

@mtp
Comment options

Answer selected by mtp
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