[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XForms] Some requests

From: Jens Thoms Toerring
Subject: Re: [XForms] Some requests
Date: Sun, 27 Dec 2009 20:41:36 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

Hi LukenShiro,

On Sun, Dec 27, 2009 at 04:52:46PM +0100, LukenShiro wrote:
> I would have some requests that would seem to ease my python porting
> work if it was technically possible, but only if it doesn't cause too
> much hassle to you, Jens, and if it doesn't have any backward
> incompatibility issues.
> 1) FL_OBJECT unique identifier for comparison.
> In XForms a user can use "if obj == exitbutton" to allow comparison
>  between two FL_OBJECTs (where obj is the product of fl_do_forms(), and
>  exitbutton is the product of fl_add_button(...)).
> ctypes (the library I use to wrap XForms in python) uses
> different created instances of FL_OBJECT class (equivalent of C
> FL_OBJECT struct), so a simple comparison using "if _obj_ ==
> _anotherobj_" is not useful (that is: comparison always fails).
> In order to resolve this problem I have used .u_ldata assigning to it a
>  unique value for a particular Object, so I could compare .u_ldata
>  FL_OBJECT element with another one.
> Nonetheless, as .u_ldata element could be maybe used for other purposes
> by users, I'd ask for another (new) element in FL_OBJECT struct (maybe
> something like .u_uid, of 'int' type).

A different approch could be to have a function that compares
two objects for equality, so that the pointer comparison happens
in the C code, i.e. 

int fl_is_same_object( FL_OBJECT * obj1, FL_OBJECT * obj2 );

That might be a bit simpler than adding an extra ID just for that
purpose. What do you think?
                                  Regards, Jens
  \   Jens Thoms Toerring  ________      address@hidden
   \_______________________________      http://toerring.de

reply via email to

[Prev in Thread] Current Thread [Next in Thread]