[wxpython] Is there any control like this?

that’s right! it is not the window. if it is a window, can I use event.GetEventObject() to get stc object?

and I tested this. there was no error but it didn’t do anything.
self.parent.Autosizer.Detach(self.parent.text)
self.parent.Autosizer.Detach(self.parent.editor)

if I can use stc reference, I need to know the selected stc from the user.

but I am not sure how can I know the selected stc from the sizer.

and these controls are in notebook, when I click the add button, it append a row(staticText + STC) to Autosizer. but when I click tab2, it still add the row in tab1.

I don’t know why.

and when I want to delete the row, I need to know which STC control is clicked by user. it might be index of autosizer or object from event.GetEventObject() … etc…

···

2011/10/20 Robin Dunn robin@alldunn.com

On 10/19/11 7:51 PM, 최원준 wrote:

I tested this :

class MyPopupMenu(wx.Menu):

def init(self, parent):

super(MyPopupMenu, self).init()

self.parent = parent

mmi = wx.MenuItem(self, wx.NewId(), ‘Remove’)

self.AppendItem(mmi)

self.Bind(wx.EVT_MENU, self.OnRemove, mmi)

def OnRemove(self, e):

print self.GetParent().GetCurrentPos()

self.GetParent() object is STC. and there was an error : AttributeError:

‘NoneType’ object has no attribute ‘GetCurrentPos’

A menu’s parent is not the window, it is the parent menu if the menu is

a submenu.

Robin Dunn

Software Craftsman

http://wxPython.org

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

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


tab1 | tab2 | |


staticText | STC1 |
staticText | STC2 |
staticText | STC3 |
staticText | STC4 |

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

I tested this :

class MyPopupMenu(wx.Menu):

def init(self, parent):

super(MyPopupMenu, self).init()

self.parent = parent

mmi = wx.MenuItem(self, wx.NewId(), ‘Remove’)

self.AppendItem(mmi)

self.Bind(wx.EVT_MENU, self.OnRemove, mmi)

def OnRemove(self, e):

print self.GetParent().GetCurrentPos()

self.GetParent() object is STC. and there was an error : AttributeError:

‘NoneType’ object has no attribute ‘GetCurrentPos’

A menu’s parent is not the window, it is the parent menu if the menu is

a submenu.

Robin Dunn

Software Craftsman

http://wxPython.org

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

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

that’s right! it is not the window. if it is a window, can I use event.GetEventObject() to get stc object?

and I tested this. there was no error but it didn’t do anything.
self.parent.Autosizer.Detach(self.parent.text)
self.parent.Autosizer.Detach(self.parent.editor)

if I can use stc reference, I need to know the selected stc from the user.

but I am not sure how can I know the selected stc from the sizer.

and these controls are in notebook, when I click the add button, it append a row(staticText + STC) to Autosizer. but when I click tab2, it still add the row in tab1.

I don’t know why.

and when I want to delete the row, I need to know which STC control is clicked by user. it might be index of autosizer or object from event.GetEventObject() … etc…


tab1 | tab2 | |


staticText | STC1 |
staticText | STC2 |
staticText | STC3 |
staticText | STC4 |

when I tested the code below, the screen was like this(screenshot).

def OnRemove(self, e):
    Row = 0
    TextToDistroy = self.parent.Autosizer.GetItem(Row)
    EditToDistroy = self.parent.Autosizer.GetItem(Row+1)

    self.parent.Autosizer.Remove(Row+1)
    self.parent.Autosizer.Remove(Row)
    del TextToDistroy # or TextToDistroy.Destroy()
    del EditToDistroy # or EditToDistroy.Destroy()
    self.parent.Layout()

it seems to overlap the first and second. I think the staticText in the first row still here.

···

2011/10/20 Robin Dunn robin@alldunn.com

On 10/19/11 7:51 PM, 최원준 wrote:

...

-------------------------------------------------------------------------------------------------------------------------------------------
Sorry, I don't understand what this means :
watch out for lower/upper case problems when you get a message like this.when I coded like this:

self.parent.text.destroy()

You would get an error that text doesn't know "destroy" and this would be because you have a case problem, i.e. you wrote the "d" in lower case instead of in upper case "D".

