예제 #1
0
func createPage3(assistant *gtk3.Assistant) {
	label := gtk3.NewLabel("This is a confirmation page, press 'Apply' to apply changes")

	label.Show()
	assistant.AppendPage(label)
	assistant.SetPageType(label, gtk3.GtkAssistantPage.CONFIRM)
	assistant.SetPageComplete(label, true)
	assistant.SetPageTitle(label, "Confirmation")
}
예제 #2
0
func createPage2(assistant *gtk3.Assistant) {
	box := gtk3.NewVBox(12)
	box.SetBorderWidth(12)

	checkButton := gtk3.NewCheckButtonWithLabel("This is optional data, you may continue even if you do not check this")
	box.PackStart(checkButton, false, false, 0)

	box.ShowAll()
	assistant.AppendPage(box)
	assistant.SetPageComplete(box, true)
	assistant.SetPageTitle(box, "Page 2")
}
예제 #3
0
func createPage4(assistant *gtk3.Assistant) *gtk3.ProgressBar {
	progressBar := gtk3.NewProgressBar()
	progressBar.SetHalign(gtk3.GtkAlign.CENTER)
	progressBar.SetValign(gtk3.GtkAlign.CENTER)

	progressBar.Show()
	assistant.AppendPage(progressBar)
	assistant.SetPageType(progressBar, gtk3.GtkAssistantPage.PROGRESS)
	assistant.SetPageTitle(progressBar, "Applying changes")

	// this prevents assistant window from being closed while we're "busy" applying changes
	assistant.SetPageComplete(progressBar, false)
	return progressBar
}
예제 #4
0
func createPage1(assistant *gtk3.Assistant) {
	box := gtk3.NewHBox(12)
	box.SetBorderWidth(12)

	label := gtk3.NewLabel("You must fill out this entry to continue")
	box.PackStart(label, false, false, 0)

	entry := gtk3.NewEntry()
	entry.SetActivatesDefault(true)
	box.PackStart(entry, true, true, 0)
	entry.Connect("changed", onEntryChanged, assistant)

	box.ShowAll()

	assistant.AppendPage(box)
	assistant.SetPageTitle(box, "Page 1")
	assistant.SetPageType(box, gtk3.GtkAssistantPage.INTRO)
}