SOLFIND
Web Lens
Portal home

Dockメニュー | Electron

https://www.electronjs.org/ja/docs/latest/tutorial/macos-dock • 49 KB fetched
Open original page


Dockメニュー | Electron メインコンテンツへ飛ぶ Electron ドキュメント API ブログ ツール * Electron Forge * Electron Fiddle コミュニティ * ガバナンス * 事例紹介 * リソース リリース 日本語 * English * Deutsch * Español * Français * 日本語 * Português * Русский * 中文 検索 * はじめよう * Electron のプロセス * ベストプラクティス * サンプル * ダークモード * デバイスアクセス * アプリ内購入 * * キーボード ショート カット * ディープリンク * デスクトップランチャーアクション * * Menus * アプリケーションメニュー * コンテキストメニュー * Dockメニュー * * トレイメニュー * キーボード ショート カット * マルチスレッド * ネイティブなファイルのドラッグ&ドロップ * ナビゲーション履歴 * 通知 * オフスクリーンレンダリング * オンライン/オフライン イベントの検出 * プログレスバー * 最近使用したドキュメント * * * BrowserWindow が表すファイル * * スペルチェッカー * ウェブ埋め込み * タスクバーのカスタマイズ * * ウインドウのカスタマイズ * 開発 * Native Node Modules * 配布方法 * テストとデバッグ * リファレンス * コントリビューション * * サンプル * Menus * Dockメニュー 目次 Dockメニュー On macOS, the Dock is an interface element that displays open and frequently-used apps. While opened or pinned, each app has its own icon in the Dock. [!NOTE] On macOS, the Dock is the entry point for certain cross-platform features like Recent Documents and Application Progress . Read those guides for more details. Dock API ​ All functionality for the Dock is exposed via the Dock class exposed via app.dock property. There is a single Dock instance per Electron application, and this property only exists on macOS. One of the main uses for your app's Dock icon is to expose additional app menus. The Dock menu is triggered by right-clicking or Ctrl -clicking the app icon. By default, the app's Dock menu will come with system-provided window management utilities, including the ability to show all windows, hide the app, and switch between different open windows. To set an app-defined custom Dock menu, pass any Menu instance into the dock.setMenu API. [!TIP] For best practices to make your Dock menu feel more native, see Apple's Human Interface Guidelines page on Dock menus. Attaching a context menu ​ Setting a Dock menu const { app , BrowserWindow , Menu } = require ( 'electron/main' ) // dock.setMenu only works after the 'ready' event is fired app . whenReady ( ) . then ( ( ) => { const dockMenu = Menu . buildFromTemplate ( [ { label : 'New Window' , click : ( ) => { const win = new BrowserWindow ( ) } } // add more menu options to the array ] ) // Dock is undefined on platforms outside of macOS app . dock ?. setMenu ( dockMenu ) } ) [!NOTE] Unlike with regular context menus , Dock context menus don't need to be manually instrumented using the menu.popup API. Instead, the Dock object handles click events for you. [!TIP] To learn more about crafting menus in Electron, see the Menus guide. Runnable Fiddle demo ​ Below is a runnable example of how you can use the Dock menu to create and close windows in your Electron app. fiddle docs/latest/fiddles/menus/dock-menu このページを編集 前 コンテキストメニュー 次 トレイメニュー * Dock API * Attaching a context menu * Runnable Fiddle demo ドキュメント * 始めましょう * API リファレンス チェックリスト * パフォーマンス * セキュリティ ツール * Electron Forge * Electron Fiddle コミュニティ * ガバナンス * リソース * Discord * Bluesky * X * Mastodon * Stack Overflow その他 * GitHub * Open Collective * Infrastructure Dashboard Copyright OpenJS Foundation and Electron contributors. All rights reserved. The OpenJS Foundation has registered trademarks and uses trademarks. For a list of trademarks of the OpenJS Foundation , please see our Trademark Policy and Trademark List . Trademarks and logos not indicated on the list of OpenJS Foundation trademarks are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them. The OpenJS Foundation | Terms of Use | Privacy Policy | Bylaws | Code of Conduct | Trademark Policy | Trademark List | Cookie Policy Hosting and infrastructure graciously provided by

Links found on this page

  1. メインコンテンツへ飛ぶ [direct]
  2. Electron [direct]
  3. ドキュメント [direct]
  4. API [direct]
  5. ブログ [direct]
  6. Electron Forge [direct]
  7. Electron Fiddle [direct]
  8. ガバナンス [direct]
  9. 事例紹介 [direct]
  10. リソース [direct]
  11. リリース [direct]
  12. English [direct]
  13. Deutsch [direct]
  14. Español [direct]
  15. Français [direct]
  16. Português [direct]
  17. Русский [direct]
  18. 中文 [direct]
  19. Electron のプロセス [direct]
  20. ベストプラクティス [direct]
  21. サンプル [direct]
  22. ダークモード [direct]
  23. デバイスアクセス [direct]
  24. アプリ内購入 [direct]
  25. キーボード ショート カット [direct]
  26. ディープリンク [direct]
  27. デスクトップランチャーアクション [direct]
  28. Menus [direct]
  29. アプリケーションメニュー [direct]
  30. コンテキストメニュー [direct]
  31. トレイメニュー [direct]
  32. マルチスレッド [direct]
  33. ネイティブなファイルのドラッグ&ドロップ [direct]
  34. ナビゲーション履歴 [direct]
  35. 通知 [direct]
  36. オフスクリーンレンダリング [direct]
  37. オンライン/オフライン イベントの検出 [direct]
  38. プログレスバー [direct]
  39. 最近使用したドキュメント [direct]
  40. BrowserWindow が表すファイル [direct]
  41. スペルチェッカー [direct]
  42. ウェブ埋め込み [direct]
  43. タスクバーのカスタマイズ [direct]
  44. ウインドウのカスタマイズ [direct]
  45. 開発 [direct]
  46. Native Node Modules [direct]
  47. 配布方法 [direct]
  48. テストとデバッグ [direct]
  49. リファレンス [direct]
  50. コントリビューション [direct]
  51. Dock [direct]
  52. Dock [direct]
  53. Menu [direct]
  54. Human Interface Guidelines [direct]
  55. このページを編集 [direct]
  56. セキュリティ [direct]
  57. Discord [direct]
  58. Bluesky [direct]
  59. X [direct]
  60. Mastodon [direct]
  61. Stack Overflow [direct]
  62. GitHub [direct]
  63. Open Collective [direct]
  64. Infrastructure Dashboard [direct]
  65. OpenJS Foundation [direct]
  66. Trademark Policy [direct]
  67. Trademark List [direct]
  68. Terms of Use [direct]
  69. Privacy Policy [direct]
  70. Bylaws [direct]
  71. Code of Conduct [direct]
  72. Cookie Policy [direct]