Hi, allow me to make suggestions:
Ihandle * Create (char* Value, char* Attr, Ihandle* parent){ Ihandle * iHwnd
= IupCreate( Value);
if (iHwnd ) { if(Attr && Attr[0] != '\0') {
IupSetAttributes(iHwnd, Attr); } if(parent ) {
AddChild(parent, iHwnd); } return iHwnd; } return NULL;}
Avoid unecessary initialization and call strlen.
Best regards,
Ranier Vilela
Date: Mon, 14 Dec 2015 14:24:24 -0200
From: [email protected]
To: [email protected]
Subject: Re: [Iup-users] Drawbacks with this approach
There is no need for IupRefresh for every IupAppend. Actually this will slow
down a lot the creation process.
Despite that the C code you sent looks ok.
Best,Scuri
On Mon, Dec 14, 2015 at 9:12 AM, James Fuller <[email protected]> wrote:
Antonio, Well it looks like my old brain is failing me again :)I tried to
convert the simple frame.c example to the Create/AddChild format with NO
success.
How would one approach this?
James==============================================This is the "c" code for the
Create/AddChild.==============================================void AddChild
(Ihandle* parent, Ihandle* child){ IupAppend(parent, child);
IupRefresh(parent);}
Ihandle* Create (char* Value, char* Attr, Ihandle* parent){ Ihandle* iHwnd
= {0}; iHwnd = IupCreate( Value);; if(iHwnd ) {
if(strlen(Attr)) { IupSetAttributes(iHwnd, Attr); }
if(parent ) { AddChild(parent, iHwnd); }
return iHwnd; } return NULL;}
------------------------------------------------------------------------------
_______________________________________________
Iup-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/iup-users
------------------------------------------------------------------------------
_______________________________________________
Iup-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/iup-users
Este e-mail foi enviado por um computador sem vĂrus e protegido
pelo Avast. www.avast.com
------------------------------------------------------------------------------
_______________________________________________
Iup-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/iup-users