Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
github.com/r3ap3r2004/winman
Winman is a basic yet powerful window manager in go for terminal-based user interfaces that plugs into tview.
It supports floating windows that can be dragged, resized and maximized. Windows can have buttons on the title bar, for example to close them, help commands or maximize / minimize.
Windows can also be modal, meaning that other windows don't receive input while a modal window is on top. You can control whether the user can drag or resize windows around the screen.
Windows can overlap each other by setting their Z-index. Any tview.Primitive
can be added to a window, thus you can combine with any other existing tview
widget! Check tview for a complete list of available widgets you can use.
go get github.com/r3ap3r2004/winman
package main
import (
"github.com/r3ap3r2004/winman"
"github.com/rivo/tview"
)
func main() {
app := tview.NewApplication()
wm := winman.NewWindowManager()
content := tview.NewTextView().
SetText("Hello, world!"). // set content of the text view
SetTextAlign(tview.AlignCenter) // align text to the center of the text view
window := wm.NewWindow(). // create new window and add it to the window manager
Show(). // make window visible
SetRoot(content). // have the text view above be the content of the window
SetDraggable(true). // make window draggable around the screen
SetResizable(true). // make the window resizable
SetTitle("Hi!"). // set the window title
AddButton(&winman.Button{ // create a button with an X to close the application
Symbol: 'X',
OnClick: func() { app.Stop() }, // close the application
})
window.SetRect(5, 5, 30, 10) // place the window
// now, execute the application:
if err := app.SetRoot(wm, true).EnableMouse(true).Run(); err != nil {
panic(err)
}
}
Refer to https://pkg.go.dev/github.com/r3ap3r2004/winman for the package's documentation.
The demos
directory contains a showcase demonstrating the different aspects of this library
This package works with tview and its dependencies.
Add your issue here on GitHub. Feel free to get in touch if you have any questions.
This package is written and maintained by Javier Peletier (@jpeletier) - Epic Labs
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.