[fpc-devel] Chosing a graphical interface for specific proposals

luciano de souza luchyanus at gmail.com
Tue Oct 26 17:00:37 CEST 2010


I understand. After running H2pas, I had erros in all rows with "array
of const". The arguments are not constants indeed. They are ihandle or
pihandle as the first one is. So but when I use varargs probabibly all
the arguments have the same type: pihandle. I believe the second
alternative will compile.

I didn't know varargs. It's a nice feature! I will try to compile with
these tips and I come back with the results.


2010/10/26, luciano de souza <luchyanus at gmail.com>:
> 2010/10/26, Sven Barth <pascaldragon at googlemail.com>:
>> Am 26.10.2010 16:18, schrieb luciano de souza:
>>> IUP 2.x are not compatible with screen readers. The reason is the
>>> excessive usage of Canvas Draw. I did a large number of tests with IUP
>>> and Lua and I can assure IUP 3.1 and 3.2, the last version, are very
>>> good so in Linux as in Windows. For this reason, I would like to
>>> translate IUP 3.2.
>>>
>>
>> Ok, then I'll concentrate on IUP 3.
>>
>>> Yes, we can find lots of "define", but I find a problem seeming to be
>>> more complicated.
>>>
>>> See this declaration in C:
>>>
>>> ihandle* IupVbox(ihandle *child, ...)
>>>
>>> IupVbox is a vertical container wich can encompass several objects, so
>>> it's not possible to know how many arguments it will contain.
>>
>> Ok... you can translate this with FreePascal, but you must do it by hand
>> (so you need to comment (//...) the functions in the C header).
>>
>> Here's the translation (I herby assume that a type "Pihandle = ^ihandle"
>> and a constant "libiup='libiup.so'" are defined):
>>
>> Variant a:
>>
>> Declaration:
>> function IupVbox(child: Pihandle; args: array of const): Pihandle;
>> cdecl; external libiup;
>>
>> Calling:
>> IupVbox(Iuplabel("Label 1"), [hbox1, Nil]);
>>
>> Variant b:
>>
>> Declaration:
>> function IupVbox(child: Pihandle): Pihandle; cdecl; varargs; external
>> libiup;
>>
>> Calling:
>> IupVbox(Iuplabel("Label 1"), hbox1, Nil);
>>
>> The compiler won't do any checks on the arguments.
>>
>> See also:
>> http://www.freepascal.org/docs-html/ref/refsu74.html#x159-16600011.9.16
>>
>> Regards,
>> Sven
>> _______________________________________________
>> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
>> http://lists.freepascal.org/mailman/listinfo/fpc-devel
>>
>
>
> --
> Luciano de Souza
>


-- 
Luciano de Souza



More information about the fpc-devel mailing list