Some utility functions for using rx
with gtk-d
// If CheckButton is checked, the button is clickable
import gtk.CheckButton;
import gtk.Button;
import rx;
import rx.gtk;
auto disposeBag = new CompositeDisposable;
auto check = new CheckButton("I agree");
auto button = new Button("Next");
button.setSensitiveWith(check.toggledAsObservable(), disposeBag);
// If Entry has no value, the button is not clickable
import gtk.Button;
import gtk.Entry;
import rx;
import rx.gtk;
auto disposeBag = new CompositeDisposable;
auto entry = new Entry;
auto button = new Button("Check");
button.setSensitiveWith(entry.changedAsObservable().map!"a.length > 0"(), disposeBag);
Add dependencies command
dub add gtk-d rx rx-gtkd