Re: How to implement resizing handles?
- From: Damon Chaplin <damon karuna eclipse co uk>
- To: Linuxer Wang <linuxerwang gmail com>
- Cc: goocanvas-list gnome org
- Subject: Re: How to implement resizing handles?
- Date: Mon, 28 Nov 2011 10:34:17 +0000
On Sun, 2011-11-13 at 01:26 -0800, Linuxer Wang wrote:
> Hi, all
>
> Does anybody know how to add resizing handles to a goocanvas item? I
> mean the eight small squares surrounding a widget so that you can use
> your mouse to drag them to resize the widget. Is it an existing
> function in goocanvas? Or do I need to implement it with children items
> and event handling? If it's the latter, could anybody give a
> not-too-concise description of the implementation?
Sorry, I missed this.
You would need to create new items for each of the small squares, then
connect to the button signals on them:
g_signal_connect (item, "motion_notify_event",
G_CALLBACK (on_motion_notify), NULL);
g_signal_connect (item, "button_press_event",
G_CALLBACK (on_button_press), NULL);
g_signal_connect (item, "button_release_event",
G_CALLBACK (on_button_release), NULL);
In the signal handlers you'd have to adjust the item and the handles.
Damon
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]