On 10/10/18 1:17 PM, aedt wrote:
Hello, I have been trying out the examples in pygtk and trying them out in gtkd. I came across this example where they used a member variable (of gtk.Window?) called timeout_id. I can't find anything similar to that in the documentation. Here's what I've got so far, any pointers would be greatly appreciated.
timeout_id
is a local variable to store the id of the timeout.
The D equivalent would be:
import glib.Timeout
Timeout timeout_id;
void on_pulse_toggled(Button button)
{
if ( button.getActive() )
{ entry.setProgressPulseStep(0.2);
// Call self.do_pulse every 100 ms
timeout_id = new Timeout(100, &do_pulse);
}
else
{
// Don't call self.do_pulse anymore
timeout_id.destroy();
timeout_id = null;
entry.setProgressPulseStep(0)
}
}