addSectionButton

platyping

Sleeping Dragon
Joined
Oct 22, 2010
Messages
4,626
Location
Emerald Dreams
Does anyone know why for buttons created using addSectionButton(XXXX), there is always this extra space in front which makes the data in the buttons look weird?

Is there any way to remove the space so that the alignment looks better?
 
Does anyone know why for buttons created using addSectionButton(XXXX), there is always this extra space in front which makes the data in the buttons look weird?

Is there any way to remove the space so that the alignment looks better?
It does not look like this is used anywhere outside of the worldbuilder python so it might just be a bug.
What you could try is adding some spaces after your text to see if that moves everything more to the left (it might be a layout problem). Or you could try to add some backspace characters to the start of your text string.
 
Hmm I guess \b stands for backspace?

I tried adding \b in front of localText.getText("TXT_KEY_WB_PROJECTS",()) and it ended up shifting it to the right even further.

So I tried the other way round:
localText.getText("TXT_KEY_WB_PROJECTS",())+"\b\b\b\b\b\b"
Which does shift them towards the middle, by adding spaces to the right...

Although it does align them better, but this method makes the button even longer :mischief:
Which is already too long in some screens :D

But I guess a long aligned button still looks better than a short misaligned button :D
 
Hmm I guess \b stands for backspace?

I tried adding \b in front of localText.getText("TXT_KEY_WB_PROJECTS",()) and it ended up shifting it to the right even further.

So I tried the other way round:
localText.getText("TXT_KEY_WB_PROJECTS",())+"\b\b\b\b\b\b"
Which does shift them towards the middle, by adding spaces to the right...

Although it does align them better, but this method makes the button even longer :mischief:
Which is already too long in some screens :D

But I guess a long aligned button still looks better than a short misaligned button :D
Maybe it is worth it to try to change the encoding that is passed to the button from unicode to ASCII.
 
It looks a lot like it is leaving room for an icon. Too bad there is apparently no way to add one.

What if you use "attachButton" instead?
 
Back
Top Bottom