fyne-io/fyne

Change Title/Message in a Dialog

Offen

#1.566 geöffnet am 17.11.2020

 (9 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Go (1.526 Forks)batch import
Hacktoberfestenhancement

Repository-Metriken

Stars
 (28.262 Sterne)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

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