xforms-development
[Top][All Lists]
Advanced

[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: Mon, 28 Dec 2009 00:08:42 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

Hi LukenShiro,

  in you first email today you wrote

> 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).

Just to make sure I understand things correctly (and I have to
admit that I don't have any good idea how the ctypes library
works and I guess without a deeper understand of Python's in-
ternals will be a bit difficult for me to grasp). When you
write "uses different created instances of FL_OBJECT" does
that mean that they don't get created with the fl_make_object()
function which is always used to create objects used within
XForms?

I ask because unless you use just copies, an ID assigned to
objects would not help a lot since then fl_make_object() would
create one set of IDs (I probably would use a monotonically
increasing unsigned value) while the "other (ctype) function"
you use would create another set, that is unless you only use
1:1 copies of objects created via fl_make_object().

On the other hand, would a pointer comparison function written
in C really do? I have just added a function

int
fl_is_same_object( const void * obj1, const void * obj2 )
{
     return obj1 == obj2;
}

which you could in principle use to compare all kinds of poin-
ters (be it e.g. FL_OBJECT or FL_FORM pointers). Since the
function is extremely simple I am wondering if it couldn't
also done with the ctype stuff and thus have a nagging fee-
ling that there's more to the problem than I understand at
the moment. If you create some extra objects that are copies
of those created vi fl_make_object() then, of course, a com-
parison like this will be useless and only a unique ID will
do (given that the copy operation also copies the ID).

                             Best regards, Jens

PS: > > > [X11 libraries functions wrapping]
    This is finished and should be avaliable shortly from the
    git repository. If you find more places where this is
    necessary please tell me, I had a look a forms.h but
    didn't find any others yet.
-- 
  \   Jens Thoms Toerring  ________      address@hidden
   \_______________________________      http://toerring.de




reply via email to

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