Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-07

GTK2 gboolean changed

6 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Marco van de Voort

(related to mantis 17400)

FYI

In FPC/trunk the GTK2 gboolean type has been changed from "longbool" to a new type "boolean32".

motivation:

There have been some problems with the GTK2 boolean type for a while.

The longbool type that was used till now had the advantage of being 32-bit and compatible to pascal boolean (and pascal if ... then tests), but had the disadvantage that values unequal to 0 and 1 were legal in it, and could be passed to GTK2.

An attempt to fix this using an enum = (gfalse=0,gtrue=1) failed because it needed too many (100+) patches. The compiler devels then implemented a new boolean type, boolean32. This type, if I understood it right is a normal Boolean but 4 bytes wide.

I tested this today, and everything seemed to work. Lazarus only needed one oneline change that I committed, since it is still compatible with the old (2.4.x) situation.

Please keep an eye open the coming days for new gtk2 related problems that could signal there is a problem.

FPC (2.5.1) can be compiled with noboolean32 to get the old situation back.

Reply by email

John Landmesser
to Marco van de Voort

on two different PC with german locale and Windows XP LongMonthNames[3] = 'M?rz'
------------------------------------------------------------------------

example:

interface
uses
{$ifdef unix}clocale,{$endif}
    ShowMessage('M?rz  ' + LongMonthNames[3]);

Application.MainForm.Font.Charset = DEFAULT_CHARSET

That problem doesn't exist for Debian-Sid Linux !?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110704/f292973e/attachment.html>

Reply by email

John Landmesser

on two different PC with german locale and Windows XP LongMonthNames[3] = 'M?rz'
------------------------------------------------------------------------

example:

interface
uses
{$ifdef unix}clocale,{$endif}
    ShowMessage('M?rz  ' + LongMonthNames[3]);

Application.MainForm.Font.Charset = DEFAULT_CHARSET

That problem doesn't exist for Debian-Sid Linux !?

Reply by email

Vincent Snijders
to John Landmesser: on two different PC with german locale and Windows XP LongMonthNames[3] = 'M?rz'…

LongMonthNames is RTL, which uses the ansi encoding. If you want to show it using the LCL, convert it to UTF8.

2011/7/4 John Landmesser :

Show quoted text 24 lines
on two different PC with german locale? and Windows XP LongMonthNames[3] = 'M?rz' ________________________________ example: interface uses {$ifdef unix}clocale,{$endif} ?? ShowMessage('M?rz ' + LongMonthNames[3]); Application.MainForm.Font.Charset = DEFAULT_CHARSET That problem doesn't exist for Debian-Sid Linux !? -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

John Landmesser
to Vincent Snijders

Am 04.07.2011 20:15, schrieb Vincent Snijders:
thank you for that tipp:

Solution:
ShowMessage('M?rz  ' + AnsiToUtf8( LongMonthNames[3]));
Show quoted text 33 lines
LongMonthNames is RTL, which uses the ansi encoding. If you want to show it using the LCL, convert it to UTF8. 2011/7/4 John Landmesser: > on two different PC with german locale and Windows XP LongMonthNames[3] = > 'M?rz' > ________________________________ > example: > > interface > uses > {$ifdef unix}clocale,{$endif} > > ShowMessage('M?rz ' + LongMonthNames[3]); > > > Application.MainForm.Font.Charset = DEFAULT_CHARSET > > That problem doesn't exist for Debian-Sid Linux !? > > > -- > _______________________________________________ > Lazarus mailing list > > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus > > -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

John Landmesser
to John Landmesser: on two different PC with german locale and Windows XP LongMonthNames[3] = 'M?rz'…
Solution:
ShowMessage('M?rz  ' + AnsiToUtf8( LongMonthNames[3]));

Vincent Snijders explains:

LongMonthNames is RTL, which uses the ansi encoding. If you want to show it using the LCL, convert it to UTF8.
John Landmesser wrote 30 lines
on two different PC with german locale and Windows XP LongMonthNames[3] = 'M?rz' ------------------------------------------------------------------------ example: interface uses {$ifdef unix}clocale,{$endif} ShowMessage('M?rz ' + LongMonthNames[3]); Application.MainForm.Font.Charset = DEFAULT_CHARSET That problem doesn't exist for Debian-Sid Linux !? -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110704/fe1c7393/attachment.html>

Reply by email