Skip to content

Ability to set Window Flags#3

Open
meir wants to merge 3 commits into
raff:masterfrom
meir:master
Open

Ability to set Window Flags#3
meir wants to merge 3 commits into
raff:masterfrom
meir:master

Conversation

@meir

@meir meir commented Mar 11, 2020

Copy link
Copy Markdown

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

raff commented Mar 11, 2020

Copy link
Copy Markdown
Owner

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

@meir

meir commented Mar 12, 2020

Copy link
Copy Markdown
Author

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