Using Rust and GTK
I’m trying to draw some test in a DrawingArea. The call back to the draw function passes me a Cairo context but when trying to create a Pango Layout, I find I have the wrong Context.
let layout = pangocairo::create_layout(cr).expect("Failed to create Pango layout");
I have a gtk::cairo::Context, but the function takes a cairo::cairo::Context
I feel there must be a different way to do this but I haven’t been able to find anything.
let layout = drawing_area.create_pango_layout(Some(&text));
My problem now is I can’t find any way to actually get the layout to paint in the drawing area.
The examples I have found use something of the form pc_ctx.show_layout(pc_layout) but I can’t find any methods like that.
I’m completely puzzled once again.
Also, should I bu using the pango crate or the pangocairo crate?