ExpandoTextCtrl & EVT_LAYOUT_NEEDED

I'm having problems getting this working correctly. When ExpandoTextCtrl increases its vertical height (as it should) it is not resizing/reloacting the two listctrls that are below it. I've tried

def OnRefit(self, evt):
     self.Fit()

def OnRefit(self, evt):
     self.Fit()
     self.Layout()

def OnRefit(self, evt):
     self.Layout()
     self.Fit()

What is odd is that if I just grab the lower right corner of the window and resize it even a little, everything works like a charm. I Googled for this but didn't turn up anything.

Thanks in advance.

Regards,
Larry

Larry Bates wrote:

I'm having problems getting this working correctly. When ExpandoTextCtrl increases its vertical height (as it should) it is not resizing/reloacting the two listctrls that are below it. I've tried

def OnRefit(self, evt):
    self.Fit()

def OnRefit(self, evt):
    self.Fit()
    self.Layout()

def OnRefit(self, evt):
    self.Layout()
    self.Fit()

What is self? What is the relationship of self to the ExpandoTextCtrl? What is the structure of the sizers? (A small runnable sample would have answered all these questions and more...)

What is odd is that if I just grab the lower right corner of the window and resize it even a little, everything works like a charm.

This is a sure sign that a Layout will take care of the problem, but the how and the where will depend on the answers to the above questions (and/or a runnable sample.)

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin Dunn wrote:

Larry Bates wrote:

I'm having problems getting this working correctly. When ExpandoTextCtrl increases its vertical height (as it should) it is not resizing/reloacting the two listctrls that are below it. I've tried

def OnRefit(self, evt):
    self.Fit()

def OnRefit(self, evt):
    self.Fit()
    self.Layout()

def OnRefit(self, evt):
    self.Layout()
    self.Fit()

What is self? What is the relationship of self to the ExpandoTextCtrl? What is the structure of the sizers? (A small runnable sample would have answered all these questions and more...)

What is odd is that if I just grab the lower right corner of the window and resize it even a little, everything works like a charm.

This is a sure sign that a Layout will take care of the problem, but the how and the where will depend on the answers to the above questions (and/or a runnable sample.)

Sorry, I'm running Python version of wxWindows so that code is "runnable".
self is Python's way of referencing this (I think that is how C does it).
The answer seems to be to add a:

self.Refresh() at the end and it looks GREAT!

-Larry

Robin Dunn wrote:
> Larry Bates wrote:
>> I'm having problems getting this working correctly. When
>> ExpandoTextCtrl increases its vertical height (as it should) it is not
>> resizing/reloacting the two listctrls that are below it. I've tried
>>
>> def OnRefit(self, evt):
>> self.Fit()
>>
>>
>> def OnRefit(self, evt):
>> self.Fit()
>> self.Layout()
>>
>> def OnRefit(self, evt):
>> self.Layout()
>> self.Fit()
>
> What is self? What is the relationship of self to the ExpandoTextCtrl?
> What is the structure of the sizers? (A small runnable sample would
> have answered all these questions and more...)
>
>>
>> What is odd is that if I just grab the lower right corner of the
>> window and resize it even a little, everything works like a charm.
>
> This is a sure sign that a Layout will take care of the problem, but the
> how and the where will depend on the answers to the above questions
> (and/or a runnable sample.)
>
Sorry, I'm running Python version of wxWindows so that code is "runnable".

"Runnable" in the wxPython community means: "a piece of code, as short
as possible, that we can actually copy and paste in our preferred
editor and run without further modification". See, for example:

http://wiki.wxpython.org/MakingSampleApps

self is Python's way of referencing this (I think that is how C does it).

You must be joking :smiley:
I bet Robin knows what "self" is used for in Python... he is the
creator of wxPython :wink:

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On 9/26/07, Larry Bates wrote:

Andrea Gavana wrote:

Robin Dunn wrote:

Larry Bates wrote:

I'm having problems getting this working correctly. When
ExpandoTextCtrl increases its vertical height (as it should) it is not
resizing/reloacting the two listctrls that are below it. I've tried

def OnRefit(self, evt):
    self.Fit()

def OnRefit(self, evt):
    self.Fit()
    self.Layout()

def OnRefit(self, evt):
    self.Layout()
    self.Fit()

What is self? What is the relationship of self to the ExpandoTextCtrl?
What is the structure of the sizers? (A small runnable sample would
have answered all these questions and more...)

What is odd is that if I just grab the lower right corner of the
window and resize it even a little, everything works like a charm.

This is a sure sign that a Layout will take care of the problem, but the
how and the where will depend on the answers to the above questions
(and/or a runnable sample.)

Sorry, I'm running Python version of wxWindows so that code is "runnable".

"Runnable" in the wxPython community means: "a piece of code, as short
as possible, that we can actually copy and paste in our preferred
editor and run without further modification". See, for example:

MakingSampleApps - wxPyWiki

self is Python's way of referencing this (I think that is how C does it).

You must be joking :smiley:
I bet Robin knows what "self" is used for in Python... he is the
creator of wxPython :wink:

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

