On Sat, 31 Aug 2002 01:23:49 +0800 (CST)
"mili" <mil...@16...> wrote:
> Hi, Everyone
>
> In gtk2forpascal, TGtkTextSearchFlags is defined as follows:
> TGtkTextSearchFlags = (
> GTK_TEXT_SEARCH_VISIBLE_ONLY,
> GTK_TEXT_SEARCH_TEXT_ONLY
> );
>
> Then the following C codes can't be converted to Pascal:
> search_flags = GTK_TEXT_SEARCH_VISIBLE_ONLY | GTK_TEXT_SEARCH_TEXT_ONLY;
> to
> search_flags := GTK_TEXT_SEARCH_VISIBLE_ONLY or GTK_TEXT_SEARCH_TEXT_ONLY;
>
> Because bit operator can't be operated on enum type. And at the same time,
>
> gedit_text_iter_forward_search() function in pascal will ask for a enum
> type, anything else is unacceptable. So, How can I do?
> I think this is a bug of gtk2forpascal, for the developers have not
> anticipate the incompatibility between Pascal and C.
Pascal knows enums and sets:
In c:
search_flags = GTK_TEXT_SEARCH_VISIBLE_ONLY | GTK_TEXT_SEARCH_TEXT_ONLY;
in pascal:
search_flags := [GTK_TEXT_SEARCH_VISIBLE_ONLY,GTK_TEXT_SEARCH_TEXT_ONLY];
Mattias
|