George Shuklin
George Shuklin

Reputation: 7887

canvas for pixel drawing in GTK3 (gtk-rs)

I just started to use gtk3, and I overwhelmed. I want to draw a pixel rendering (a function graph, drawn in realtime) in a window. I was able to create a window, following some examples, but I can't find information on pixel drawing. I need keywords to google (is it called 'canvas'? Pixel map? Drawing area?), and some advises on how to do it right. Should I keep a separate buffer and do copy every time I need to update window? Or can I just draw into existing gtk object?

Upvotes: 2

Views: 1207

Answers (1)

Akiner Alkan
Akiner Alkan

Reputation: 6882

For the examples you can generally check the documentation page of the crate itself. There are examples shown in crate documentation.

You can check the documentation of the crate from here.

You can draw your shapes on to the drawing area which is shown as example here on the documentation itself

As far as I have seen, it is pretty much ported with same function and struct names for GTK 3.0.

I need keywords to Google

You can basically google for the GTK library itself and the examples to get the insight about GTK and the easily implement with the help of documentation.

Getting started with GTK 3.0

Upvotes: 1

Related Questions