I tried this code but some error occured => TypeError: wx.Window, wx.Sizer or int (position) expected for item
self.parent.Autosizer.Remove(self.parent.Autosizer.GetItem(self.parent.text))

what do you see if you do just before the above line this:
print type(self.parent.text)

I strongly suggest that you create a small sample application (no dependencies other then wxPython) which shows what you want to do and explain your outstanding problems again and attach this sample program here.

http://wiki.wxpython.org/MakingSampleApps

Werner

···

On 10/20/2011 01:31 AM, 최원준 wrote:

...

when I tested the code below, the screen was like this(screenshot).

def OnRemove(self, e):
Row = 0
TextToDistroy = self.parent.Autosizer.GetItem(Row)
EditToDistroy = self.parent.Autosizer.GetItem(Row+1)
self.parent.Autosizer.Remove(Row+1)
self.parent.Autosizer.Remove(Row)
del TextToDistroy # or TextToDistroy.Destroy()
del EditToDistroy # or EditToDistroy.Destroy()
self.parent.Layout()

def OnRemove(self, e):
Row = 0
TextToDistroy = self.parent.Autosizer.GetItem(Row)
EditToDistroy = self.parent.Autosizer.GetItem(Row+1)
self.parent.Autosizer.Detach(TextToDistroy)
self.parent.Autosizer.Detach(EditToDistroy)
del TextToDistroy # or TextToDistroy.Destroy()
del EditToDistroy # or EditToDistroy.Destroy()
self.parent.Layout()

Werner

···

On 10/20/2011 09:13 AM, 占쌍울옙占쏙옙 wrote:

the error was :
TypeError: wx.Window, wx.Sizer or int (position) expected for item

···

2011/10/20 werner wbruhin@free.fr

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

when I tested the code below, the screen was like this(screenshot).

def OnRemove(self, e):

Row = 0

TextToDistroy = self.parent.Autosizer.GetItem(Row)

EditToDistroy = self.parent.Autosizer.GetItem(Row+1)

self.parent.Autosizer.Remove(Row+1)

self.parent.Autosizer.Remove(Row)

del TextToDistroy # or TextToDistroy.Destroy()

del EditToDistroy # or EditToDistroy.Destroy()

self.parent.Layout()

def OnRemove(self, e):

Row = 0

TextToDistroy = self.parent.Autosizer.GetItem(Row)

EditToDistroy = self.parent.Autosizer.GetItem(Row+1)

self.parent.Autosizer.Detach(TextToDistroy)

self.parent.Autosizer.Detach(EditToDistroy)
del TextToDistroy # or TextToDistroy.Destroy()

del EditToDistroy # or EditToDistroy.Destroy()

self.parent.Layout()

Werner

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

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

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

when I tested the code below, the screen was like this(screenshot).

def OnRemove(self, e):

Row = 0

TextToDistroy = self.parent.Autosizer.GetItem(Row)

EditToDistroy = self.parent.Autosizer.GetItem(Row+1)

self.parent.Autosizer.Remove(Row+1)

self.parent.Autosizer.Remove(Row)

del TextToDistroy # or TextToDistroy.Destroy()

del EditToDistroy # or EditToDistroy.Destroy()

self.parent.Layout()

def OnRemove(self, e):

Row = 0

TextToDistroy = self.parent.Autosizer.GetItem(Row)

EditToDistroy = self.parent.Autosizer.GetItem(Row+1)

self.parent.Autosizer.Detach(TextToDistroy)

self.parent.Autosizer.Detach(EditToDistroy)
del TextToDistroy # or TextToDistroy.Destroy()

del EditToDistroy # or EditToDistroy.Destroy()

self.parent.Layout()

Werner

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

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

the error was :

TypeError: wx.Window, wx.Sizer or int (position) expected for item

so I changed like this :
self.parent.Autosizer.Detach(Row+1)
self.parent.Autosizer.Detach(Row)

but there is same overlap screen.

···

2011/10/20 werner wbruhin@free.fr

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

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

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

when I tested the code below, the screen was like this(screenshot).

def OnRemove(self, e):

Row = 0

