Skip to content

Simple examples #7

@diamondburned

Description

@diamondburned

Hey. As a new TUI user hopping from tview, the lack of simple examples disturb me. Take a look at this:

https://github.com/gcla/gowid/blob/master/examples/gowid-menu/menu.go

A new person wouldn't for the life of them comprehend this. Comparing this 171 LOC example with tview's example:

package main

import "github.com/rivo/tview"

func main() {
	app := tview.NewApplication()
	dropdown := tview.NewDropDown().
		SetLabel("Select an option (hit Enter): ").
		SetOptions([]string{"First", "Second", "Third", "Fourth", "Fifth"}, nil)
	if err := app.SetRoot(dropdown, true).SetFocus(dropdown).Run(); err != nil {
		panic(err)
	}
}

You could see the obvious differences.

My recommendation: move the current examples to advanced/ and make a bare minimum simple/ example folder like Gtk.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions