Selection Rectangle in a GtkDrawingArea



Hi,

I have an aplication where i need to draw something in a GtkDrawingArea (or
similar), because i need to create a picture from pixel handling.

I want to had some sort of selection box in the DrawingArea, something
similar as the one used to select multiple files in nautilus or something
(while keeping button 1 pressed and dragging). I have been trying to
simulate this behaviour by manually drawing a rectangle in the Drawing Area,
and using both mouse_pressed_event and motion_notify_event. However I
believe this to be quite unefficent since it requieres lots of repainting
sections of the DrawingArea. Also, sometimes the motion event is too slow to
compute and parts of the old rectangle aren't redrawn and the picture I am
displaying fails to look ok.

Is there some way to do it more neatly? Perhaps using another Widget or
something?

Regards,
Diego Rivera-Gutiérrez
Estudiante Ingeniería en Computación
Instituto Tecnológico de Costa Rica



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]