agent-workspace / novelforge-project /flutter /examples /flutter_view /macos /Runner /MainFlutterWindow.swift
agent-workspace / novelforge-project /flutter /examples /flutter_view /macos /Runner /MainFlutterWindow.swift
Download novelforge-project/flutter/examples/flutter_view/macos/Runner/MainFlutterWindow.swift from luom2645/agent-workspace: direct link, hf CLI and curl.
- Browser
- Download file 986 Bytes
-
https://huggingface.co/luom2645/agent-workspace/resolve/main/novelforge-project/flutter/examples/flutter_view/macos/Runner/MainFlutterWindow.swift
- Command line
-
hf download hf://luom2645/agent-workspace/novelforge-project/flutter/examples/flutter_view/macos/Runner/MainFlutterWindow.swift
-
curl -L -o MainFlutterWindow.swift https://huggingface.co/luom2645/agent-workspace/resolve/main/novelforge-project/flutter/examples/flutter_view/macos/Runner/MainFlutterWindow.swift
986 Bytes
| // Copyright 2014 The Flutter Authors. All rights reserved. | |
| // Use of this source code is governed by a BSD-style license that can be | |
| // found in the LICENSE file. | |
| import Cocoa | |
| import FlutterMacOS | |
| /** | |
| The window that is automatically generated when `flutter create --target=macos` | |
| on a project. `MainFlutterWindow` uses a FlutterViewController as it's content | |
| view controller by default. | |
| */ | |
| class MainFlutterWindow: NSWindow { | |
| override func awakeFromNib() { | |
| let windowFrame = self.frame | |
| let storyboard = NSStoryboard(name: NSStoryboard.Name("Main"), bundle: Bundle.main) | |
| // `flutter create --target=macos` uses this class (`self`) as an entrypoint | |
| // for drawing on a surface. The line below intercepts that and uses | |
| // the storyboard from `Main.storyboard`. | |
| self.contentViewController = storyboard.instantiateController(withIdentifier: "MainViewController") as! NSViewController | |
| self.setFrame(windowFrame, display: true) | |
| super.awakeFromNib() | |
| } | |
| } | |