TextToDistroy = self.parent.Autosizer.GetItem(Row)

EditToDistroy = self.parent.Autosizer.GetItem(Row+1)

self.parent.Autosizer.Remove(Row+1)

self.parent.Autosizer.Remove(Row)

del TextToDistroy # or TextToDistroy.Destroy()

del EditToDistroy # or EditToDistroy.Destroy()

self.parent.Layout()

def OnRemove(self, e):

Row = 0

TextToDistroy = self.parent.Autosizer.GetItem(Row)

EditToDistroy = self.parent.Autosizer.GetItem(Row+1)

self.parent.Autosizer.Detach(TextToDistroy)

self.parent.Autosizer.Detach(EditToDistroy)
del TextToDistroy # or TextToDistroy.Destroy()

del EditToDistroy # or EditToDistroy.Destroy()

self.parent.Layout()

Werner

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

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

the error was :

TypeError: wx.Window, wx.Sizer or int (position) expected for item

so I changed like this :
self.parent.Autosizer.Detach(Row+1)
self.parent.Autosizer.Detach(Row)

but there is same overlap screen.

http://wiki.wxpython.org/MakingSampleApps cannot be opened here.

···

2011/10/20 werner wbruhin@free.fr

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

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

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

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

when I tested the code below, the screen was like this(screenshot).

def OnRemove(self, e):

Row = 0

TextToDistroy = self.parent.Autosizer.GetItem(Row)

EditToDistroy = self.parent.Autosizer.GetItem(Row+1)

self.parent.Autosizer.Remove(Row+1)

self.parent.Autosizer.Remove(Row)

del TextToDistroy # or TextToDistroy.Destroy()

del EditToDistroy # or EditToDistroy.Destroy()

self.parent.Layout()

def OnRemove(self, e):

Row = 0

TextToDistroy = self.parent.Autosizer.GetItem(Row)

EditToDistroy = self.parent.Autosizer.GetItem(Row+1)

self.parent.Autosizer.Detach(TextToDistroy)

self.parent.Autosizer.Detach(EditToDistroy)
del TextToDistroy # or TextToDistroy.Destroy()

del EditToDistroy # or EditToDistroy.Destroy()

self.parent.Layout()

Werner

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

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

the error was :

TypeError: wx.Window, wx.Sizer or int (position) expected for item

so I changed like this :
self.parent.Autosizer.Detach(Row+1)
self.parent.Autosizer.Detach(Row)

but there is same overlap screen.

http://wiki.wxpython.org/MakingSampleApps cannot be opened here.

I tested this :

    self.parent.Autosizer.Detach(self.parent.Autosizer.GetItemIndex(self.parent.text))
    self.parent.Autosizer.Detach(self.parent.Autosizer.GetItemIndex(self.parent.editor))

but error said : AttributeError: ‘FlexGridSizer’ object has no attribute ‘GetItemIndex’

···

2011/10/20 werner wbruhin@free.fr

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

This is not enough to help you, which line of the above caused this
traceback?

Again, please make a small sample app.

Werner
···

On 10/20/2011 09:37 AM, 최원준 wrote:

2011/10/20 werner wbruhin@free.fr

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

      ...
        > when I tested the code below, the screen was like

this(screenshot).

        >

        > def OnRemove(self, e):

        > Row = 0

        > TextToDistroy = self.parent.Autosizer.GetItem(Row)

        > EditToDistroy = self.parent.Autosizer.GetItem(Row+1)

        > self.parent.Autosizer.Remove(Row+1)

        > self.parent.Autosizer.Remove(Row)

        > del TextToDistroy # or TextToDistroy.Destroy()

        > del EditToDistroy # or EditToDistroy.Destroy()

        > self.parent.Layout()

        >

        >

        def OnRemove(self, e):

        Row = 0

        TextToDistroy = self.parent.Autosizer.GetItem(Row)

        EditToDistroy = self.parent.Autosizer.GetItem(Row+1)

self.parent.Autosizer.Detach(TextToDistroy)

      self.parent.Autosizer.Detach(EditToDistroy)

del TextToDistroy # or TextToDistroy.Destroy()

        del EditToDistroy # or EditToDistroy.Destroy()

        self.parent.Layout()