No joking here, he is one that asked "What is self?" I thought my question was so simple that a "runnable" example wouldn't be necessary (the solution was to add self.Refresh() to the frame that gets executed when the ExpandoCtrl needs resizing). Next time I'll try to post a runnable example that demonstrates the problem.. Since this is maybe my 2nd wxPython program, I'm still learning a lot and I didn't have any idea who was asking.

-Larry

···

On 9/26/07, Larry Bates wrote:

Larry Bates wrote:

Andrea Gavana wrote:

Robin Dunn wrote:

Larry Bates wrote:

I'm having problems getting this working correctly. When
ExpandoTextCtrl increases its vertical height (as it should) it is not
resizing/reloacting the two listctrls that are below it. I've tried

def OnRefit(self, evt):
    self.Fit()

def OnRefit(self, evt):
    self.Fit()
    self.Layout()

def OnRefit(self, evt):
    self.Layout()
    self.Fit()

What is self? What is the relationship of self to the ExpandoTextCtrl?
What is the structure of the sizers? (A small runnable sample would
have answered all these questions and more...)

What is odd is that if I just grab the lower right corner of the
window and resize it even a little, everything works like a charm.

This is a sure sign that a Layout will take care of the problem, but the
how and the where will depend on the answers to the above questions
(and/or a runnable sample.)

Sorry, I'm running Python version of wxWindows so that code is "runnable".

"Runnable" in the wxPython community means: "a piece of code, as short
as possible, that we can actually copy and paste in our preferred
editor and run without further modification". See, for example:

MakingSampleApps - wxPyWiki

self is Python's way of referencing this (I think that is how C does it).

You must be joking :smiley:
I bet Robin knows what "self" is used for in Python... he is the
creator of wxPython :wink:

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

No joking here, he is one that asked "What is self?"

Meaning: is self a frame, a panel, the expano widget, your grandmother's apple pie? Without a full understanding of the context, a little snippet of code is often next to useless.

···

On 9/26/07, Larry Bates wrote:

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

What Robin was asking was what is "self" referring to. When you create a
class, it's subclassed from wx.Panel, wx.Frame, wx.App or something else.
The item, "self" refers to whatever has been subclassed in that class.

For example:

Class (wx.Frame):
    wx.Frame.__init__(self,parent,wx.ID_ANY,title)
    panel = wx.Panel(self, -1)

The self mentioned above is referring to the wx.Frame...thus, the panel
object's parent is a frame.

I hope that answered your question.

Mike

···

-----Original Message-----
From: Larry Bates [mailto:larry.bates@websafe.com]
Sent: Wednesday, September 26, 2007 7:45 AM
To: wxPython-users@lists.wxwidgets.org
Subject: Re: ExpandoTextCtrl & EVT_LAYOUT_NEEDED

Andrea Gavana wrote:
> On 9/26/07, Larry Bates wrote:
>> Robin Dunn wrote:
>>> Larry Bates wrote:
>>>> I'm having problems getting this working correctly. When
>>>> ExpandoTextCtrl increases its vertical height (as it
should) it is
>>>> not resizing/reloacting the two listctrls that are below
it. I've
>>>> tried
>>>>
>>>> def OnRefit(self, evt):
>>>> self.Fit()
>>>>
>>>>
>>>> def OnRefit(self, evt):
>>>> self.Fit()
>>>> self.Layout()
>>>>
>>>> def OnRefit(self, evt):
>>>> self.Layout()
>>>> self.Fit()
>>> What is self? What is the relationship of self to the
ExpandoTextCtrl?
>>> What is the structure of the sizers? (A small runnable sample
>>> would have answered all these questions and more...)
>>>
>>>> What is odd is that if I just grab the lower right corner of the
>>>> window and resize it even a little, everything works
like a charm.
>>> This is a sure sign that a Layout will take care of the
problem, but
>>> the how and the where will depend on the answers to the above
>>> questions (and/or a runnable sample.)
>>>
>> Sorry, I'm running Python version of wxWindows so that
code is "runnable".
>
> "Runnable" in the wxPython community means: "a piece of
code, as short
> as possible, that we can actually copy and paste in our preferred
> editor and run without further modification". See, for example:
>
> MakingSampleApps - wxPyWiki
>
>> self is Python's way of referencing this (I think that is
how C does it).
>
> You must be joking :smiley:
> I bet Robin knows what "self" is used for in Python... he is the
> creator of wxPython :wink:
>
> Andrea.
>
> "Imagination Is The Only Weapon In The War Against Reality."
> http://xoomer.alice.it/infinity77/

No joking here, he is one that asked "What is self?" I
thought my question was so simple that a "runnable" example
wouldn't be necessary (the solution was to add self.Refresh()
to the frame that gets executed when the ExpandoCtrl needs
resizing). Next time I'll try to post a runnable example
that demonstrates the problem.. Since this is maybe my 2nd
wxPython program, I'm still learning a lot and I didn't have
any idea who was asking.

-Larry