[gimp/soc-2009-dynamics] Clean up various calls to the response() callback
- From: Alexia Death <alexiade src gnome org>
- To: svn-commits-list gnome org
- Subject: [gimp/soc-2009-dynamics] Clean up various calls to the response() callback
- Date: Sun, 12 Jul 2009 16:29:37 +0000 (UTC)
commit 3d6b86eef184f0788ffd90568fb5270c5b3a9d96
Author: Michael Natterer <mitch gimp org>
Date: Sun Jul 12 17:14:08 2009 +0200
Clean up various calls to the response() callback
(gimp_image_map_tool_control): call gimp_image_map_tool_response() directly
instead of gtk_dialog_response().
(gimp_image_map_tool_key_press): must not call response() if there is
no dialog (if the tool wasn't used yet).
app/tools/gimpimagemaptool.c | 19 +++++++++++++------
1 files changed, 13 insertions(+), 6 deletions(-)
---
diff --git a/app/tools/gimpimagemaptool.c b/app/tools/gimpimagemaptool.c
index a681fc2..9ac0f7d 100644
--- a/app/tools/gimpimagemaptool.c
+++ b/app/tools/gimpimagemaptool.c
@@ -363,8 +363,9 @@ gimp_image_map_tool_control (GimpTool *tool,
case GIMP_TOOL_ACTION_HALT:
if (image_map_tool->shell)
- gtk_dialog_response (GTK_DIALOG (image_map_tool->shell),
- GTK_RESPONSE_CANCEL);
+ gimp_image_map_tool_response (image_map_tool->shell,
+ GTK_RESPONSE_CANCEL,
+ image_map_tool);
break;
}
@@ -378,22 +379,28 @@ gimp_image_map_tool_key_press (GimpTool *tool,
{
GimpImageMapTool *image_map_tool = GIMP_IMAGE_MAP_TOOL (tool);
- if (display == tool->display)
+ if (image_map_tool->shell && display == tool->display)
{
switch (kevent->keyval)
{
case GDK_Return:
case GDK_KP_Enter:
case GDK_ISO_Enter:
- gimp_image_map_tool_response (NULL, GTK_RESPONSE_OK, image_map_tool);
+ gimp_image_map_tool_response (image_map_tool->shell,
+ GTK_RESPONSE_OK,
+ image_map_tool);
return TRUE;
case GDK_BackSpace:
- gimp_image_map_tool_response (NULL, RESPONSE_RESET, image_map_tool);
+ gimp_image_map_tool_response (image_map_tool->shell,
+ RESPONSE_RESET,
+ image_map_tool);
return TRUE;
case GDK_Escape:
- gimp_image_map_tool_response (NULL, GTK_RESPONSE_CANCEL, image_map_tool);
+ gimp_image_map_tool_response (image_map_tool->shell,
+ GTK_RESPONSE_CANCEL,
+ image_map_tool);
return TRUE;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]