Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to set Window Flags #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Ability to set Window Flags #3

wants to merge 3 commits into from

Conversation

meir
Copy link

@meir meir commented Mar 11, 2020

Changes

  • Added WindowFlag enum
  • Changed call from (app *App) NewWindow(uint, uint, bool, string) *Window to (app *App) NewWindow(uint, uint, bool, string, WindowFlag) *Window
  • Replaced default flags with flags given to a window to the WindowFlag variable given with the NewWindow call

Example

package main

import (
	"github.com/raff/ultralight-go"
)

func main() {
	app := ultralight.NewApp()
	defer app.Destroy()

	window := app.NewWindow(800, 600, false, "Window", ultralight.WindowFlagBorderless | ultralight.WindowFlagResizable)
	defer window.Destroy()

	window.View().LoadURL("file:///assets/index.html")

	window.Focus()
	app.Run()
}

@raff
Copy link
Owner

raff commented Mar 11, 2020

Maybe it would be better to add a new constructor (NewWindowWithFlag) or have a DefaultWindowFlags constant set to the current default flags.

@meir
Copy link
Author

meir commented Mar 12, 2020

I've reverted the NewWindow method back to its original state and added the method NewWindowUsingFlags
I have also added an example for the flags as examples/flags.go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants