Re: StaticText alignment

Igor Korot <[email protected]>
Newsgroups gmane.comp.python.wxglade
Message-ID <CA+FnnTxQGQYav_Jh8Bnf+yfWUjsvBKsK3J0ArBRHjLYUcPRsUA@mail.gmail.com>
Hi, Brendan,

On Sun, Jul 30, 2017 at 8:49 AM, Brendan Simon (eTRIX)
<[email protected]> wrote:
> On 30/7/17 9:36 pm, Dietmar Schwertberger wrote:
>
> On 7/30/2017 12:28 PM, Brendan Simon (eTRIX) wrote:
>
> I have some wx.StaticText widgets in some sizers.  I've specified the sizer
> to expand and to align to the centre (horizontal and vertical).  I've also
> specified the widget itself to align to the centre.
>
> Usually, if EXPAND is set, then ALIGN_CENTER has no effect any more.
>
> Is this likely to be a wxglade issue or a wxPython (4.0.0b1) issue ?
>
> I would think that it's related to wxPython.
> Do you call sizer.Layout after changing the label?
> Also try sizer.GetItem(label).SetFlag(wx.ALIGN_CENTER) after changing the
> label.
>
> Calling sizer.Layout() resolves this issue :)
>
> Guess I was hoping that wxglade or wxPython would do that magic behind the
> scenes.
>
> Is there anyway for this to be done automatically?  A programmer goes to the
> trouble of defining sizers with certain properties (expand, centre, etc) and
> widgets with properties (e.g. centre), so setting the data should
> automatically honour those properties, yes/no?

Unfortunately there is no event to catch when the static text changes the value.
And if you move the controls/hide the controls you have to call
Layout() as no library
will no when you finish hiding/showing or reposition controls.

Thank you.

>
> Brendan.
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> wxGlade-general mailing list
> wxGlade-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/wxglade-general
>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.