Hi,
Ok, this is a little test.
Very well, wich we can confirm, that priority of IUP team is not
improve iup code, but, only add new features.
So why spend time and energy, if no one has interest...

Thank you.
Best regards,
Ranier Vilela
________________________________________
De: Ranier VF <ranier_...@hotmail.com>
Enviado: quarta-feira, 5 de junho de 2019 14:06
Para: IUP discussion list.
Assunto: [Iup-users] Performance optimize in function winButtonWmCommand.

Hi,
Here some performance optimize in function winButtonWmCommand.
The "_IUPBUT_INSIDE_ACTION" is not used anywhere else and can
changed by much faster C resource.

--- \dll\iup\a\src\win\iupwin_button.c  Mon Jun 03 20:25:39 2019
+++ iupwin_button.c     Wed Jun 05 10:58:31 2019
@@ -660,21 +660,17 @@
          so we added a test here also */
       if (iupAttribGetBoolean(ih, "CANFOCUS"))
       {
+        static int inside_action = 0;
         Icallback cb = IupGetCallback(ih, "ACTION");
         if (cb)
         {
           /* to avoid double calls when pressing enter and a dialog is 
displayed */
-          if (!iupAttribGet(ih, "_IUPBUT_INSIDE_ACTION"))
+          if (!inside_action)
           {
-            int ret;
-            iupAttribSet(ih, "_IUPBUT_INSIDE_ACTION", "1");
-
-            ret = cb(ih);
-            if (ret == IUP_CLOSE)
+            inside_action = 1;
+            if (cb(ih) == IUP_CLOSE)
               IupExitLoop();
-
-            if (ret!=IUP_IGNORE && iupObjectCheck(ih))
-              iupAttribSet(ih, "_IUPBUT_INSIDE_ACTION", NULL);
+            inside_action = 0;
           }
         }
       }

Best regards,
Ranier Vilela


_______________________________________________
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to