Werner

          --

          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 error was :

  TypeError: wx.Window, wx.Sizer or int (position) expected for item

...

MakingSampleApps - wxPyWiki cannot be opened here.

Works here.

Go to the wxPython wiki and search for MakingSampleApps

Werner

···

On 10/20/2011 09:42 AM, 占쌍울옙占쏙옙 wrote:

Once again you fail to provide enough information for us to help you.
Are you getting any network or web server error? If so what is it? Or
is the problem that a proxy service (some internet security net-nanny
tool, your workplace or country or whatever) is blocking access for some
reason? If so does it say why?

···

On 10/20/11 12:42 AM, 占쌍울옙占쏙옙 wrote:

MakingSampleApps - wxPyWiki cannot be opened here.

--
Robin Dunn
Software Craftsman

Server not found

Firefox can’t find the server at wiki.wxpython.org.

Check the address for typing errors such as
ww.example.com instead of
www.example.com
If you are unable to load any pages, check your computer’s network

connection.

If your computer or network is protected by a firewall or proxy, make sure
that Firefox is permitted to access the Web.

···

2011/10/21 Robin Dunn robin@alldunn.com

On 10/20/11 12:42 AM, 최원준 wrote:

http://wiki.wxpython.org/MakingSampleApps cannot be opened here.

Once again you fail to provide enough information for us to help you.

Are you getting any network or web server error? If so what is it? Or

is the problem that a proxy service (some internet security net-nanny

tool, your workplace or country or whatever) is blocking access for some

reason? If so does it say why?

Robin Dunn

Software Craftsman

http://wxPython.org

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

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

2011년 10월 21일 오전 8:37, 최원준 wonjunchoi001@gmail.com님의 말:

http://wiki.wxpython.org/MakingSampleApps cannot be opened here.

Once again you fail to provide enough information for us to help you.

Are you getting any network or web server error? If so what is it? Or

is the problem that a proxy service (some internet security net-nanny

tool, your workplace or country or whatever) is blocking access for some

reason? If so does it say why?

Robin Dunn

Software Craftsman

http://wxPython.org

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

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

Server not found

Firefox can’t find the server at wiki.wxpython.org.

Check the address for typing errors such as
ww.example.com instead of
www.example.com
If you are unable to load any pages, check your computer’s network

connection.

If your computer or network is protected by a firewall or proxy, make sure
that Firefox is permitted to access the Web.

I could connect this web before but now I cannot… I don’t know why.
and I already have visited this web sites.
and I already uploaded my simple sample.
and Please don’t tell me rtfm. I already know what you mean and I am trying to understand wxPython.

if I already know the wx, I would not ask you in here.
and please don’t ignore my knowledge.
and my issue is not connecting web site. it is about custom control as you can see in the title.

···

2011/10/21 Robin Dunn robin@alldunn.com

On 10/20/11 12:42 AM, 최원준 wrote:

2011년 10월 21일 오전 8:42, 최원준 wonjunchoi001@gmail.com님의 말:

2011년 10월 21일 오전 8:37, 최원준 wonjunchoi001@gmail.com님의 말:

http://wiki.wxpython.org/MakingSampleApps cannot be opened here.

Once again you fail to provide enough information for us to help you.

Are you getting any network or web server error? If so what is it? Or

is the problem that a proxy service (some internet security net-nanny

tool, your workplace or country or whatever) is blocking access for some

reason? If so does it say why?

Robin Dunn

Software Craftsman

http://wxPython.org

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

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

Server not found

Firefox can’t find the server at wiki.wxpython.org.

Check the address for typing errors such as
ww.example.com instead of
www.example.com
If you are unable to load any pages, check your computer’s network

connection.

If your computer or network is protected by a firewall or proxy, make sure
that Firefox is permitted to access the Web.

I could connect this web before but now I cannot… I don’t know why.
and I already have visited this web sites.
and I already uploaded my simple sample.
and Please don’t tell me rtfm. I already know what you mean and I am trying to understand wxPython.

if I already know the wx, I would not ask you in here.
and please don’t ignore my knowledge.
and my issue is not connecting web site. it is about custom control as you can see in the title.

