简体   繁体   中英

How to make clickable shapes in GTKmm

I was looking for a way to create clickable shapes in GTKmm 3. I went through the documentation and going off how shapes are drawn with cairo I cant see how to do make these shapes clickable.

What I am trying to create are concentric arcs each being clickable very similar to this

带形状的样品

and I really can't see a way about creating it without clickable shapes.

Any help is appreciated.

SO apparently there is no way of going around this other than drawing an object and to figure out whether the mouse lied inside the shape using linear algebra and the coordinates of both the shape and the mouse.

An example of this is in the source code for the GNOME disk analyzer tool . look for button-press-event and follow the function calls.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM