Drag & drop in graphics contexts



Hi.

I am trying to make a simple game with gtk+. It's a tile based rummy game.

I am using drawing area to show game board and tiles. In gc, user should drag
and drop tiles. When user doing this, I am listening the GDK_BUTTON_PRESS_MASK
and GDK_BUTTON_RELEASE_MASK events. I save the all objects x and y coordinates.
When user press a button and moved out mouse cursor in my drawing area, I am
changing my objects coordinates and rewdrawing everything. When doing this,
drawing everything is using a lot of cpu. It's not a problem for now, but I am
thinking to add lot of pixmap to my gc.

Is this a right usage for drag and drop in graphics contexts? If it isn't what 
should I use for this?

Thanks.


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