Skip to content

Commit

Permalink
Remove old, unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
richardwilkes committed Jan 1, 2022
1 parent 9d9c1b7 commit 9c27649
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 38 deletions.
19 changes: 0 additions & 19 deletions internal/ns/application_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,6 @@ const (
ActivationPolicyProhibited
)

// https://developer.apple.com/documentation/appkit/nsmodalresponse
const (
ModalResponseCancel = 0
ModalResponseOK = 1
ModalResponseStop = -1000
ModalResponseAbort = -1001
ModalResponseContinue = -1002
)

var applicationClass = objc.Get("NSApplication")

// Application https://developer.apple.com/documentation/appkit/nsapplication?language=objc
Expand Down Expand Up @@ -88,13 +79,3 @@ func (a Application) SetWindowsMenu(menu Menu) {
func (a Application) SetHelpMenu(menu Menu) {
a.Send("setHelpMenu:", menu)
}

// KeyWindow https://developer.apple.com/documentation/appkit/nsapplication/1428406-keywindow?language=objc
func (a Application) KeyWindow() Window {
return Window{Object: a.Send("keyWindow")}
}

// MainWindow https://developer.apple.com/documentation/appkit/nsapplication/1428723-mainwindow?language=objc
func (a Application) MainWindow() Window {
return Window{Object: a.Send("mainWindow")}
}
3 changes: 0 additions & 3 deletions internal/ns/menu_item_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ const (
EventModifierFlagControl
EventModifierFlagOption
EventModifierFlagCommand
EventModifierFlagNumericPad
EventModifierFlagHelp
EventModifierFlagFunction
)

// ControlStateValue https://developer.apple.com/documentation/appkit/nscontrolstatevalue?language=objc
Expand Down
7 changes: 0 additions & 7 deletions internal/ns/url_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@ type URL struct {
objc.Object
}

// NewURL https://developer.apple.com/documentation/foundation/nsurl/1572047-urlwithstring?language=objc
func NewURL(str string) URL {
s := StringFromString(str)
defer s.Release()
return URL{Object: urlClass.Send("URLWithString:", s)}
}

// NewFileURL https://developer.apple.com/documentation/foundation/nsurl/1414650-fileurlwithpath?language=objc
func NewFileURL(str string) URL {
s := StringFromString(str)
Expand Down
7 changes: 0 additions & 7 deletions internal/ns/window_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,3 @@ type Window struct {
func (w Window) ContentView() View {
return View{Object: w.Send("contentView")}
}

// Frame https://developer.apple.com/documentation/appkit/nswindow/1419697-frame?language=objc
func (w Window) Frame() Rect {
var frame Rect
w.Send("frame", &frame)
return frame
}
2 changes: 1 addition & 1 deletion open_dialog_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,5 @@ func (d *macOpenDialog) RunModal() bool {
if active != nil && active.IsVisible() {
active.ToFront()
}
return result == ns.ModalResponseOK
return result == 1
}
2 changes: 1 addition & 1 deletion save_dialog_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,5 @@ func (d *macSaveDialog) RunModal() bool {
if active != nil && active.IsVisible() {
active.ToFront()
}
return result == ns.ModalResponseOK
return result == 1
}

0 comments on commit 9c27649

Please sign in to comment.