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 NSComboBox class #154

Merged
merged 1 commit into from
Jul 22, 2023
Merged

Add NSComboBox class #154

merged 1 commit into from
Jul 22, 2023

Conversation

programmingkidx
Copy link
Contributor

Add the NSComboBox class. This program can be used to test this pull request:

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("NSComboBox")
		win.MakeKeyAndOrderFront(nil)

		/* NSComboBox code */
		rect := core.NSMakeRect(10, 40, 80, 25)
		comboBox := cocoa.NSComboBox_Alloc()
		comboBox.InitWithFrame(rect)
		item1 := core.NSString_StringWithString("One")
		item2 := core.NSString_StringWithString("Two")
		comboBox.AddItemWithObjectValue(item1)
		comboBox.AddItemWithObjectValue(item2)
		win.ContentView().AddSubview(comboBox)
	})

	app.SetActivationPolicy(cocoa.NSApplicationActivationPolicyRegular)
	app.ActivateIgnoringOtherApps(true)
	app.Run()
}

@tmc tmc merged commit b811cce into progrium:main Jul 22, 2023
2 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