I want to display some messages in highlighted static texts , but I
need them to be right aligned . How could I ? I have tried a lot of
things e.g.
- style=wx.RIGHT_ALIGN in initializer
- style=wx.RIGHT_ALIGN in initializer & flag=wx.EXPAND in sizer
- flag=wx.RIGHT_ALIGN in sizer
- ...
but it doesn't work . I imagine it's a typo or something trivial but I
cannot find it !
Q:
- Is it possible ?
- How could I ?
Thnx in advance !
PS: BTW, I've also noticed that GTK implementation of ScrolledPane
seems to be buggy . Items in there do not refresh on scrolling the
client area.
Q:
- Does anyone experiences similar behaviors in '2.8.7.1 (gtk2-unicode)'
running in Ubuntu Hardy ? Perhaps this has been enhanced in newer
versions and I just need to upgrade to latest . In that case ...
- Where can I find (is ti possible) fresh DEB pkgs for latest version to be
installed in Ubuntu Hardy ?
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
if it's trimmed down, and ready to run -- I can test it easily.
-CHB
···
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
if it's trimmed down, and ready to run -- I can test it easily.
-CHB
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
I am also experiencing the same problem
Running ubuntu 9.10 and wxpython 2.8.10.1
also tried on ubuntu 8.10 and wx python 2.8.9.2
Code sample:
Thanks -- that's a good example -- nice and small, and ready to run.
I added a line to change the background color of the statit text (which may not work on all platforms) but you'll see that (on OS-X at least), the text is right aligned, but the staticText control is left aligned in the 200x200 size control.
You really need sizers to lay this out...
import wx
class MyFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None)
if __name__ == "__main__":
app = wx.App(False)
frame = MyFrame()
frame.Show()
print "size of StaticText:", frame.ctrl2.Size
app.MainLoop()
···
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
I am also experiencing the same problem
Running ubuntu 9.10 and wxpython 2.8.10.1
also tried on ubuntu 8.10 and wx python 2.8.9.2
Code sample:
Thanks -- that's a good example -- nice and small, and ready to run.
Seems someone has to learn
However ...
I added a line to change the background color of the statit text (which
may not work on all platforms) but you'll see that (on OS-X at least),
the text is right aligned, but the staticText control is left aligned in
the 200x200 size control.
You really need sizers to lay this out...
... there are sizers in the example I mentioned before (the last two
examples) , and only the barely minimal widgets that resemble my
scenario (since I don't know whether that is a bug with sizers,
scrollable panels, or ... ) They are :
- A dialog
- A panel containing Ok, Cancel buttons and ...
- Show button because if I render the labels since the beginning it does work
but that's not what I wanna do ;o)
- Scrollable panel containing widgets
- Box sizers
- And three tiny poor little widgets
I've removed a lot of things (validators, further widgets, ...) AFAICS
there's nothing simpler than that in order to reproduce the issue ...
This been said I will be looking forward for your comments
Thnx in advance !
···
On Mon, Dec 7, 2009 at 3:57 PM, Christopher Barker <Chris.Barker@noaa.gov> wrote:
At first sight that seems to be similar to the original issue I posted
but IMO it doesn't seem so. As I mentioned before, if I supply the
text since the beginning then *IT WORKS*.
However if I set the label afterwards (e.g. after clicking on a
button) then it doesn't work as expected (shows nothing or left
aligned ;o).
See nothing similar in your example ... CMIIW anyway
Thnx !
···
On Mon, Dec 7, 2009 at 4:04 PM, Christopher Barker <Chris.Barker@noaa.gov> wrote:
... there are sizers in the example I mentioned before (the last two
examples) , and only the barely minimal widgets that resemble my
scenario (since I don't know whether that is a bug with sizers,
scrollable panels, or ... ) They are :
- A dialog
- A panel containing Ok, Cancel buttons and ...
- Show button because if I render the labels since the beginning it does work
but that's not what I wanna do ;o)
- Scrollable panel containing widgets
- Box sizers
- And three tiny poor little widgets
I've removed a lot of things (validators, further widgets, ...) AFAICS
there's nothing simpler than that in order to reproduce the issue ...
This been said I will be looking forward for your comments
Your using a GridBagSizer which creates flexable 'cells' that objects
are placed in. The objects however are still layed out in a grid
(columns/rows). For the layout your trying to achieve using some box
sizers will be much simpler.
The labels that you are adding that you want right aligned are
actually right aligned as per the client area they require, if you
want them to be right aligned as per the dialogs space you will need
to insert a strechable spacer to the left of each of them.
I made a few changes to how your layout is done to better show what I mean.
... there are sizers in the example I mentioned before (the last two
examples) , and only the barely minimal widgets that resemble my
scenario (since I don't know whether that is a bug with sizers,
scrollable panels, or ... ) They are :
- A dialog
- A panel containing Ok, Cancel buttons and ...
- Show button because if I render the labels since the beginning it does work
but that's not what I wanna do ;o)
- Scrollable panel containing widgets
- Box sizers
- And three tiny poor little widgets
I've removed a lot of things (validators, further widgets, ...) AFAICS
there's nothing simpler than that in order to reproduce the issue ...
This been said I will be looking forward for your comments
Your using a GridBagSizer which creates flexable 'cells' that objects
are placed in. The objects however are still layed out in a grid
(columns/rows).
GridBagSizer contains only the buttons and the scrollable panel . In
the real world example there are more widgets (e.g. listbox, further
buttons, collapsible panels ... ;o) spanning over multiple cells and
so on. That's why I used that sizer in first place. OTOH the text
controls and labels are inside a vertical box sizer [1]_
For the layout your trying to achieve using some box
sizers will be much simpler.
Your approach implies more sizers and more LOCs (just a comment, maybe
not related to the real issue
;o)
The labels that you are adding that you want right aligned are
actually right aligned as per the client area they require, if you
want them to be right aligned as per the dialogs space you will need
to insert a strechable spacer to the left of each of them.
I made a few changes to how your layout is done to better show what I mean.
The labels that you are adding that you want right aligned are
actually right aligned as per the client area they require, if you
want them to be right aligned as per the dialogs space you will need
to insert a strechable spacer to the left of each of them.
I made a few changes to how your layout is done to better show what I mean.
Well , after a deep (psycho)analysis of the code and your suggestions
I realized that my initial impression was right : * I was missing the
obvious * . The only thing that needed to be done [1]_ was to force
the box sizer to re-layout the widgets inside of it (thnx very much
Cody ! ) . Thnx everybody for the pointers
:o)
I knew I had to study the demo in detail. Excellent time to become a
missing person !
On Mon, Dec 7, 2009 at 5:02 PM, Olemis Lang <olemis@gmail.com> wrote:
On Mon, Dec 7, 2009 at 4:59 PM, Olemis Lang <olemis@gmail.com> wrote:
On Mon, Dec 7, 2009 at 4:33 PM, Cody Precord <codyprecord@gmail.com> wrote:
Hi,
On Mon, Dec 7, 2009 at 3:12 PM, Olemis Lang <olemis@gmail.com> wrote:
The labels that you are adding that you want right aligned are
actually right aligned as per the client area they require, if you
want them to be right aligned as per the dialogs space you will need
to insert a strechable spacer to the left of each of them.
I made a few changes to how your layout is done to better show what I mean.