fyne-io/fyne

Change Title/Message in a Dialog

Open

#1,566 opened on Nov 17, 2020

View on GitHub
 (9 comments) (0 reactions) (0 assignees)Go (1,526 forks)batch import
Hacktoberfestenhancement

Repository metrics

Stars
 (28,262 stars)
PR merge metrics
 (Avg merge 26d 11h) (38 merged PRs in 30d)

Description

Is your feature request related to a problem? Please describe:

I have some long-running interactions that use ProgressInfiniteDialog and it would be great to simply be able to change the message shown as progress continued, instead of hiding the dialog and creating a completely new one every time a new stage of the process begins.

Is it possible to construct a solution with the existing API?

No

Describe the solution you'd like to see:

Consider indeterminate action with multiple steps, such as a program installation or download+extract.

total, progress, err := StartDownload("...")

// assume "total" was 0/-1/undefined for this example (e.g: webserver didn't tell us)
dlg := dialog.NewProgressInfinite("Downloading Update", "Starting download...", w)
select {
  case n, done := <-progress:
    if done { break }
    dlg.SetMessage(fmt.Sprintf("%d bytes retrieved...", n))
}

dlg.SetTitle("Extracting Update")
dlg.SetMessage("Starting file extraction...")
select {
  case f, done := <- events:
    if done { break }
    dlg.SetMessage(fmt.Sprintf("Extracting %s...", f)
}

Contributor guide