Skip to content
Steven Zack edited this page Sep 13, 2021 · 7 revisions

目录

  • 组件列表
    • 核心

      • Window
      • Widget
    • 基础组件

      • Button
      • Label
      • Edit
      • CheckBox
      • RadioButton
      • ComboBox
      • CheckBox
      • TextArea
      • TextBrowser
      • GroupBox
      • Image
      • Progress
    • 布局

      • VBoxLayout
      • HBoxLayout
      • FormLayout
      • Spacer
    • 容器

      • Frame
      • TabWidget
      • Scroll
    • 其他

      • MenuBar
      • FileDialog
      • MessageBox

组件展示demo

package main

import (
	. "github.com/gofaith/faithtop"
)

func main() {
	app := NewApp()

	var label ILabel
	var edit IEdit

	Window().DeferShow().CenterWidget(VBox(
		TabWidget(
			TabPage{
				Name: "Tab 1",
				Content: Widget().Layout(VBoxLayout().Align(AlignHCenter).AppendWidgets(
					LabelImage(":/qml/folder.svg", 50, 50),
					Label2("This is a text label").Assign(&label),
					Edit().Assign(&edit),
					HBox(
						RadioButton2("one"),
						RadioButton2("two"),
						ComboBox().Data([]string{"Bob", "Steven"}),
					),
					CheckBox().Text("checkbox"),
					Button2("show").OnClick(func() {
						label.Text(edit.GetText())
					}),
					Progress().Max(100).Value(24).Text("progress"),
				)),
			},
			TabPage{
				Name:    "Tab 2",
				Content: Label2("Tab 2"),
			},
			TabPage{
				Name:    "Tab 3",
				Content: Label2("Tab 3"),
			},
		),
	))

	app.Run()
}
Clone this wiki locally