when I added the control to FlexSizer, I did like this :
self.Autosizer.Add(self.text,0)
self.Autosizer.Add(self.editor,1, wx.EXPAND)

but I am not sure when I delete the control from FlexSizer, how can I do?:

    Row = 0
    self.Autosizer.Remove(Row+1) # Need to remove last first
    self.Autosizer.Remove(Row)
    self.Layout()

when I do like this, the result was as screenshot

···

2011/10/21 Robin Dunn robin@alldunn.com

On 10/20/11 12:42 AM, 최원준 wrote:

2011년 10월 21일 오전 10:13, 최원준 wonjunchoi001@gmail.com님의 말:

2011년 10월 21일 오전 8:42, 최원준 wonjunchoi001@gmail.com님의 말:

2011년 10월 21일 오전 8:37, 최원준 wonjunchoi001@gmail.com님의 말:

http://wiki.wxpython.org/MakingSampleApps cannot be opened here.

Once again you fail to provide enough information for us to help you.

Are you getting any network or web server error? If so what is it? Or

is the problem that a proxy service (some internet security net-nanny

tool, your workplace or country or whatever) is blocking access for some

reason? If so does it say why?

Robin Dunn

Software Craftsman

http://wxPython.org

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

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

Server not found

Firefox can’t find the server at wiki.wxpython.org.

Check the address for typing errors such as
ww.example.com instead of
www.example.com
If you are unable to load any pages, check your computer’s network

connection.

If your computer or network is protected by a firewall or proxy, make sure
that Firefox is permitted to access the Web.

I could connect this web before but now I cannot… I don’t know why.
and I already have visited this web sites.
and I already uploaded my simple sample.
and Please don’t tell me rtfm. I already know what you mean and I am trying to understand wxPython.

if I already know the wx, I would not ask you in here.
and please don’t ignore my knowledge.
and my issue is not connecting web site. it is about custom control as you can see in the title.

when I added the control to FlexSizer, I did like this :
self.Autosizer.Add(self.text,0)
self.Autosizer.Add(self.editor,1, wx.EXPAND)

but I am not sure when I delete the control from FlexSizer, how can I do?:

    Row = 0
    self.Autosizer.Remove(Row+1) # Need to remove last first
    self.Autosizer.Remove(Row)
    self.Layout()

when I do like this, the result was as screenshot

the texctrl in row 0 seems like was deleted but the Statictext in row 0 was not. it looks like be overlapped.

···

2011/10/21 Robin Dunn robin@alldunn.com

On 10/20/11 12:42 AM, 최원준 wrote:

Hi,

>
>
> MakingSampleApps - wxPyWiki cannot be opened here.

Once again you fail to provide enough information for us to help you.
Are you getting any network or web server error? If so what is it? Or
is the problem that a proxy service (some internet security net-nanny
tool, your workplace or country or whatever) is blocking access for some
reason? If so does it say why?

--
Robin Dunn
Software Craftsman
http://wxPython.org

Server not found

Firefox can't find the server at wiki.wxpython.org.

Can you "ping" the server?

c:\>ping wiki.wxpython.org

Pinging wiki.wxpython.org [85.234.147.122] with 32 bytes of data:

Reply from 85.234.147.122: bytes=32 time=92ms TTL=51
Reply from 85.234.147.122: bytes=32 time=96ms TTL=51
Reply from 85.234.147.122: bytes=32 time=98ms TTL=51
Reply from 85.234.147.122: bytes=32 time=109ms TTL=51

Ping statistics for 85.234.147.122:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 92ms, Maximum = 109ms, Average = 98ms

If you can't see the Wiki's server using the IP address, then it might
be being blocked.

You might have better luck with the copy at the Internet Archive:

http://web.archive.org/web/20090106185611/http://wiki.wxpython.org/MakingSampleApps

HTH. Good luck.

Cheers,
Scott.

···

On Thu, Oct 20, 2011 at 7:37 PM, 최원준 <wonjunchoi001@gmail.com> wrote:

2011/10/21 Robin Dunn <robin@alldunn.com>

On 10/20/11 12:42 AM, 최원준 wrote:

2011년 10월 21일 오전 10:33, grunculus grunculus@gmail.com님의 말:

