|
| 1 | +# BrowserWindow |
| 2 | + |
| 3 | +> Create and control browser windows. |
| 4 | +
|
| 5 | +## Instance Events |
| 6 | + |
| 7 | +To be implemented. |
| 8 | + |
| 9 | +## Static Methods |
| 10 | + |
| 11 | +To be implemented. |
| 12 | + |
| 13 | +## Instance Properties |
| 14 | + |
| 15 | +To be implemented |
| 16 | + |
| 17 | +## Instance Methods |
| 18 | + |
| 19 | +Objects created with `win := gotron.New()` have the following instance methods. These Methods will only have effect after running `win.Start()`. This is just a list to show implemented and unimplemented methods from electron's BrowserWindow. See [browser-window](https://github.com/electron/electron/blob/master/docs/api/browser-window.md) for full documentation of electron BrowserWindow. |
| 20 | + |
| 21 | +**Note:** Some methods are only available on specific operating systems and are |
| 22 | +labeled as such. |
| 23 | + |
| 24 | +### Implemented |
| 25 | +* `win.OpenDevTools()` |
| 26 | +* `win.SetSize(width int, height int, animate ...bool)` |
| 27 | +* `win.Close()` |
| 28 | +* `win.Show()` |
| 29 | +* `win.Hide()` |
| 30 | +* `win.Minimize()` |
| 31 | +* `win.Restore()` |
| 32 | +* `win.Maximize()` |
| 33 | +* `win.UnMaximize()` |
| 34 | +* `win.SetFullScreen(flag bool)` |
| 35 | + |
| 36 | +### Not (/partly) implemented |
| 37 | + |
| 38 | +* `win.Destroy()` |
| 39 | +* `win.Focus()` |
| 40 | +* `win.Blur()` |
| 41 | +* `win.IsFocused() bool` |
| 42 | +* `win.IsDestroyed() bool` |
| 43 | +* `win.ShowInactive()` |
| 44 | +* `win.IsVisible() bool` |
| 45 | +* `win.IsModal() bool` |
| 46 | +* `win.IsMaximised() bool` |
| 47 | +* `win.IsMinimized() bool` |
| 48 | +* `win.IsFullScreen() bool` |
| 49 | +* `win.SetSimpleFullScreen(flag bool)` |
| 50 | +* `win.IsSimpleFullScreen() bool` |
| 51 | +* `win.IsNormal() bool` |
| 52 | +* `win.SetAspectRatio(aspectRatio float64, extraSize string)` |
| 53 | +* `win.SetBackgroundColor(backgroundColor string)` |
| 54 | +* `win.PreviewFile(path string, displayName ...string)` |
| 55 | +* `win.CloseFilePreview()` |
| 56 | +* `win.SetBounds(bounds Rectangle, animate ...bool)` |
| 57 | +* `win.GetBounds() Rectangle` |
| 58 | +* `win.SetContentBounds(bounds Rectangle, animate ...bool)` |
| 59 | +* `win.GetContentBounds() Rectangle` |
| 60 | +* `win.GetNormalBounds() Rectangle` |
| 61 | +* `win.SetEnabled(enable bool)` |
| 62 | +* `win.GetSize() []int` |
| 63 | +* `win.SetContentSize(width int, height int, animate ...bool)` |
| 64 | +* `win.GetContentSize() []int` |
| 65 | +* `win.SetMinimumSize(width, height int)` |
| 66 | +* `win.GetMinimumSize() []int` |
| 67 | +* `win.SetMaximumSize(width, height int)` |
| 68 | +* `win.GetMaximumSize() []int` |
| 69 | +* `win.SetResizable(resizable bool)` |
| 70 | +* `win.IsResizable() bool` |
| 71 | +* `win.SetMovable(movable bool)` |
| 72 | +* `win.IsMovable() bool` |
| 73 | +* `win.SetMinimizable(minimizable bool)` |
| 74 | +* `win.IsMinimizable() bool` |
| 75 | +* `win.SetMaximizable(maximizable bool)` |
| 76 | +* `win.IsMaximizable() bool` |
| 77 | +* `win.SetFullScreenable(fullscreenable bool)` |
| 78 | +* `win.IsFullScreenable() bool` |
| 79 | +* `win.SetClosable(closable bool)` |
| 80 | +* `win.IsClosable() bool` |
| 81 | +* `win.SetAlwaysOnTop(flag bool, level string, relativeLevel ...int)` |
| 82 | +* `win.IsAlwaysOnTop() bool` |
| 83 | +* `win.MoveTop()` |
| 84 | +* `win.Center()` |
| 85 | +* `win.SetPosition(x, y int, animate ...bool)` |
| 86 | +* `win.GetPosition() []int` |
| 87 | +* `win.SetTitle(title string)` |
| 88 | +* `win.GetTitle() string` |
| 89 | +* `win.SetSheetOffset(offsetY float64, offsetX ...float64)` |
| 90 | +* `win.FlashFrame(flag bool)` |
| 91 | +* `win.SetSkipTaskbar(skip bool)` |
| 92 | +* `win.SetKiosk(flag bool)` |
| 93 | +* `win.IsKiosk() bool` |
| 94 | +* `win.GetNativeWindowHandle()` |
| 95 | +* `win.HookWindowMessage(message int, callback func([]interface{}) []interface{})` |
| 96 | +* `win.IsWindowMessageHooked(message int) bool` |
| 97 | +* `win.UnhookWindowMessage(message int)` |
| 98 | +* `win.UnhookAllWindowMessages()` |
| 99 | +* `win.GetRepresentedFilename() string` |
| 100 | +* `win.SetDocumentEdited(edited bool)` |
| 101 | +* `win.IsDocumentEdited()` |
| 102 | +* `win.FocusOnWebView()` |
| 103 | +* `win.BlurWebView()` |
| 104 | +* `win.CapturePage(rect []Rectangle, handler func(image string))` |
| 105 | +* `win.LoadURL(url, options interface{})` |
| 106 | +* `win.LoadFile(filePath string, options interface{})` |
| 107 | +* `win.Reload()` |
| 108 | +* `win.SetMenu(menu string)` |
| 109 | +* `win.SetProgressBar(progress float64, options ...interface{})` |
| 110 | +* `win.SetOverlayIcon(overlay string, description string)` |
| 111 | +* `win.SetHasShadow(hsShadow bool)` |
| 112 | +* `win.HasShadow() bool` |
| 113 | +* `win.SetOpacity(opacity float64)` |
| 114 | +* `win.GetOpacity() float64` |
| 115 | +* `win.SetShape(rects []Rectangle)` |
| 116 | +* `win.SetThumbarButtons(buttons interface{}) bool` |
| 117 | +* `win.SetThumbnailClip(region Rectangle)` |
| 118 | +* `win.SetThumbnailToolTip(toolTip string)` |
| 119 | +* `win.SetAppDetails(options interface{})` |
| 120 | +* `win.ShowDefinitionForSelection()` |
| 121 | +* `win.SetIcon(icon string)` |
| 122 | +* `win.SetWindowButtonVisibility(visible bool)` |
| 123 | +* `win.SetAutoHideMenuBar(hide bool)` |
| 124 | +* `win.IsMenuBarAutoHide() bool` |
| 125 | +* `win.SetMenuBarVisibility(visible bool)` |
| 126 | +* `win.IsMenuBarVisible() bool` |
| 127 | +* `win.SetVisibleOnAllWorkspaces(visible bool, options ...interface{})` |
| 128 | +* `win.IsVisibleOnAllWorkspaces() bool` |
| 129 | +* `win.SetIgnoreMouseEvents(ignore bool, options ...interface{})` |
| 130 | +* `win.SetContentProtection(enable bool)` |
| 131 | +* `win.SetFocusable(focusable bool)` |
| 132 | +* `win.SetParentWindow(parent *BrowserWindow)` |
| 133 | +* `win.GetParentWindow() BrowserWindow` |
| 134 | +* `win.GetChildWindows() []BrowserWindow` |
| 135 | +* `win.SetAutoHideCursor(autoHide bool)` |
| 136 | +* `win.SelectPreviousTab()` |
| 137 | +* `win.SelectNextTab()` |
| 138 | +* `win.MergeAllWindows()` |
| 139 | +* `win.MoveTabToNewWindow()` |
| 140 | +* `win.ToggleTabBar()` |
| 141 | +* `win.AddTabbedWindow(browserwindow *BrowserWindow)` |
| 142 | +* `win.SetVibrancy(vibrancy string)` |
| 143 | +* `win.SetTouchBar(touchBar interface{})` |
| 144 | +* `win.SetBrowserView(browserView interface{})` |
| 145 | +* `win.GetBrowserView() interface{}` |
0 commit comments