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

Re: gEDA-user: [PCB] action context patch - lesstif



Oops, forgot to attach the file :)

-- 
.O.
..O
OOO

On Wed, 25 Mar 2009, igor2 wrote:

>Hi,
>
>I still believe that lesstif should call hid_actionv() from common
>instead of having a copy of it, but I can't make it so. Instead, this
>little patch updates lesstif's version.
>
>Regards,
>
>Tibor Palinkas
>
>
diff -uri pcb.orig/src/hid/lesstif/menu.c pcb.lesstif/src/hid/lesstif/menu.c
--- pcb.orig/src/hid/lesstif/menu.c	2009-03-25 05:57:56.000000000 +0100
+++ pcb.lesstif/src/hid/lesstif/menu.c	2009-03-25 06:49:17.000000000 +0100
@@ -813,12 +813,13 @@
 int
 lesstif_call_action (const char *aname, int argc, char **argv)
 {
-  int px, py;
+  int px, py, ret;
   HID_Action *a;
+  void *context, *old_context;
 
   if (!aname)
     return 1;
-  a = hid_find_action (aname, NULL);
+  a = hid_find_action (aname, &context);
   if (!a)
     {
       int i;
@@ -848,7 +849,11 @@
 	printf ("%s%s", i ? "," : "", argv[i]);
       printf (")\033[0m\n");
     }
-  return a->trigger_cb (argc, argv, px, py);
+  old_context = hid_action_context;
+  hid_action_context = context;
+  ret = a->trigger_cb (argc, argv, px, py);
+  hid_action_context = old_context;
+  return ret;
 }
 
 static void

_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user