Page 1 of 1

PB6.0 Raspberry Pi Bullseye x32 StringGadget with #PB_Text_Center Fails

Posted: Wed Jan 11, 2023 1:15 am
by PitH
OS x32
PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian

A normal TextGadget like this

TextGadget(#Text_Line3, 120, 60, 650, 25, "", #PB_Text_Center)

works fine

A StringGadget like this

StringGadget(#String_Line1, 120, 110, 650, 25, "", #PB_Text_Center)

Doesn't work, the cursor position is on the far left , no typed letters are shown and a Entity_ID$ = GetGadgetText(#String_Line1)
results into an empty Entity_ID$.

If you change the line to
StringGadget(#String_Line1, 120, 110, 650, 25, "")

Works fine, typed text shows up on the left and the variable Entity_ID$ = GetGadgetText(#String_Line1)
is filled correctly.

Re: PB6.0 Raspberry Pi Bullseye x32 StringGadget with #PB_Text_Center Fails

Posted: Wed Jan 11, 2023 1:40 am
by jacdelad
#PB_Text_... indicates that this style is only valid for TextGadgets, not StringGadgets! Not a bug, the help nowhere suggests using this constant with any other control.
...now I understand your problem from your other thread. :D

Re: PB6.0 Raspberry Pi Bullseye x32 StringGadget with #PB_Text_Center Fails

Posted: Wed Jan 11, 2023 1:49 am
by PitH
With Windows x86 and x64 PB6.0 versions it works ,
give it a try.

Re: PB6.0 Raspberry Pi Bullseye x32 StringGadget with #PB_Text_Center Fails

Posted: Wed Jan 11, 2023 2:01 am
by jacdelad
Yeah I did, see the other thread. But it shouldn't, or let's say, it's a coincidence:
#PB_Text_Center has the value "1" which is the same as #ES_CENTER, which is used to center StringGadgets on Windows (it is a Windows constant, which is not defined on Linux!). I don't know which constant Linux uses to center text.

Re: PB6.0 Raspberry Pi Bullseye x32 StringGadget with #PB_Text_Center Fails

Posted: Wed Jan 11, 2023 11:48 am
by Shardik
jacdelad wrote: Wed Jan 11, 2023 2:01 am I don't know which constant Linux uses to center text.
You may take a look into this cross-platform example.