I would like to set a callback for the `download()` function but I do not seem to find a way to add a callback to the procedure.

Let's say, for example I have a GtkD Widget called "pb" (short for progressBar).

I want to download a file from a url and when done, I want a callback to access pb and increase by a certain number.

The GtkD progress bar API:
https://api.gtkd.org/gtk.ProgressBar.ProgressBar.setFraction.html

Normally, If it was dependent on a button, I would do something like:

    auto pb = new ProgressBar();
    auto more = new Button("go-next", GtkIconSize.BUTTON);
    more.addOnClicked(delegate void(Button _) {
        if (activityMode.getActive()) // ignore this if condition
            pb.pulse;
        else
            pb.setFraction(pb.getFraction + pb.getPulseStep);
    });

But how can I do this with `download()`?

Reply via email to