python gui using boa

A

Ashok

hi,
i am trying to develop a small gui app using boa constructor. say this
app has one frame which has one static text control. i want the frame
to resize itself to the width of the text contrl when i change the
label of the text control via SetLabel(). how can i do this in boa
constructor?

can anybody guide me to a good source for learning the use of sizers in
boa?

thanks
 
S

Steve Holden

Ashok said:
hi,
i am trying to develop a small gui app using boa constructor. say this
app has one frame which has one static text control. i want the frame
to resize itself to the width of the text contrl when i change the
label of the text control via SetLabel(). how can i do this in boa
constructor?

can anybody guide me to a good source for learning the use of sizers in
boa?
Sizers are a tricky topic, and there doesn't appear to be much that's
specific to Boa. You could take a look in the wxPython wiki at

http://wiki.wxpython.org/index.cgi/UsingSizers

but whether this will help you with Boa I'm not sure. I have tried Glade
and Boa as well as Python Card, and all I can really say is that I found
it worth spending the money to *buy* wxDesigner. It's not a perfect
product, but it fits my brain. Sorry if this isn't an option for you.

regards
Steve
 
A

ash

Thanks Steve, i found out the solution to the problem. but a good
tutorial on sizers is still missing.
 
B

Brian Victor

ash said:
Thanks Steve, i found out the solution to the problem. but a good
tutorial on sizers is still missing.

<plug type="shameless">

Try this article I wrote a while back. It should at least help you get
started. The code samples are written in C++, but they are trivially
translated to python. (Change -> to ., change this to self, get rid of
"new" and *)

http://neume.sourceforge.net/sizerdemo/

</plug>
 
A

ash

Thanks Brian, that was a good introduction.
I have another query for you - how can i make a captionless frame
draggable in wxWindows?
 
B

Brian Victor

ash said:
I have another query for you - how can i make a captionless frame
draggable in wxWindows?

If you look at the wxPython demo, there's a Shaped Window demo under
Miscellaneous that does this. The key portion is on line 86 in my
version:

#v+
def OnMouseMove(self, evt):
if evt.Dragging() and evt.LeftIsDown():
x, y = self.ClientToScreen(evt.GetPosition())
fp = (x - self.delta[0], y - self.delta[1])
self.Move(fp)
#v-
 
A

ash

Thanks Brian, I could do it. actually it needs all the three mouse
events - LeftDown, LeftUp and MouseMove.

with regards,
Ashoka
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top