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

Add NSLevelIndicator class #165

Merged
merged 1 commit into from
Jul 31, 2023
Merged

Conversation

programmingkidx
Copy link
Contributor

Adds the NSLevelIndicator class. Use this program to test out the code:

package main

import "github.com/progrium/macdriver/cocoa"
import "github.com/progrium/macdriver/objc"
import "github.com/progrium/macdriver/core"

func main() {

	app := cocoa.NSApp_WithDidLaunch(func(n objc.Object) {
		win := cocoa.NSWindow_New()
		win.SetTitle("NSLevelIndicator")
		win.MakeKeyAndOrderFront(nil)

		/* NSLevelIndicator code */
		rect := core.NSMakeRect(10, 40, 80, 25)
		level := cocoa.NSLevelIndicator_Alloc()
		level.InitWithFrame(rect)
		/* Dependent on the "Add types to mapType" commit
		level.SetMaxValue(100)
		level.SetMinValue(1)  */
		level.SetIntValue(2)
		win.ContentView().AddSubview(level)
	})
	app.SetActivationPolicy(cocoa.NSApplicationActivationPolicyRegular)
	app.ActivateIgnoringOtherApps(true)
	app.Run()
}

@progrium progrium merged commit dbfe5af into progrium:main Jul 31, 2023
3 checks passed
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