Closed nadirs closed 6 years ago
When using a cairo::Context to draw on a gtk::DrawingArea, nothing is drawn if context is used in relm's message-passing-style callback (i.e. update method of trait Update).
cairo::Context
update
trait Update
I wrote an example test for this behavior here: https://github.com/nadirs/relm-cairo-test/
You can see the update method that should handle connect_draw here: https://github.com/nadirs/relm-cairo-test/blob/master/src/main.rs#L39 (usage of cairo::Context here does not work)
connect_draw
You can see that cairo::Context, used "immediately" in the connect_draw callback, does work: https://github.com/nadirs/relm-cairo-test/blob/master/src/main.rs#L83
Any idea?
P.S.: thank you for building relm!
Duplicate of #57. For now, it's not supported and you need to use the gtk-way.
When using a
cairo::Context
to draw on a gtk::DrawingArea, nothing is drawn if context is used in relm's message-passing-style callback (i.e.update
method oftrait Update
).I wrote an example test for this behavior here: https://github.com/nadirs/relm-cairo-test/
You can see the
update
method that should handleconnect_draw
here: https://github.com/nadirs/relm-cairo-test/blob/master/src/main.rs#L39 (usage ofcairo::Context
here does not work)You can see that
cairo::Context
, used "immediately" in theconnect_draw
callback, does work: https://github.com/nadirs/relm-cairo-test/blob/master/src/main.rs#L83Any idea?
P.S.: thank you for building relm!