Hi,

http://wiki.wxpython.org/MakingSampleApps cannot be opened here.

Once again you fail to provide enough information for us to help you.

Are you getting any network or web server error? If so what is it? Or

is the problem that a proxy service (some internet security net-nanny

tool, your workplace or country or whatever) is blocking access for some

reason? If so does it say why?

Robin Dunn

Software Craftsman

http://wxPython.org

Server not found

Firefox can’t find the server at wiki.wxpython.org.

Can you “ping” the server?

c:>ping wiki.wxpython.org

Pinging wiki.wxpython.org [85.234.147.122] with 32 bytes of data:

Reply from 85.234.147.122: bytes=32 time=92ms TTL=51

Reply from 85.234.147.122: bytes=32 time=96ms TTL=51

Reply from 85.234.147.122: bytes=32 time=98ms TTL=51

Reply from 85.234.147.122: bytes=32 time=109ms TTL=51

Ping statistics for 85.234.147.122:

Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

Minimum = 92ms, Maximum = 109ms, Average = 98ms

If you can’t see the Wiki’s server using the IP address, then it might

be being blocked.

You might have better luck with the copy at the Internet Archive:

http://web.archive.org/web/20090106185611/http://wiki.wxpython.org/MakingSampleApps

HTH. Good luck.

Cheers,

Scott.

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

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

I am on linux. and using firefox. and couldn’t connect http://web.archive.org/web/20090106185611/http://wiki.wxpython.org/MakingSampleApps

···

On Thu, Oct 20, 2011 at 7:37 PM, 최원준 wonjunchoi001@gmail.com wrote:

2011/10/21 Robin Dunn robin@alldunn.com

On 10/20/11 12:42 AM, 최원준 wrote:

self.text.Destroy()
  self.editor.Destroy()
  self.Layout()

The widgets will remove themselves from the sizer when they are
destroyed. Note that this assumes that you still have a reference to
the actual widgets that you want to remove, and that you did not assign
all of them to the same self.text and self.editor variables.

···

On 10/20/11 6:13 PM, 占쌍울옙占쏙옙 wrote:

when I added the control to FlexSizer, I did like this :
self.Autosizer.Add(self.text,0)
self.Autosizer.Add(self.editor,1, wx.EXPAND)

but I am not sure when I delete the control from FlexSizer, how can I do?:
Row = 0
self.Autosizer.Remove(Row+1) # Need to remove last first
self.Autosizer.Remove(Row)
self.Layout()
when I do like this, the result was as screenshot

--
Robin Dunn
Software Craftsman

when I coded like this, it deleted the latest text and editor from FlexSizer.

and if there is only one text and editor. it terminates the whole window.
I don’t know how can I delete the control in the specific row.

    self.text.Destroy()
    self.editor.Destroy()
···

2011/10/21 Robin Dunn robin@alldunn.com

On 10/20/11 6:13 PM, 최원준 wrote:

when I added the control to FlexSizer, I did like this :

self.Autosizer.Add(self.text,0)

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

but I am not sure when I delete the control from FlexSizer, how can I do?:

Row = 0

self.Autosizer.Remove(Row+1) # Need to remove last first

self.Autosizer.Remove(Row)

self.Layout()

when I do like this, the result was as screenshot

self.text.Destroy()

    self.editor.Destroy()

    self.Layout()

The widgets will remove themselves from the sizer when they are

destroyed. Note that this assumes that you still have a reference to

the actual widgets that you want to remove, and that you did not assign

all of them to the same self.text and self.editor variables.

Robin Dunn

Software Craftsman

http://wxPython.org

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

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

Hi,

2011년 10월 21일 오전 10:33, grunculus <grunculus@gmail.com>님의 말:

>> > MakingSampleApps - wxPyWiki cannot be opened here.

> Server not found
>
> Firefox can't find the server at wiki.wxpython.org.

Can you "ping" the server?

If you can't see the Wiki's server using the IP address, then it might
be being blocked.

You might have better luck with the copy at the Internet Archive:

MakingSampleApps - wxPyWiki

I am on linux. and using firefox.

You can run "ping" in a Terminal window on Linux as well:

