[wxpython] Is there any control like this?

Unless you are using a very unusual client you just
need to scroll to the bottom and click there before you start typing

  • almost all mail clients will let you do that - some, like
    Thunderbird, you can set this as the default. On windows machines
    you should be able to press ctrl-end to get to the end of the
    message.

    Gadget/Steve

···

wxPython-users+unsubscribe@googlegroups.com
http://groups.google.com/group/wxPython-users?hl=en

2011년 10월 14일 오후 2:22, Gadget/Steve GadgetSteve@live.co.uk님의 말:

···

On 14/10/2011 12:23 AM, 최원준 wrote:

  I think when I create new message in mailing list, and

when I reply to any issue, it posts to top.

2011년 10월 14일 오전 12:21, Gadget/Steve GadgetSteve@live.co.uk
의 말:

            On 13/10/2011 3:49 PM, Steven Sproat > > > wrote:

On 13/10/2011 09:42, 최원준 wrote:

                I didn't intend to post to

top. sorry. and thank you.

2011/10/13 Andrea Gavana andrea.gavana@gmail.com

On 13 October 2011 10:37, 최원준 wonjunchoi001@gmail.com > > > > > > wrote:

                          as you see

in the screenshot, the parent of textctrl
has label. I am not sure what control can
be this in wxpython.

                          could you let me know what is this?
                        No special control, is a wx.StaticText

(for the label) beside a wx.TextCtrl, both
of them in an horizontal wx.BoxSizer. Please
do not top-post your replies.

                        Andrea.
              you just did :)
-- Steven Sproat, BSc
[http://www.whyteboard.org/](http://www.whyteboard.org/)

              To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

              or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
        Just to clarify, in case the terminology may be unfamiliar

to some, top posting is writing a reply with the new text
above that of the question, bottom posting is writing with
the new text after the question - like this. The general
preference in this newsgroup, (and many others), is bottom
posting as you can read the whole conversation in the latest
message.

          To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

          or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
  --

  To unsubscribe, send email to

wxPython-users+unsubscribe@googlegroups.com

  or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
Unless you are using a **very** unusual client you just

need to scroll to the bottom and click there before you start typing

  • almost all mail clients will let you do that - some, like
    Thunderbird, you can set this as the default. On windows machines
    you should be able to press ctrl-end to get to the end of the
    message.

    Gadget/Steve

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

thank you for the tip!

2011년 10월 14일 오후 2:33, 최원준 wonjunchoi001@gmail.com님의 말:

2011년 10월 14일 오후 2:22, Gadget/Steve GadgetSteve@live.co.uk님의 말:

  I think when I create new message in mailing list, and

when I reply to any issue, it posts to top.

2011년 10월 14일 오전 12:21, Gadget/Steve GadgetSteve@live.co.uk
의 말:

                I didn't intend to post to

top. sorry. and thank you.

                          as you see

in the screenshot, the parent of textctrl
has label. I am not sure what control can
be this in wxpython.

                          could you let me know what is this?
                        No special control, is a wx.StaticText

(for the label) beside a wx.TextCtrl, both
of them in an horizontal wx.BoxSizer. Please
do not top-post your replies.

                        Andrea.
              you just did :)
-- Steven Sproat, BSc
[http://www.whyteboard.org/](http://www.whyteboard.org/)

              To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

              or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
        Just to clarify, in case the terminology may be unfamiliar

to some, top posting is writing a reply with the new text
above that of the question, bottom posting is writing with
the new text after the question - like this. The general
preference in this newsgroup, (and many others), is bottom
posting as you can read the whole conversation in the latest
message.

          To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

          or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
  --

  To unsubscribe, send email to

wxPython-users+unsubscribe@googlegroups.com

  or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
Unless you are using a **very** unusual client you just

need to scroll to the bottom and click there before you start typing

  • almost all mail clients will let you do that - some, like
    Thunderbird, you can set this as the default. On windows machines
    you should be able to press ctrl-end to get to the end of the
    message.

    Gadget/Steve

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

thank you for the tip!

I made wx.BoxSizer and StaticText and TextCtrl.

    self.h_sizer2 = wx.BoxSizer(wx.HORIZONTAL)
    self.text2 = wx.StaticText(self, label="F", pos=(0,50))

    self.text = wx.StaticText(self, label="F", pos=(50,50))
    self.edit2 = wx.TextCtrl(self, size=wx.Size(0, -1), pos=(100,50), style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER)
    self.h_sizer2.Add(self.text2, 0,)

    self.h_sizer2.Add(self.edit2, 1,)
    self.SetSizer(self.h_sizer2)

but I want to make more than one StaticText + TextCtrl in BoxSizer.
how can I do this?

···

On 14/10/2011 12:23 AM, 최원준 wrote:

            On 13/10/2011 3:49 PM, Steven Sproat > > > > wrote:

On 13/10/2011 09:42, 최원준 wrote:

2011/10/13 Andrea Gavana andrea.gavana@gmail.com

On 13 October 2011 10:37, 최원준 wonjunchoi001@gmail.com > > > > > > > wrote:

Just create and add as many static texts and text controls as you
need, if you would like them laid out as:

    Static    Ctrl

    Static    Ctrl

then you will need to change from a Box sizer to a Grid sizer.

Gadget/Steve
···

wxPython-users+unsubscribe@googlegroups.com
http://groups.google.com/group/wxPython-users?hl=en

2011년 10월 14일 오후 4:07, Gadget/Steve GadgetSteve@live.co.uk님의 말:

2011년 10월 14일 오후 2:33, 최원준 wonjunchoi001@gmail.com
의 말:

2011년 10월 14일 오후 2:22, Gadget/Steve GadgetSteve@live.co.uk
의 말:

                    I think when I create new message in mailing

list, and when I reply to any issue, it posts
to top.

                    2011년 10월 14일 오전 12:21,

Gadget/Steve GadgetSteve@live.co.uk
의 말:

                                  I didn't

intend to post to top. sorry. and
thank you.

                                    2011/10/13

Andrea Gavana andrea.gavana@gmail.com

                                            as you see in the

screenshot, the parent
of textctrl has label. I
am not sure what control
can be this in wxpython.

                                            could you let me know

what is this?

                                          No special control, is

a wx.StaticText (for the
label) beside a
wx.TextCtrl, both of them
in an horizontal
wx.BoxSizer. Please do not
top-post your replies.

                                          Andrea.
                                you just did :)
-- Steven Sproat, BSc
[http://www.whyteboard.org/](http://www.whyteboard.org/)

                                To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

                                or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                          Just to clarify, in case the terminology

may be unfamiliar to some, top posting is
writing a reply with the new text above
that of the question, bottom posting is
writing with the new text after the
question - like this. The general
preference in this newsgroup, (and many
others), is bottom posting as you can read
the whole conversation in the latest
message.

                            To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

                            or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                    --

                    To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

                    or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                Unless you are using a **very** unusual

client you just need to scroll to the bottom and
click there before you start typing - almost all
mail clients will let you do that - some, like
Thunderbird, you can set this as the default. On
windows machines you should be able to press
ctrl-end to get to the end of the message.

                  Gadget/Steve

                  To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

                  or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
      thank you for the tip!
  I made wx.BoxSizer and StaticText and TextCtrl.



          self.h_sizer2 = wx.BoxSizer(wx.HORIZONTAL)

          self.text2 = wx.StaticText(self, label="F", pos=(0,50))

          self.text = wx.StaticText(self, label="F", pos=(50,50))

          self.edit2 = wx.TextCtrl(self, size=wx.Size(0, -1),

pos=(100,50), style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER)

          self.h_sizer2.Add(self.text2, 0,)

          self.h_sizer2.Add(self.edit2, 1,)

          self.SetSizer(self.h_sizer2)





  but I want to make more than one StaticText + TextCtrl in

BoxSizer.

  how can I do this?





  --

  To unsubscribe, send email to

wxPython-users+unsubscribe@googlegroups.com

  or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
Just create and add as many static texts and text controls as you

need, if you would like them laid out as:

    Static    Ctrl

    Static    Ctrl

then you will need to change from a Box sizer to a Grid sizer.



Gadget/Steve

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

should I use Grid sizer? what about this?

    v_sizer = wx.BoxSizer(wx.VERTICAL)
   
      h_sizer = wx.BoxSizer(wx.HORIZONTAL)
      h_sizer2 = wx.BoxSizer(wx.HORIZONTAL)
           
     self.text = wx.StaticText(self, label="F")

     self.edit = wx.TextCtrl(self, size=wx.Size(100, -1), pos=(100,50), style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER)
     h_sizer.Add(self.text, 0,)
     h_sizer.Add(self.edit, 1)
           
     v_sizer.Add(h_sizer)

     v_sizer.Add(h_sizer2)
       
    self.SetSizer(v_sizer)
···

On 14/10/2011 7:01 AM, 최원준 wrote:

On 14/10/2011 12:23 AM, 최원준 wrote:

                              On 13/10/2011 3:49 PM, Steven > > > > > > Sproat wrote:
                                On 13/10/2011 > > > > > > > 09:42, 최원준 wrote:
                                        On 13 October 2011 10:37, > > > > > > > > > 최원준 <wonjunchoi001@gmail.com> > > > > > > > > >                                             wrote:

2011년 10월 14일 오후 4:11, 최원준 wonjunchoi001@gmail.com님의 말:

2011년 10월 14일 오후 4:07, Gadget/Steve GadgetSteve@live.co.uk님의 말:

2011년 10월 14일 오후 2:33, 최원준 wonjunchoi001@gmail.com
의 말:

2011년 10월 14일 오후 2:22, Gadget/Steve GadgetSteve@live.co.uk
의 말:

                    I think when I create new message in mailing

list, and when I reply to any issue, it posts
to top.

                    2011년 10월 14일 오전 12:21,

Gadget/Steve GadgetSteve@live.co.uk
의 말:

                                  I didn't

intend to post to top. sorry. and
thank you.

                                    2011/10/13

Andrea Gavana andrea.gavana@gmail.com

                                            as you see in the

screenshot, the parent
of textctrl has label. I
am not sure what control
can be this in wxpython.

                                            could you let me know

what is this?

                                          No special control, is

a wx.StaticText (for the
label) beside a
wx.TextCtrl, both of them
in an horizontal
wx.BoxSizer. Please do not
top-post your replies.

                                          Andrea.
                                you just did :)
-- Steven Sproat, BSc
[http://www.whyteboard.org/](http://www.whyteboard.org/)

                                To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

                                or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                          Just to clarify, in case the terminology

may be unfamiliar to some, top posting is
writing a reply with the new text above
that of the question, bottom posting is
writing with the new text after the
question - like this. The general
preference in this newsgroup, (and many
others), is bottom posting as you can read
the whole conversation in the latest
message.

                            To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

                            or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                    --

                    To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

                    or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                Unless you are using a **very** unusual

client you just need to scroll to the bottom and
click there before you start typing - almost all
mail clients will let you do that - some, like
Thunderbird, you can set this as the default. On
windows machines you should be able to press
ctrl-end to get to the end of the message.

                  Gadget/Steve

                  To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

                  or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
      thank you for the tip!
  I made wx.BoxSizer and StaticText and TextCtrl.



          self.h_sizer2 = wx.BoxSizer(wx.HORIZONTAL)

          self.text2 = wx.StaticText(self, label="F", pos=(0,50))

          self.text = wx.StaticText(self, label="F", pos=(50,50))

          self.edit2 = wx.TextCtrl(self, size=wx.Size(0, -1),

pos=(100,50), style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER)

          self.h_sizer2.Add(self.text2, 0,)

          self.h_sizer2.Add(self.edit2, 1,)

          self.SetSizer(self.h_sizer2)





  but I want to make more than one StaticText + TextCtrl in

BoxSizer.

  how can I do this?





  --

  To unsubscribe, send email to

wxPython-users+unsubscribe@googlegroups.com

  or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
Just create and add as many static texts and text controls as you

need, if you would like them laid out as:

    Static    Ctrl

    Static    Ctrl

then you will need to change from a Box sizer to a Grid sizer.



Gadget/Steve

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

should I use Grid sizer? what about this?

    v_sizer = wx.BoxSizer(wx.VERTICAL)
   
      h_sizer = wx.BoxSizer(wx.HORIZONTAL)
      h_sizer2 = wx.BoxSizer(wx.HORIZONTAL)
           
     self.text = wx.StaticText(self, label="F")


     self.edit = wx.TextCtrl(self, size=wx.Size(100, -1), pos=(100,50), style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER)
     h_sizer.Add(self.text, 0,)
     h_sizer.Add(self.edit, 1)
           
     v_sizer.Add(h_sizer)


     v_sizer.Add(h_sizer2)
       
    self.SetSizer(v_sizer)

the count of h_sizer can be more. and randomize. I am not sure this way is more efficient than using wx.GridSizer.

···

On 14/10/2011 7:01 AM, 최원준 wrote:

On 14/10/2011 12:23 AM, 최원준 wrote:

                              On 13/10/2011 3:49 PM, Steven > > > > > > > Sproat wrote:
                                On 13/10/2011 > > > > > > > > 09:42, 최원준 wrote:
                                        On 13 October 2011 10:37, > > > > > > > > > > 최원준 <wonjunchoi001@gmail.com> > > > > > > > > > >                                             wrote:

Well you definiately do not need h_sizer2 - unless you are trying
to add a space. I think that you will find a grid sizer simpler to
code and it does have the advantage that if the size of the static
texts and or text controls differs then alignment will be neater,
you also probably don’t need the pos parameter in the text control,
use the sizer align flags instead.

Gadget/Steve
···

wxPython-users+unsubscribe@googlegroups.com
http://groups.google.com/group/wxPython-users?hl=en

2011년 10월 14일 오후 4:43, Gadget/Steve GadgetSteve@live.co.uk님의 말:

2011년 10월 14일 오후 4:11, 최원준 wonjunchoi001@gmail.com
의 말:

2011년 10월 14일 오후 4:07, Gadget/Steve GadgetSteve@live.co.uk
의 말:

                    2011년 10월 14일 오후 2:33,

최원준 wonjunchoi001@gmail.com
의 말:

                        2011년 10월 14일 오후

2:22, Gadget/Steve GadgetSteve@live.co.uk
의 말:

                                        I think when I create new

message in mailing list, and
when I reply to any issue,
it posts to top.

                                        2011년

10월 14일 오전 12:21,
Gadget/Steve GadgetSteve@live.co.uk
의 말:

                                                    On

13/10/2011
09:42, 최원준
wrote:

                                                      I

didn’t intend
to post to
top. sorry.
and thank you.

                                                      2011/10/13

Andrea Gavana
andrea.gavana@gmail.com

                                                      as you see in

the
screenshot,
the parent of
textctrl has
label. I am
not sure what
control can be
this in
wxpython.

                                                      could you let

me know what
is this?

                                                      No

special
control, is a
wx.StaticText
(for the
label) beside
a wx.TextCtrl,
both of them
in an
horizontal
wx.BoxSizer.
Please do not
top-post your
replies.

                                                      Andrea.
                                                    you just did :)
-- Steven Sproat, BSc
[http://www.whyteboard.org/](http://www.whyteboard.org/)

                                                    To unsubscribe,

send email to wxPython-users+unsubscribe@googlegroups.com

                                                    or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                                              Just to clarify, in

case the terminology
may be unfamiliar to
some, top posting is
writing a reply with
the new text above
that of the question,
bottom posting is
writing with the new
text after the
question - like this.
The general preference
in this newsgroup,
(and many others), is
bottom posting as you
can read the whole
conversation in the
latest message.

                                                To unsubscribe, send

email to wxPython-users+unsubscribe@googlegroups.com

                                                or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                                        --

                                        To unsubscribe, send email

to wxPython-users+unsubscribe@googlegroups.com

                                        or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                                    Unless you are using a **very**
                                    unusual client you just need to

scroll to the bottom and click
there before you start typing -
almost all mail clients will let
you do that - some, like
Thunderbird, you can set this as
the default. On windows
machines you should be able to
press ctrl-end to get to the end
of the message.

                                      Gadget/Steve

                                      To unsubscribe, send email to

wxPython-users+unsubscribe@googlegroups.com

                                      or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                          thank you for the tip!
                      I made wx.BoxSizer and StaticText and

TextCtrl.

                              self.h_sizer2 =

wx.BoxSizer(wx.HORIZONTAL)

                              self.text2 = wx.StaticText(self,

label=“F”, pos=(0,50))

                              self.text = wx.StaticText(self,

label=“F”, pos=(50,50))

                              self.edit2 = wx.TextCtrl(self,

size=wx.Size(0, -1), pos=(100,50),
style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER)

                              self.h_sizer2.Add(self.text2, 0,)

                              self.h_sizer2.Add(self.edit2, 1,)

                              self.SetSizer(self.h_sizer2)





                      but I want to make more than one StaticText +

TextCtrl in BoxSizer.

                      how can I do this?





                      --

                      To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

                      or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                Just create and add as many static texts and text

controls as you need, if you would like them laid
out as:

                    Static    Ctrl

                    Static    Ctrl

                then you will need to change from a Box sizer to a

Grid sizer.

                  Gadget/Steve

                  To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

                  or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
      should I use Grid sizer? what about this?



              v_sizer = wx.BoxSizer(wx.VERTICAL)

             

                h_sizer = wx.BoxSizer(wx.HORIZONTAL)

                h_sizer2 = wx.BoxSizer(wx.HORIZONTAL)

                     

               self.text = wx.StaticText(self, label="F")

               self.edit = wx.TextCtrl(self, size=wx.Size(100, -1),

pos=(100,50), style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER)

               h_sizer.Add(self.text, 0,)

               h_sizer.Add(self.edit, 1)

                     

               v_sizer.Add(h_sizer)

               v_sizer.Add(h_sizer2)

                 

              self.SetSizer(v_sizer)
  the count of h_sizer can be more. and randomize. I am not sure

this way is more efficient than using wx.GridSizer.

  --

  To unsubscribe, send email to

wxPython-users+unsubscribe@googlegroups.com

  or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
Well you definiately do not need h_sizer2 - unless  you are trying

to add a space. I think that you will find a grid sizer simpler to
code and it does have the advantage that if the size of the static
texts and or text controls differs then alignment will be neater,
you also probably don’t need the pos parameter in the text control,
use the sizer align flags instead.

Gadget/Steve

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

I have checked some grid sizer example as you recomended me. and I am not sure this way is right.

when I had resized the form, the size of text control couldn’t be resized.
and I like to set textctrl width as same as main panel’s width.

and I wonder I can delete the specific textctrl in Grid sizer.

class combinePanel(wx.Panel):
def init(self, parent, ID=-1, label=“”,
pos=wx.DefaultPosition, size=(200, 25)):
wx.Panel.init(self, parent, ID, pos, size,

                      wx.NO_BORDER, label)

    self.label = label
    self.text = wx.StaticText(self, label="F")
    self.edit = wx.TextCtrl(self, pos = (10, -1), style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER)

class TestFrame(wx.Frame):
def init(self):
wx.Frame.init(self, None, -1, “Resizing Flex Grid Sizer”)
sizer = wx.FlexGridSizer(rows=9, cols=1, hgap=0, vgap=0)
for label in labels:

        bw = combinePanel(self, label=label)
        sizer.Add(bw, 0, wx.ALIGN_TOP)
    sizer.
    self.SetSizer(sizer)
    self.Fit()
···

On 14/10/2011 8:15 AM, 최원준 wrote:

                On 14/10/2011 > > > > 7:01 AM, 최원준 wrote:
                                      On 14/10/2011 12:23 AM, > > > > > > > 최원준 wrote:
                                                  On 13/10/2011 > > > > > > > > > 3:49 PM, Steven > > > > > > > > > Sproat wrote:
                                                      On 13 > > > > > > > > > > > > October 2011 > > > > > > > > > > > > 10:37, 최원준 <wonjunchoi001@gmail.com> > > > > > > > > > > > >                                                           wrote:

If you are using a grid and would like the text control growable
then don’t use the combine panel, have 2 cols and add the static
text to col 0 with a proportion of 0 and the text control to col 1
with a proportion of 1 and the expand flag.

···

wxPython-users+unsubscribe@googlegroups.com
http://groups.google.com/group/wxPython-users?hl=en

2011년 10월 14일 오후 5:50, Gadget/Steve GadgetSteve@live.co.uk님의 말:

2011년 10월 14일 오후 4:43, Gadget/Steve GadgetSteve@live.co.uk
의 말:

2011년 10월 14일 오후 4:11, 최원준 wonjunchoi001@gmail.com
의 말:

                2011년 10월 14일 오후 4:07,

Gadget/Steve GadgetSteve@live.co.uk
의 말:

                            On

14/10/2011 7:01 AM, 최원준 wrote:

                                2011년 10월 14일

오후 2:33, 최원준 wonjunchoi001@gmail.com
의 말:

                                    2011년 10월

14일 오후 2:22, Gadget/Steve GadgetSteve@live.co.uk
의 말:

                                                    I think when

I create new
message in
mailing list,
and when I reply
to any issue,
it posts to top.

                                                    2011

년 10월 14일 오전
12:21,
Gadget/Steve GadgetSteve@live.co.uk
의 말:

                                                      On

13/10/2011
3:49 PM,
Steven Sproat
wrote:

                                                      I

didn’t intend
to post to
top. sorry.
and thank you.

                                                      2011/10/13

Andrea Gavana
andrea.gavana@gmail.com

                                                      as you see in

the
screenshot,
the parent of
textctrl has
label. I am
not sure what
control can be
this in
wxpython.

                                                      could you let

me know what
is this?

                                                      No

special
control, is a
wx.StaticText
(for the
label) beside
a wx.TextCtrl,
both of them
in an
horizontal
wx.BoxSizer.
Please do not
top-post your
replies.

                                                      Andrea.
                                                      you just did

:slight_smile:

-- Steven Sproat, BSc
[http://www.whyteboard.org/](http://www.whyteboard.org/)

                                                      To

unsubscribe,
send email to
wxPython-users+unsubscribe@googlegroups.com

                                                      or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                                                      Just to

clarify, in
case the
terminology
may be
unfamiliar to
some, top
posting is
writing a
reply with the
new text above
that of the
question,
bottom posting
is writing
with the new
text after the
question -
like this.
The general
preference in
this
newsgroup,
(and many
others), is
bottom posting
as you can
read the whole
conversation
in the latest
message.

                                                      To

unsubscribe,
send email to
wxPython-users+unsubscribe@googlegroups.com

                                                      or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                                                    --

                                                    To unsubscribe,

send email to wxPython-users+unsubscribe@googlegroups.com

                                                    or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                                                Unless you are using

a very
unusual client you
just need to scroll
to the bottom and
click there before
you start typing -
almost all mail
clients will let you
do that - some, like
Thunderbird, you can
set this as the
default. On windows
machines you should
be able to press
ctrl-end to get to
the end of the
message.

                                                  Gadget/Steve

                                                  To unsubscribe,

send email to wxPython-users+unsubscribe@googlegroups.com

                                                  or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                                      thank you for the tip!
                                  I made wx.BoxSizer and StaticText

and TextCtrl.

                                          self.h_sizer2 =

wx.BoxSizer(wx.HORIZONTAL)

                                          self.text2 =

wx.StaticText(self, label=“F”,
pos=(0,50))

                                          self.text =

wx.StaticText(self, label=“F”,
pos=(50,50))

                                          self.edit2 =

wx.TextCtrl(self, size=wx.Size(0,
-1), pos=(100,50),
style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER)

self.h_sizer2.Add(self.text2, 0,)

self.h_sizer2.Add(self.edit2, 1,)

self.SetSizer(self.h_sizer2)

                                  but I want to make more than one

StaticText + TextCtrl in BoxSizer.

                                  how can I do this?





                                  --

                                  To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

                                  or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                            Just create and add as many static texts

and text controls as you need, if you
would like them laid out as:

                                Static    Ctrl

                                Static    Ctrl

                            then you will need to change from a Box

sizer to a Grid sizer.

                              Gadget/Steve

                              To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

                              or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                  should I use Grid sizer? what about this?



                          v_sizer = wx.BoxSizer(wx.VERTICAL)

                         

                            h_sizer = wx.BoxSizer(wx.HORIZONTAL)

                            h_sizer2 = wx.BoxSizer(wx.HORIZONTAL)

                                 

                           self.text = wx.StaticText(self,

label=“F”)

                           self.edit = wx.TextCtrl(self,

size=wx.Size(100, -1), pos=(100,50),
style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER)

                           h_sizer.Add(self.text, 0,)

                           h_sizer.Add(self.edit, 1)

                                 

                           v_sizer.Add(h_sizer)

                           v_sizer.Add(h_sizer2)

                             

                          self.SetSizer(v_sizer)
              the count of h_sizer can be more. and

randomize. I am not sure this way is more efficient
than using wx.GridSizer.

              --

              To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

              or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
        Well you definiately do not need h_sizer2 - unless  you are

trying to add a space. I think that you will find a grid
sizer simpler to code and it does have the advantage that if
the size of the static texts and or text controls differs
then alignment will be neater, you also probably don’t need
the pos parameter in the text control, use the sizer align
flags instead.

          Gadget/Steve

          To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

          or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
  I have checked some grid sizer example as you recomended me. and I

am not sure this way is right.

  when I had resized the form, the size of text control couldn't be

resized.

  and I like to set textctrl width as same as main panel's width.



  and I wonder I can delete the specific textctrl in Grid sizer.





  class combinePanel(wx.Panel):

      def __init__(self, parent, ID=-1, label="",

                   pos=wx.DefaultPosition, size=(200, 25)):

          wx.Panel.__init__(self, parent, ID, pos, size,

                            wx.NO_BORDER, label)



          self.label = label

          self.text = wx.StaticText(self, label="F")

          self.edit = wx.TextCtrl(self, pos = (10, -1),

style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER)

  class TestFrame(wx.Frame):

      def __init__(self):

          wx.Frame.__init__(self, None, -1, "Resizing Flex Grid

Sizer")

          sizer = wx.FlexGridSizer(rows=9, cols=1, hgap=0, vgap=0)

          for label in labels:

              bw = combinePanel(self, label=label)

              sizer.Add(bw, 0, wx.ALIGN_TOP)

          sizer.

          self.SetSizer(sizer)

          self.Fit()

  --

  To unsubscribe, send email to

wxPython-users+unsubscribe@googlegroups.com

  or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
If you are using a grid and would like the text control growable

then don’t use the combine panel, have 2 cols and add the static
text to col 0 with a proportion of 0 and the text control to col 1
with a proportion of 1 and the expand flag.

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

Do you mean like this? but it’s not working.

class TestFrame(wx.Frame):
def init(self):
wx.Frame.init(self, None, -1, “Resizing Flex Grid Sizer”)
sizer = wx.FlexGridSizer(rows=9, cols=1, hgap=0, vgap=0)

    self.text = wx.StaticText(self, label="F")
    self.edit = wx.TextCtrl(self, pos = (10, -1), style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER)
   
    for label in labels:
        sizer.Add(self.text, 0,)

        sizer.Add(self.edit, 1)

    self.SetSizer(sizer)
    self.Fit()
···

On 14/10/2011 9:32 AM, 최원준 wrote:

        On 14/10/2011 8:15 AM, > > > 최원준 wrote:
                                                  On 14/10/2011 > > > > > > > > > 12:23 AM, 최원준 > > > > > > > > > wrote:
                                                      On 13/10/2011 > > > > > > > > > > > > 09:42, 최원준 > > > > > > > > > > > > wrote:
                                                      On 13 > > > > > > > > > > > > > > October 2011 > > > > > > > > > > > > > > 10:37, 최원준 <wonjunchoi001@gmail.com> > > > > > > > > > > > > > >                                                           wrote:

The problem with the above is you only have 1 col, 1 text and one
text control.

try:

class TestFrame(wx.Frame):

    def __init__(self):

        sizer = wx.FlexGridSizer(rows=1, cols=2)

        sizer.SetFlexibleDirection(wx.VERTICAL)

        self.texts = []

        self.edits= []

        for label in labels:

            t=wx.StaticText(self, label=label)

            e=wx.TextCtrl(self,

style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER)

            self.texts.append(t)

            self.edits.append(e)

            sizer,Add(t,0)

            sizer.Add(e,1)

        self.SetSizer(sizer)

        self.Fit()
···

wxPython-users+unsubscribe@googlegroups.com
http://groups.google.com/group/wxPython-users?hl=en

2011년 10월 14일 오후 6:33, Gadget/Steve GadgetSteve@live.co.uk님의 말:

···

On 14/10/2011 10:02 AM, 최원준 wrote:

2011년 10월 14일 오후 5:50, Gadget/Steve GadgetSteve@live.co.uk
의 말:

        On 14/10/2011 9:32 AM, > > > 최원준 wrote:
            2011년 10월 14일 오후 4:43,

Gadget/Steve GadgetSteve@live.co.uk
의 말:

On 14/10/2011 8:15 AM, 최원준 wrote:

2011년 10월 14일 오후 4:11, 최원준 wonjunchoi001@gmail.com
의 말:

                          2011년 10월 14일 오후 4:07,

Gadget/Steve GadgetSteve@live.co.uk
의 말:

                                      On 14/10/2011 > > > > > > > > 7:01 AM, 최원준 wrote:
                                          2011년 10월

14일 오후 2:33, 최원준 wonjunchoi001@gmail.com
의 말:

                                              2011년

10월 14일 오후 2:22,
Gadget/Steve GadgetSteve@live.co.uk
의 말:

                                                      On

14/10/2011
12:23 AM, 최원준
wrote:

                                                      I think

when I create
new message in
mailing list,
and when I
reply to any
issue, it
posts to top.

                                                      2011

년 10월 14일 오전
12:21,
Gadget/Steve GadgetSteve@live.co.uk
의 말:

                                                      On

13/10/2011
3:49 PM,
Steven Sproat
wrote:

                                                      On 13/10/2011 > > > > > > > > > > > > > > 09:42, 최원준 > > > > > > > > > > > > > > wrote:
                                                      I

didn’t intend
to post to
top. sorry.
and thank you.

                                                      2011/10/13

Andrea Gavana
andrea.gavana@gmail.com

                                                      On 13 > > > > > > > > > > > > > > > > October 2011 > > > > > > > > > > > > > > > > 10:37, 최원준 <wonjunchoi001@gmail.com> > > > > > > > > > > > > > > > >                                                           wrote:
                                                      as you see in

the
screenshot,
the parent of
textctrl has
label. I am
not sure what
control can be
this in
wxpython.

                                                      could you let

me know what
is this?

                                                      No

special
control, is a
wx.StaticText
(for the
label) beside
a wx.TextCtrl,
both of them
in an
horizontal
wx.BoxSizer.
Please do not
top-post your
replies.

                                                      Andrea.
                                                      you just did

:slight_smile:

-- Steven Sproat, BSc
[http://www.whyteboard.org/](http://www.whyteboard.org/)

                                                      To

unsubscribe,
send email to
wxPython-users+unsubscribe@googlegroups.com

                                                      or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                                                      Just to

clarify, in
case the
terminology
may be
unfamiliar to
some, top
posting is
writing a
reply with the
new text above
that of the
question,
bottom posting
is writing
with the new
text after the
question -
like this.
The general
preference in
this
newsgroup,
(and many
others), is
bottom posting
as you can
read the whole
conversation
in the latest
message.

                                                      To

unsubscribe,
send email to
wxPython-users+unsubscribe@googlegroups.com

                                                      or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                                                      --

                                                      To

unsubscribe,
send email to
wxPython-users+unsubscribe@googlegroups.com

                                                      or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                                                      Unless you are

using a very
unusual client
you just need
to scroll to
the bottom and
click there
before you
start typing -
almost all
mail clients
will let you
do that -
some, like
Thunderbird,
you can set
this as the
default. On
windows
machines you
should be able
to press
ctrl-end to
get to the end
of the
message.

                                                      Gadget/Steve

                                                      To

unsubscribe,
send email to
wxPython-users+unsubscribe@googlegroups.com

                                                      or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                                                  thank you for the

tip!

                                              I made wx.BoxSizer and

StaticText and
TextCtrl.

                                                      self.h_sizer2

=
wx.BoxSizer(wx.HORIZONTAL)

                                                      self.text2 =

wx.StaticText(self,
label=“F”, pos=(0,50))

                                                      self.text =

wx.StaticText(self,
label=“F”,
pos=(50,50))

                                                      self.edit2 =

wx.TextCtrl(self,
size=wx.Size(0, -1),
pos=(100,50),
style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER)

self.h_sizer2.Add(self.text2,
0,)

self.h_sizer2.Add(self.edit2,
1,)

self.SetSizer(self.h_sizer2)

                                              but I want to make

more than one
StaticText + TextCtrl
in BoxSizer.

                                              how can I do this?





                                              --

                                              To unsubscribe, send

email to wxPython-users+unsubscribe@googlegroups.com

                                              or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                                        Just create

and add as many static texts
and text controls as you
need, if you would like them
laid out as:

                                            Static    Ctrl

                                            Static    Ctrl

                                        then you will need to change

from a Box sizer to a Grid
sizer.

                                          Gadget/Steve

                                          To unsubscribe, send email

to wxPython-users+unsubscribe@googlegroups.com

                                          or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                              should I use Grid sizer? what about

this?

                                      v_sizer =

wx.BoxSizer(wx.VERTICAL)

                                        h_sizer =

wx.BoxSizer(wx.HORIZONTAL)

                                        h_sizer2 =

wx.BoxSizer(wx.HORIZONTAL)

                                       self.text =

wx.StaticText(self, label=“F”)

                                       self.edit = wx.TextCtrl(self,

size=wx.Size(100, -1), pos=(100,50),
style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER)

                                       h_sizer.Add(self.text, 0,)

                                       h_sizer.Add(self.edit, 1)

                                             

                                       v_sizer.Add(h_sizer)

                                       v_sizer.Add(h_sizer2)

                                         

                                      self.SetSizer(v_sizer)
                          the count of h_sizer can be more. and

randomize. I am not sure this way is more
efficient than using wx.GridSizer.

                          --

                          To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

                          or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                    Well you definiately do not need

h_sizer2 - unless you are trying to add a
space. I think that you will find a grid sizer
simpler to code and it does have the advantage
that if the size of the static texts and or text
controls differs then alignment will be neater,
you also probably don’t need the pos parameter
in the text control, use the sizer align flags
instead.

                      Gadget/Steve

                      To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

                      or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
              I have checked some grid sizer example as you

recomended me. and I am not sure this way is right.

              when I had resized the form, the size of text control

couldn’t be resized.

              and I like to set textctrl width as same as main

panel’s width.

              and I wonder I can delete the specific textctrl in

Grid sizer.

              class combinePanel(wx.Panel):

                  def __init__(self, parent, ID=-1, label="",

                               pos=wx.DefaultPosition, size=(200,

25)):

                      wx.Panel.__init__(self, parent, ID, pos, size,

                                        wx.NO_BORDER, label)



                      self.label = label

                      self.text = wx.StaticText(self, label="F")

                      self.edit = wx.TextCtrl(self, pos = (10, -1),

style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER)

              class TestFrame(wx.Frame):

                  def __init__(self):

                      wx.Frame.__init__(self, None, -1, "Resizing

Flex Grid Sizer")

                      sizer = wx.FlexGridSizer(rows=9, cols=1,

hgap=0, vgap=0)

                      for label in labels:

                          bw = combinePanel(self, label=label)

                          sizer.Add(bw, 0, wx.ALIGN_TOP)

                      sizer.

                      self.SetSizer(sizer)

                      self.Fit()

              --

              To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

              or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
        If you are using a grid and would like the text control

growable then don’t use the combine panel, have 2 cols and
add the static text to col 0 with a proportion of 0 and the
text control to col 1 with a proportion of 1 and the expand
flag.

          To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

          or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
  Do you mean like this? but it's not working.





  class TestFrame(wx.Frame):

      def __init__(self):

          wx.Frame.__init__(self, None, -1, "Resizing Flex Grid

Sizer")

          sizer = wx.FlexGridSizer(rows=9, cols=1, hgap=0, vgap=0)

         

          self.text = wx.StaticText(self, label="F")

          self.edit = wx.TextCtrl(self, pos = (10, -1),

style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER)

          for label in labels:

              sizer.Add(self.text, 0,)

              sizer.Add(self.edit, 1)



          self.SetSizer(sizer)

          self.Fit()

  --

  To unsubscribe, send email to

wxPython-users+unsubscribe@googlegroups.com

  or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
The problem with the above is you only have 1 col, 1 text and one

text control.

try:

class TestFrame(wx.Frame):

    def __init__(self):

        sizer = wx.FlexGridSizer(rows=1, cols=2)

        sizer.SetFlexibleDirection(wx.VERTICAL)

        self.texts = []

        self.edits= []

        for label in labels:

            t=wx.StaticText(self, label=label)

            e=wx.TextCtrl(self,

style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER)

            self.texts.append(t)

            self.edits.append(e)

            sizer,Add(t,0)

            sizer.Add(e,1)

        self.SetSizer(sizer)

        self.Fit()

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

it works fine.
btw, when I resize the frame, the textctrl is not grow as same as frame.

and I wonder whether I can put t, e in specific index, or delete the specific index control.
for example, sizer.RemovePos(3) or, self.texts.insert(t, e)

Just add a line either before the for loop or after the end of the
loop and before the self.Fit reading sizer.AddGrowableCol(1,1)

Gadget/Steve
···

wxPython-users+unsubscribe@googlegroups.com
http://groups.google.com/group/wxPython-users?hl=en

2011년 10월 17일 오전 2:24, Gadget/Steve GadgetSteve@live.co.uk님의 말:

2011년 10월 14일 오후 6:33, Gadget/Steve GadgetSteve@live.co.uk
의 말:

            2011년 10월 14일 오후 5:50,

Gadget/Steve GadgetSteve@live.co.uk
의 말:

                    On

14/10/2011 9:32 AM, 최원준 wrote:

                        2011년 10월 14일 오후

4:43, Gadget/Steve GadgetSteve@live.co.uk
의 말:

2011년 10월 14일 오후 4:11, 최원준 wonjunchoi001@gmail.com
의 말:

                                      2011년 10월 14일 오후 4:07,

Gadget/Steve GadgetSteve@live.co.uk
의 말:

                                                      2011년 10월

14일 오후 2:33,
최원준 wonjunchoi001@gmail.com
의 말:

                                                      2011년 10월

14일 오후 2:22,
Gadget/Steve GadgetSteve@live.co.uk
의 말:

                                                      On

14/10/2011
12:23 AM, 최원준
wrote:

                                                      I think

when I create
new message in
mailing list,
and when I
reply to any
issue, it
posts to top.

                                                      2011

년 10월 14일 오전
12:21,
Gadget/Steve GadgetSteve@live.co.uk
의 말:

                                                      On

13/10/2011
3:49 PM,
Steven Sproat
wrote:

                                                      I

didn’t intend
to post to
top. sorry.
and thank you.

                                                      2011/10/13

Andrea Gavana
andrea.gavana@gmail.com

                                                      as you see in

the
screenshot,
the parent of
textctrl has
label. I am
not sure what
control can be
this in
wxpython.

                                                      could you let

me know what
is this?

                                                      No

special
control, is a
wx.StaticText
(for the
label) beside
a wx.TextCtrl,
both of them
in an
horizontal
wx.BoxSizer.
Please do not
top-post your
replies.

                                                      Andrea.
                                                      you just did

:slight_smile:

-- Steven Sproat, BSc
[http://www.whyteboard.org/](http://www.whyteboard.org/)

                                                      To

unsubscribe,
send email to
wxPython-users+unsubscribe@googlegroups.com

                                                      or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                                                      Just to

clarify, in
case the
terminology
may be
unfamiliar to
some, top
posting is
writing a
reply with the
new text above
that of the
question,
bottom posting
is writing
with the new
text after the
question -
like this.
The general
preference in
this
newsgroup,
(and many
others), is
bottom posting
as you can
read the whole
conversation
in the latest
message.

                                                      To

unsubscribe,
send email to
wxPython-users+unsubscribe@googlegroups.com

                                                      or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                                                      --

                                                      To

unsubscribe,
send email to
wxPython-users+unsubscribe@googlegroups.com

                                                      or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                                                      Unless you are

using a very
unusual client
you just need
to scroll to
the bottom and
click there
before you
start typing -
almost all
mail clients
will let you
do that -
some, like
Thunderbird,
you can set
this as the
default. On
windows
machines you
should be able
to press
ctrl-end to
get to the end
of the
message.

                                                      Gadget/Steve

                                                      To

unsubscribe,
send email to
wxPython-users+unsubscribe@googlegroups.com

                                                      or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                                                      thank you for

the tip!

                                                      I made

wx.BoxSizer
and StaticText
and TextCtrl.

self.h_sizer2

wx.BoxSizer(wx.HORIZONTAL)

self.text2 =
wx.StaticText(self,
label=“F”,
pos=(0,50))

self.text =
wx.StaticText(self,
label=“F”,
pos=(50,50))

self.edit2 =
wx.TextCtrl(self,
size=wx.Size(0,
-1),
pos=(100,50),
style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER)

self.h_sizer2.Add(self.text2,
0,)

self.h_sizer2.Add(self.edit2,
1,)

self.SetSizer(self.h_sizer2)

                                                      but I want to

make more than
one StaticText

  • TextCtrl in
    BoxSizer.

                                                        how can I do
    

this?

                                                      --

                                                      To

unsubscribe,
send email to
wxPython-users+unsubscribe@googlegroups.com

                                                      or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                                                    Just create

and add as many
static texts and
text controls as
you need, if you
would like them
laid out as:

                                                        Static   

Ctrl

                                                        Static   

Ctrl

                                                    then you will

need to change
from a Box sizer
to a Grid sizer.

                                                      Gadget/Steve

                                                      To

unsubscribe,
send email to
wxPython-users+unsubscribe@googlegroups.com

                                                      or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                                          should I use Grid sizer?

what about this?

                                                  v_sizer =

wx.BoxSizer(wx.VERTICAL)

                                                    h_sizer =

wx.BoxSizer(wx.HORIZONTAL)

                                                    h_sizer2 =

wx.BoxSizer(wx.HORIZONTAL)

                                                   self.text =

wx.StaticText(self,
label=“F”)

                                                   self.edit =

wx.TextCtrl(self,
size=wx.Size(100, -1),
pos=(100,50),
style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER)

h_sizer.Add(self.text, 0,)

h_sizer.Add(self.edit, 1)

v_sizer.Add(h_sizer)

v_sizer.Add(h_sizer2)

self.SetSizer(v_sizer)

                                      the count of h_sizer can

be more. and randomize. I am
not sure this way is more
efficient than using
wx.GridSizer.

                                      --

                                      To unsubscribe, send email to

wxPython-users+unsubscribe@googlegroups.com

                                      or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                                Well you definiately do not need

h_sizer2 - unless you are trying to
add a space. I think that you will
find a grid sizer simpler to code
and it does have the advantage that
if the size of the static texts and
or text controls differs then
alignment will be neater, you also
probably don’t need the pos
parameter in the text control, use
the sizer align flags instead.

                                  Gadget/Steve

                                  To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

                                  or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                          I have checked some grid sizer example as

you recomended me. and I am not sure this
way is right.

                          when I had resized the form, the size of

text control couldn’t be resized.

                          and I like to set textctrl width as same

as main panel’s width.

                          and I wonder I can delete the specific

textctrl in Grid sizer.

                          class combinePanel(wx.Panel):

                              def __init__(self, parent, ID=-1,

label=“”,

                                           pos=wx.DefaultPosition,

size=(200, 25)):

                                  wx.Panel.__init__(self, parent,

ID, pos, size,

                                                    wx.NO_BORDER,

label)

                                  self.label = label

                                  self.text = wx.StaticText(self,

label=“F”)

                                  self.edit = wx.TextCtrl(self, pos

= (10, -1),
style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER)

                          class TestFrame(wx.Frame):

                              def __init__(self):

                                  wx.Frame.__init__(self, None, -1,

“Resizing Flex Grid Sizer”)

                                  sizer = wx.FlexGridSizer(rows=9,

cols=1, hgap=0, vgap=0)

                                  for label in labels:

                                      bw = combinePanel(self,

label=label)

                                      sizer.Add(bw, 0, wx.ALIGN_TOP)

                                  sizer.

                                  self.SetSizer(sizer)

                                  self.Fit()

                          --

                          To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

                          or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                    If you are using a grid and would like the text

control growable then don’t use the combine
panel, have 2 cols and add the static text to
col 0 with a proportion of 0 and the text
control to col 1 with a proportion of 1 and the
expand flag.

                      To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

                      or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
              Do you mean like this? but it's not working.





              class TestFrame(wx.Frame):

                  def __init__(self):

                      wx.Frame.__init__(self, None, -1, "Resizing

Flex Grid Sizer")

                      sizer = wx.FlexGridSizer(rows=9, cols=1,

hgap=0, vgap=0)

                      self.text = wx.StaticText(self, label="F")

                      self.edit = wx.TextCtrl(self, pos = (10, -1),

style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER)

                      for label in labels:

                          sizer.Add(self.text, 0,)

                          sizer.Add(self.edit, 1)



                      self.SetSizer(sizer)

                      self.Fit()

              --

              To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

              or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
        The problem with the above is you only have 1 col, 1 text

and one text control.

        try:

        class TestFrame(wx.Frame):

            def __init__(self):

                sizer = wx.FlexGridSizer(rows=1, cols=2)

                sizer.SetFlexibleDirection(wx.VERTICAL)

                self.texts = []

                self.edits= []

                for label in labels:

                    t=wx.StaticText(self, label=label)

                    e=wx.TextCtrl(self,

style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER)

                    self.texts.append(t)

                    self.edits.append(e)

                    sizer,Add(t,0)

                    sizer.Add(e,1)

                self.SetSizer(sizer)

                self.Fit()

          To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

          or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
  it works fine.

  btw, when I resize the frame, the textctrl is not grow as same as

frame.

  and I wonder whether I can put t, e in specific index, or delete

the specific index control.

  for example, sizer.RemovePos(3) or, self.texts.insert(t, e)





  --

  To unsubscribe, send email to

wxPython-users+unsubscribe@googlegroups.com

  or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
Just add a line either before the for loop or after the end of the

loop and before the self.Fit reading sizer.AddGrowableCol(1,1)

Gadget/Steve

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

I’m not sure if this is possible. I create a button to add row(statictext + textctrl)

when I click the button, it creates a row but the size is not good as you can see in bad.png.
I would like to do as need_to.png. could you recommend a good way for this?

class TestFrame(wx.Frame):
def init(self):

    wx.Frame.__init__(self, None, -1, "Resizing Flex Grid Sizer")

    self.Autosizer = wx.FlexGridSizer(rows=1, cols=2)
    self.Autosizer.SetFlexibleDirection(wx.VERTICAL)
    self.texts = []

    self.edits= []
    for label in labels:
    t=wx.StaticText(self, label='P')
    e=wx.TextCtrl(self, style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER)
    self.texts.append(t)
    self.edits.append(e)

    self.Autosizer.Add(t,0)
    self.Autosizer.Add(e,1, wx.EXPAND)
    self.Autosizer.AddGrowableCol(1, 1) # 2 col
    self.SetSizer(self.Autosizer)
    self.Fit()

    b = wx.Button(self, 40, "Button")

    self.Bind(wx.EVT_BUTTON, self.OnClick, b)
   
def OnClick(self, event):
    t=wx.StaticText(self, label='F')
    e=wx.TextCtrl(self, style=wx.TE_MULTILINE)
    self.texts.append(t)

    self.edits.append(e)
    self.Autosizer.Add(t,0)
    self.Autosizer.Add(e,1, wx.EXPAND)

···

On 16/10/2011 1:56 PM, 최원준 wrote:

        On 14/10/2011 10:02 AM, > > > 최원준 wrote:

On 14/10/2011 8:15 AM, 최원준 wrote:

                                                  On 14/10/2011 > > > > > > > > > > 7:01 AM, 최원준 > > > > > > > > > > wrote:
                                                      On 13/10/2011 > > > > > > > > > > > > > > > > 09:42, 최원준 > > > > > > > > > > > > > > > > wrote:
                                                      On 13 > > > > > > > > > > > > > > > > > > October 2011 > > > > > > > > > > > > > > > > > > 10:37, 최원준 <wonjunchoi001@gmail.com> > > > > > > > > > > > > > > > > > >                                                           wrote:

Both the button and the autosizer need to be children of a top level
sizer rather than autosizer being the top level sizer, then you need
to call a set minimum size on your text control or create it with
the size initially set to what you need. I the OnClick method I
think you will need to do a Layout or Fit to get force the size
update.

···

wxPython-users+unsubscribe@googlegroups.com
http://groups.google.com/group/wxPython-users?hl=en

2011년 10월 17일 오후 8:48, Gadget/Steve GadgetSteve@live.co.uk님의 말:

2011년 10월 17일 오전 2:24, Gadget/Steve GadgetSteve@live.co.uk
의 말:

            2011년 10월 14일 오후 6:33,

Gadget/Steve GadgetSteve@live.co.uk
의 말:

                    On

14/10/2011 10:02 AM, 최원준 wrote:

                        2011년 10월 14일 오후

5:50, Gadget/Steve GadgetSteve@live.co.uk
의 말:

                                    2011년 10월

14일 오후 4:43, Gadget/Steve GadgetSteve@live.co.uk
의 말:

                                              2011년 10월 14일 오후

4:11, 최원준 wonjunchoi001@gmail.com
의 말:

                                                  2011년 10월 14일

오후 4:07,
Gadget/Steve GadgetSteve@live.co.uk
의 말:

                                                      On

14/10/2011
7:01 AM, 최원준
wrote:

                                                      2011년 10월

14일 오후 2:33,
최원준 wonjunchoi001@gmail.com
의 말:

                                                      2011년 10월

14일 오후 2:22,
Gadget/Steve GadgetSteve@live.co.uk
의 말:

                                                      On

14/10/2011
12:23 AM, 최원준
wrote:

                                                      I think

when I create
new message in
mailing list,
and when I
reply to any
issue, it
posts to top.

                                                      2011

년 10월 14일 오전
12:21,
Gadget/Steve GadgetSteve@live.co.uk
의 말:

                                                      On

13/10/2011
3:49 PM,
Steven Sproat
wrote:

                                                      I

didn’t intend
to post to
top. sorry.
and thank you.

                                                      2011/10/13

Andrea Gavana
andrea.gavana@gmail.com

                                                      as you see in

the
screenshot,
the parent of
textctrl has
label. I am
not sure what
control can be
this in
wxpython.

                                                      could you let

me know what
is this?

                                                      No

special
control, is a
wx.StaticText
(for the
label) beside
a wx.TextCtrl,
both of them
in an
horizontal
wx.BoxSizer.
Please do not
top-post your
replies.

                                                      Andrea.
                                                      you just did

:slight_smile:

-- Steven Sproat, BSc
[http://www.whyteboard.org/](http://www.whyteboard.org/)

                                                      To

unsubscribe,
send email to
wxPython-users+unsubscribe@googlegroups.com

                                                      or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                                                      Just to

clarify, in
case the
terminology
may be
unfamiliar to
some, top
posting is
writing a
reply with the
new text above
that of the
question,
bottom posting
is writing
with the new
text after the
question -
like this.
The general
preference in
this
newsgroup,
(and many
others), is
bottom posting
as you can
read the whole
conversation
in the latest
message.

                                                      To

unsubscribe,
send email to
wxPython-users+unsubscribe@googlegroups.com

                                                      or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                                                      --

                                                      To

unsubscribe,
send email to
wxPython-users+unsubscribe@googlegroups.com

                                                      or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                                                      Unless you are

using a very
unusual client
you just need
to scroll to
the bottom and
click there
before you
start typing -
almost all
mail clients
will let you
do that -
some, like
Thunderbird,
you can set
this as the
default. On
windows
machines you
should be able
to press
ctrl-end to
get to the end
of the
message.

                                                      Gadget/Steve

                                                      To

unsubscribe,
send email to
wxPython-users+unsubscribe@googlegroups.com

                                                      or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                                                      thank you for

the tip!

                                                      I made

wx.BoxSizer
and StaticText
and TextCtrl.

self.h_sizer2

wx.BoxSizer(wx.HORIZONTAL)

self.text2 =
wx.StaticText(self,
label=“F”,
pos=(0,50))

self.text =
wx.StaticText(self,
label=“F”,
pos=(50,50))

self.edit2 =
wx.TextCtrl(self,
size=wx.Size(0,
-1),
pos=(100,50),
style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER)

self.h_sizer2.Add(self.text2,
0,)

self.h_sizer2.Add(self.edit2,
1,)

self.SetSizer(self.h_sizer2)

                                                      but I want to

make more than
one StaticText

  • TextCtrl in
    BoxSizer.

                                                        how can I do
    

this?

                                                      --

                                                      To

unsubscribe,
send email to
wxPython-users+unsubscribe@googlegroups.com

                                                      or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                                                      Just

create and add
as many static
texts and text
controls as
you need, if
you would like
them laid out
as:

                                                          Static   

Ctrl

                                                          Static   

Ctrl

                                                      then you will

need to change
from a Box
sizer to a
Grid sizer.

                                                      Gadget/Steve

                                                      To

unsubscribe,
send email to
wxPython-users+unsubscribe@googlegroups.com

                                                      or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                                                      should I use

Grid sizer?
what about
this?

v_sizer =
wx.BoxSizer(wx.VERTICAL)

h_sizer =
wx.BoxSizer(wx.HORIZONTAL)

h_sizer2 =
wx.BoxSizer(wx.HORIZONTAL)

self.text =
wx.StaticText(self,
label=“F”)

self.edit =
wx.TextCtrl(self,
size=wx.Size(100,
-1),
pos=(100,50),
style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER)

h_sizer.Add(self.text,
0,)

h_sizer.Add(self.edit,
1)

v_sizer.Add(h_sizer)

v_sizer.Add(h_sizer2)

self.SetSizer(v_sizer)

                                                  the count of

h_sizer can be
more. and
randomize. I am
not sure this way
is more efficient
than using
wx.GridSizer.

                                                  --

                                                  To unsubscribe,

send email to wxPython-users+unsubscribe@googlegroups.com

                                                  or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                                            Well you definiately

do not need h_sizer2 -
unless you are trying
to add a space. I think
that you will find a
grid sizer simpler to
code and it does have
the advantage that if
the size of the static
texts and or text
controls differs then
alignment will be
neater, you also
probably don’t need the
pos parameter in the
text control, use the
sizer align flags
instead.

                                              Gadget/Steve

                                              To unsubscribe, send

email to wxPython-users+unsubscribe@googlegroups.com

                                              or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                                      I have checked some grid sizer

example as you recomended me.
and I am not sure this way is
right.

                                      when I had resized the form,

the size of text control
couldn’t be resized.

                                      and I like to set textctrl

width as same as main panel’s
width.

                                      and I wonder I can delete the

specific textctrl in Grid
sizer.

                                      class combinePanel(wx.Panel):

                                          def __init__(self, parent,

ID=-1, label=“”,

pos=wx.DefaultPosition,
size=(200, 25)):

wx.Panel.init(self,
parent, ID, pos, size,

wx.NO_BORDER, label)

                                              self.label = label

                                              self.text =

wx.StaticText(self, label=“F”)

                                              self.edit =

wx.TextCtrl(self, pos = (10,
-1),
style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER)

                                      class TestFrame(wx.Frame):

                                          def __init__(self):

wx.Frame.init(self, None,
-1, “Resizing Flex Grid
Sizer”)

                                              sizer =

wx.FlexGridSizer(rows=9,
cols=1, hgap=0, vgap=0)

                                              for label in labels:

                                                  bw =

combinePanel(self,
label=label)

                                                  sizer.Add(bw, 0,

wx.ALIGN_TOP)

                                              sizer.

                                              self.SetSizer(sizer)

                                              self.Fit()

                                      --

                                      To unsubscribe, send email to

wxPython-users+unsubscribe@googlegroups.com

                                      or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                                If you are using a grid and would

like the text control growable then
don’t use the combine panel, have 2
cols and add the static text to col
0 with a proportion of 0 and the
text control to col 1 with a
proportion of 1 and the expand flag.

                                  To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

                                  or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                          Do you mean like this? but it's not

working.

                          class TestFrame(wx.Frame):

                              def __init__(self):

                                  wx.Frame.__init__(self, None, -1,

“Resizing Flex Grid Sizer”)

                                  sizer = wx.FlexGridSizer(rows=9,

cols=1, hgap=0, vgap=0)

                                  self.text = wx.StaticText(self,

label=“F”)

                                  self.edit = wx.TextCtrl(self, pos

= (10, -1),
style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER)

                                  for label in labels:

                                      sizer.Add(self.text, 0,)

                                      sizer.Add(self.edit, 1)



                                  self.SetSizer(sizer)

                                  self.Fit()

                          --

                          To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

                          or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
                    The problem with the above is you only have 1

col, 1 text and one text control.

                    try:

                    class TestFrame(wx.Frame):

                        def __init__(self):

                            sizer = wx.FlexGridSizer(rows=1, cols=2)

                            sizer.SetFlexibleDirection(wx.VERTICAL)

                            self.texts = []

                            self.edits= []

                            for label in labels:

                                t=wx.StaticText(self, label=label)

                                e=wx.TextCtrl(self,

style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER)

                                self.texts.append(t)

                                self.edits.append(e)

                                sizer,Add(t,0)

                                sizer.Add(e,1)

                            self.SetSizer(sizer)

                            self.Fit()

                      To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

                      or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
              it works fine.

              btw, when I resize the frame, the textctrl is not grow

as same as frame.

              and I wonder whether I can put t, e in specific index,

or delete the specific index control.

              for example, sizer.RemovePos(3) or,

self.texts.insert(t, e)

              --

              To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

              or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
        Just add a line either before the for loop or after the end

of the loop and before the self.Fit reading
sizer.AddGrowableCol(1,1)

          Gadget/Steve

          To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

          or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
  I'm not sure if this is possible. I create a button to add

row(statictext + textctrl)

  when I click the button, it creates a row but the size is not good

as you can see in bad.png.

  I would like to do as need_to.png. could you recommend a good way

for this?

  class TestFrame(wx.Frame):

      def __init__(self):

          wx.Frame.__init__(self, None, -1, "Resizing Flex Grid

Sizer")

          self.Autosizer = wx.FlexGridSizer(rows=1, cols=2)

          self.Autosizer.SetFlexibleDirection(wx.VERTICAL)

          self.texts = []

          self.edits= []

          for label in labels:

          t=wx.StaticText(self, label='P')

          e=wx.TextCtrl(self,

style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER)

          self.texts.append(t)

          self.edits.append(e)

          self.Autosizer.Add(t,0)

          self.Autosizer.Add(e,1, wx.EXPAND)

          self.Autosizer.AddGrowableCol(1, 1) # 2 col

          self.SetSizer(self.Autosizer)

          self.Fit()



          b = wx.Button(self, 40, "Button")

          self.Bind(wx.EVT_BUTTON, self.OnClick, b)

         

      def OnClick(self, event):

          t=wx.StaticText(self, label='F')

          e=wx.TextCtrl(self, style=wx.TE_MULTILINE)

          self.texts.append(t)

          self.edits.append(e)

          self.Autosizer.Add(t,0)

          self.Autosizer.Add(e,1, wx.EXPAND)

  --

  To unsubscribe, send email to

wxPython-users+unsubscribe@googlegroups.com

  or visit [http://groups.google.com/group/wxPython-users?hl=en](http://groups.google.com/group/wxPython-users?hl=en)
Both the button and the autosizer need to be children of a top level

sizer rather than autosizer being the top level sizer, then you need
to call a set minimum size on your text control or create it with
the size initially set to what you need. I the OnClick method I
think you will need to do a Layout or Fit to get force the size
update.

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

I am sorry I can't understand this part : Both the button and the autosizer need to be children of a top level

sizer rather than autosizer being the top level sizer, then you need
to call a set minimum size on your text control or create it with
the size initially set to what you need

but I coded like this. and used Layout() method. I could add (StaticText + STC) to sizer.
now, I am wondering I can delete some specific control(StaticText + STC) from the sizer.

so I found sizer.Remove() method. and I made some contextmenu for this.

here is my example code.(http://paste.pound-python.org/show/13874/) and more simple code is here (http://paste.pound-python.org/show/13873/)

the code structure : App → StcFrame → TestPanel → sizer(which is included STC) + STC(contextmenu)
I wanted to call the sizer in TestPanel from contextmenu as you can see line 52 in http://paste.pound-python.org/show/13873/

popmenu’s parent is STC and STC’s parent is Testpanel. and TestPanel has self.stc1 instance
I don’t know how to access self.stc1 from popmenu

self.parent.stc1.Destroy() or self.parent.parent.stc1.Destroy() didn’t work from popmenu.

PS: Sorry for asking repeatly.

Wonjun, Choi

···

On 17/10/2011 9:32 AM, 최원준 wrote:

        On 16/10/2011 1:56 PM, > > > 최원준 wrote:

On 14/10/2011 9:32 AM, 최원준 wrote:

                                          On 14/10/2011 8:15 AM, > > > > > > > > > 최원준 wrote:
                                                      On 13/10/2011 > > > > > > > > > > > > > > > > > > 09:42, 최원준 > > > > > > > > > > > > > > > > > > wrote:
                                                      On 13 > > > > > > > > > > > > > > > > > > > > October 2011 > > > > > > > > > > > > > > > > > > > > 10:37, 최원준 <wonjunchoi001@gmail.com> > > > > > > > > > > > > > > > > > > > >                                                           wrote:

popmenu's parent is STC and STC's parent is Testpanel. and TestPanel has
self.stc1 instance
I don't know how to access self.stc1 from popmenu
self.parent.stc1.Destroy() or self.parent.parent.stc1.Destroy() didn't work
from popmenu.

Do you understand why? If you have an object that is "self" (the
panel), if you just write "self.parent" Python has no idea what
"parent" is. But, if you define it first, like this:

self.parent = self.GetParent()

Then Python knows, "Oh, OK, self.parent is the parent of self."

Likewise, if you want the parent of the parent (the "grandparent"),
you could define that, too:

self.grandparent = self.GetParent().GetParent()

Or, it turns out that wxPython anticipated the need for this line,
with this method:

self.grandparent = self.GetGrandParent()

Usually you should be careful to not abuse this process. 1-2 levels
might be OK, but this is really bad coding style!:

distant_object = selfGetParent().GetParent().GetParent().GetParent().GetParent()

If it is starting to get like that, you should just use wx.lib.pubsub
to "broadcast" information to "distant" objects in your object
ecosystem.

Che

···

PS: Sorry for asking repeatly.

Wonjun, Choi

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

I could delete the item in Sizer.

self.parent.Getparent()
self.parent.panel.Autosizer.Remove(0)
self.parent.panel.Layout()

but should I know the index of STC which is needed to be deleted in Sizer?
Is there other way to delete a row(STC + StaticText) which is seleted by user in Sizer. actually there are in TestPanel.

···

2011/10/18 C M cmpython@gmail.com

popmenu’s parent is STC and STC’s parent is Testpanel. and TestPanel has

self.stc1 instance

I don’t know how to access self.stc1 from popmenu

self.parent.stc1.Destroy() or self.parent.parent.stc1.Destroy() didn’t work

from popmenu.

Do you understand why? If you have an object that is “self” (the

panel), if you just write “self.parent” Python has no idea what

“parent” is. But, if you define it first, like this:

self.parent = self.GetParent()

Then Python knows, “Oh, OK, self.parent is the parent of self.”

Likewise, if you want the parent of the parent (the “grandparent”),

you could define that, too:

self.grandparent = self.GetParent().GetParent()

Or, it turns out that wxPython anticipated the need for this line,

with this method:

self.grandparent = self.GetGrandParent()

Usually you should be careful to not abuse this process. 1-2 levels

might be OK, but this is really bad coding style!:

distant_object = selfGetParent().GetParent().GetParent().GetParent().GetParent()

If it is starting to get like that, you should just use wx.lib.pubsub

to “broadcast” information to “distant” objects in your object

ecosystem.

Che

PS: Sorry for asking repeatly.

Wonjun, Choi

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

I did like this.

self.stc1.SetId(wx.NewId())

self.parent.Autosizer.Remove(self.parent.stc1.GetId())
self.parent.Layout()

but it didn’t work.

···

2011/10/19 최원준 wonjunchoi001@gmail.com

2011/10/18 C M cmpython@gmail.com

popmenu’s parent is STC and STC’s parent is Testpanel. and TestPanel has

self.stc1 instance

I don’t know how to access self.stc1 from popmenu

self.parent.stc1.Destroy() or self.parent.parent.stc1.Destroy() didn’t work

from popmenu.

Do you understand why? If you have an object that is “self” (the

panel), if you just write “self.parent” Python has no idea what

“parent” is. But, if you define it first, like this:

self.parent = self.GetParent()

Then Python knows, “Oh, OK, self.parent is the parent of self.”

Likewise, if you want the parent of the parent (the “grandparent”),

you could define that, too:

self.grandparent = self.GetParent().GetParent()

Or, it turns out that wxPython anticipated the need for this line,

with this method:

self.grandparent = self.GetGrandParent()

Usually you should be careful to not abuse this process. 1-2 levels

might be OK, but this is really bad coding style!:

distant_object = selfGetParent().GetParent().GetParent().GetParent().GetParent()

If it is starting to get like that, you should just use wx.lib.pubsub

to “broadcast” information to “distant” objects in your object

ecosystem.

Che

PS: Sorry for asking repeatly.

Wonjun, Choi

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

I could delete the item in Sizer.

self.parent.Getparent()
self.parent.panel.Autosizer.Remove(0)
self.parent.panel.Layout()

but should I know the index of STC which is needed to be deleted in Sizer?
Is there other way to delete a row(STC + StaticText) which is seleted by user in Sizer. actually there are in TestPanel.

I did like this.

self.stc1.SetId(wx.NewId())

self.parent.Autosizer.Remove(self.parent.stc1.GetId())
self.parent.Layout()

but it didn't work.

In order to get much better help on this list, you need to explain WHY
something didn't work. There are various ways something doesn't work:

- It does nothing at all.
- It does something other than what you wanted it to do.
- An error is thrown.

So please let us know (and all times in the future) what the
*specific* problem is in this way.

One tip, though: Do you think these lines of yours should work?:

self.parent.Getparent()
self.parent.panel.Autosizer.Remove(0)

If not, why not? The point is, there is a fundamental point of Python
and programming generally that you are not seeing yet.

Che