scott@p7120d:~$ ping wiki.wxpython.org

PING wiki.wxpython.org (85.234.147.122) 56(84) bytes of data.
64 bytes from riobu.com (85.234.147.122): icmp_seq=1 ttl=51 time=97.3 ms
64 bytes from riobu.com (85.234.147.122): icmp_seq=2 ttl=51 time=88.1 ms
64 bytes from riobu.com (85.234.147.122): icmp_seq=3 ttl=51 time=94.8 ms
64 bytes from riobu.com (85.234.147.122): icmp_seq=4 ttl=51 time=91.3 ms
64 bytes from riobu.com (85.234.147.122): icmp_seq=5 ttl=51 time=102 ms

Can you "ping" the wiki.wxpython.org site?

and couldn't connect
MakingSampleApps - wxPyWiki

I guess that's not surprising. Unfortunately.

Here's the meat of the MakingSampleApps page from the wiki:

=== begin cut ===
How to make a sample

Just to be clear, the sample app you send to the list should not be a
copy of the app you are having trouble with. Nobody wants to read
through all the rest of the code of your app just to figure out one
little problem with one widget 15 clicks away from the startup. It
should also usually not be a copy of your app with lots of stuff
ripped out. To have a chance of solving the problem yourself it is
best to figure out how to make the mistake again, so you can then
figure out what not to do. So here are some suggested steps about how
to make a sample app to send to the list.

   1. Start from scratch with just a frame, a panel and the control(s)
that you are having trouble with, and put it all in one module.

   2. Initialize the control with some typical values like what your app uses.

   3. If it's applicable to the problem hook up some event handlers
that are the same or similar to what your app uses, if any of them
need app-specific data or functionality then just stub it out with
static or generated bogus data/functionality.

   4. Keep work needed for the previous steps as simple as possible.
Do just enough work to show the problem. For even a novice programmer
with basic wx familiarity these steps should take 15 minutes or less.

   5. Run your sample. If it misbehaves in the same way as your app
then you can usually assume that it is a wxPython problem, or maybe
that you are just using wxPython in the wrong way. Send your sample
and questions about it to the wxPython-users list. If the sample
doesn't misbehave then it is almost certainly a problem in your app
and you can progressively add things to the sample until you duplicate
the problem and then that can help you to figure out how to fix it in
your app.

   6. When you send your sample app and questions to the
wxPython-users list be sure to mention the version of wxPython you are
using, and also the platform(s) you are using when the problem
manifests itself.

   7. Unless you are absolutely sure that all the lines in your sample
code are short enough to not be word-wrapped by mail software then DO
NOT paste your code into the main body of your email message. Send
your code as an attachment instead. Note that you can not make
attachments when using the Google Groups Web interface to read and
respond to messages, you will need to send an email message from your
subscribed mail address instead. Update: Google has a new beta UI for
the Groups application. If you switch to the new UI you will be able
to attach files to messages posted via their browser interface.

Read the last item above once more. Repeat until it is burned into your memory!

Other helpful hints

   1. wxPython version: Since many of the typical helpers have
multiple versions of wxPython installed on their systems, they will
want to make sure that the version they test with is the same one that
you reported the problem about. I've found it helpful to add the
following line into the code just after the wx module is imported. If
you do it for us before you send your sample then that will be another
bit of time that you can save for the helper.

       print wx.version()

   2. Widget Inspection Tool: Another thing that I almost always add
into the samples that are sent to the list are statements for loading
and activating the Widget Inspection Tool, especially if the problem
has to do with layout issues. It gives a simple hierarchical overview
of the widgets and sizers in the application, a way to view common
properties of the widgets, sizers and sizer items, and also a PyCrust
shell for interacting with selected widgets in an interactive Python
interpreter. If you also make use of this tool it may help you to
solve problems yourself before you give up and send the sample to the
mail list. To activate and use the tool simply add these lines into
the sample just before MainLoop is called:

       import wx.lib.inspection
       wx.lib.inspection.InspectionTool().Show()

=== end cut ===

I hope this helps. Good luck.

Cheers,
Scott.

···

2011/10/20 최원준 <wonjunchoi001@gmail.com>: