[wxpython-users] Re: wxStaticBox and wxGridBagSizer
ARCHER, Thomas
THOMAS.ARCHER at airbus.com
Wed Apr 16 00:13:07 PDT 2008
That's brilliant but how do I stop it collapsing on itself?
Regards
Tom
-----Original Message-----
From:
wxpython-users-bounces+thomas.archer=airbus.com at lists.wxwidgets.org
[mailto:wxpython-users-bounces+thomas.archer=airbus.com at lists.wxwidgets.
org]On Behalf Of wxpython-users-request at lists.wxwidgets.org
Sent: 16 April 2008 05:19
To: wxpython-users at lists.wxwidgets.org
Subject: wxpython-users Digest, Vol 2, Issue 81
Send wxpython-users mailing list submissions to
wxpython-users at lists.wxwidgets.org
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
or, via email, send a message with subject or body 'help' to
wxpython-users-request at lists.wxwidgets.org
You can reach the person managing the list at
wxpython-users-owner at lists.wxwidgets.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of wxpython-users digest..."
Today's Topics:
1. RE: Problem with frame (Thippana, Prasoonadevi)
2. Re: wxStaticBox and wxGridBagSizer (E. A. Tacao)
3. Converting a wx.Bitmap to a wx.Image and back; alpha
channels; inconsistent behavior between platforms (Jukka Aho)
4. Boa Constructor 0.6.1. beta? (Erik Vandamme)
5. slow startup of wxPython application (C M)
6. Re: Boa Constructor 0.6.1. beta? (Marc Tompkins)
----------------------------------------------------------------------
Message: 1
Date: Tue, 15 Apr 2008 17:26:31 -0400
From: "Thippana, Prasoonadevi" <pthippan at mc.com>
Subject: RE: [wxpython-users] Problem with frame
To: <wxpython-users at lists.wxwidgets.org>
Message-ID:
<FDD9F67E06588C45B95601EB3A445B0E77E1D3 at CHM-EMAIL1.ad.mc.com>
Content-Type: text/plain; charset="us-ascii"
Thanks
________________________________
From: wxpython-users-bounces+pthippan=mc.com at lists.wxwidgets.org
[mailto:wxpython-users-bounces+pthippan=mc.com at lists.wxwidgets.org] On
Behalf Of raffaello
Sent: Tuesday, April 15, 2008 5:20 PM
To: wxpython-users at lists.wxwidgets.org
Subject: Re: [wxpython-users] Problem with frame
You assigned the default size to the wx.RadioButtons, and the default
width is not enough.
Try:
self.rb1 = wx.RadioButton(self.pnl,-1,"Test1",(40,50), (60, -1))
and the same size parameter for rb2 and rb3.
2008/4/15, Thippana, Prasoonadevi <pthippan at mc.com>:
Hi,
I have created a frame with radio buttons and combobox. When I
run this, why am I not able to see full word Test2 and Test3 . At the
end of 2 and 3 something is blocking them.
Thanks
import wx
import os, sys
import string
import re
import wx.lib.dialogs
class RunCoverage(wx.Frame):
def __init__(self, parent, id, title):
wx.Frame.__init__(self,
parent,-1,title,wx.DefaultPosition,wx.Size(400,450))
self.SetIcon(wx.Icon('PyCrust.ico',wx.BITMAP_TYPE_ICO))
self.pnl = wx.Panel(self,-1,wx.DefaultPosition,
wx.DefaultSize)
# Creating the controls
self.smp1 = []
self.rb1 =
wx.RadioButton(self.pnl,-1,"Test1",(40,50))
self.rb1.SetFont(wx.Font(10,wx.SWISS,wx.NORMAL,
wx.NORMAL))
self.cb1 =
wx.ComboBox(self.pnl,-1,"",(150,50),(150,-1),self.smp1,wx.CB_DROPDOWN |
wx.CB_SORT)
self.smp2 = []
self.rb2 =
wx.RadioButton(self.pnl,-1,"Test2",(40,100))
self.rb2.SetFont(wx.Font(10,wx.SWISS,wx.NORMAL,
wx.NORMAL))
self.cb2 =
wx.ComboBox(self.pnl,-1,"",(150,100),(150,-1),self.smp2,wx.CB_DROPDOWN |
wx.CB_SORT)
self.smp3 = []
self.rb3 =
wx.RadioButton(self.pnl,-1,"Test3",(40,150))
self.rb3.SetFont(wx.Font(10,wx.SWISS,wx.NORMAL,
wx.NORMAL))
bt1 = wx.Button(self.pnl, -1,
'Run',wx.Point(150,250))
self.bt2 = wx.Button(self.pnl, -1,
'Exit',wx.Point(250,250))
class MyApp(wx.App):
def OnInit(self):
frame = RunCoverage(None, -1, 'Test')
frame.Show(True)
self.SetTopWindow(frame)
return True
app = MyApp(0)
app.MainLoop()
_______________________________________________
wxpython-users mailing list
wxpython-users at lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/20080415/e965a87e/attachment-0001.htm
------------------------------
Message: 2
Date: Tue, 15 Apr 2008 22:19:48 -0300
From: "E. A. Tacao" <e.a.tacao at estadao.com.br>
Subject: Re: [wxpython-users] wxStaticBox and wxGridBagSizer
To: "ARCHER, Thomas" <wxpython-users at lists.wxwidgets.org>
Message-ID: <531280772.20080415221948 at estadao.com.br>
Content-Type: text/plain; charset="us-ascii"
Tuesday, April 15, 2008, 4:17:11 AM, ARCHER, Thomas wrote:
> Basically I'm trying to create a class which has a panel (wxPanel)
> with a layout (wxGridBagSizer) surrounded by a frame (wxStaticBox),
> but I'm having problems getting the wxStaticBox working properly.
> I've managed to use it with wxStaticBoxSizer, but this then only
> allows the box to stretch in one direction or the other. If anyone
> could knock me up an example of how to use wxStaticBox with a
> wxGridBagSizer, that'd be much appreciated (...)
Please see the attached file. HTH.
-- tacao
No bits were harmed during the making of this e-mail.
-------------- next part --------------
import wx
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent, -1)
box = wx.StaticBox(self, -1, "This is a wx.StaticBox")
self.bsizer = wx.StaticBoxSizer(box, wx.HORIZONTAL)
self.gbs = wx.GridBagSizer(5, 5)
a_btn = wx.Button(self, -1, "Button 1")
b_btn = wx.Button(self, -1, "Button 2")
c_btn = wx.Button(self, -1, "Button 3")
d_btn = wx.Button(self, -1, "Button 4")
e_btn = wx.Button(self, -1, "Button 5")
f_btn = wx.Button(self, -1, "Button 6")
self.gbs.Add(a_btn, (0, 0), flag=wx.EXPAND)
self.gbs.Add(b_btn, (2, 0), flag=wx.EXPAND)
self.gbs.Add(c_btn, (2, 1), flag=wx.EXPAND)
self.gbs.Add(d_btn, (3, 0), flag=wx.EXPAND)
self.gbs.Add(e_btn, (3, 1), flag=wx.EXPAND)
self.gbs.Add(f_btn, (5, 0), flag=wx.EXPAND)
self.gbs.AddGrowableRow(0)
self.gbs.AddGrowableCol(0)
self.gbs.AddGrowableCol(1)
self.bsizer.Add(self.gbs, 1, flag=wx.EXPAND)
self.SetSizerAndFit(self.bsizer)
class MyApp(wx.App):
def OnInit(self):
frame = wx.Frame(None, title="Test GridBagSizer+Box")
panel = TestPanel(frame)
frame.Show()
return True
if __name__ == "__main__":
app = MyApp()
app.MainLoop()
------------------------------
Message: 3
Date: Wed, 16 Apr 2008 04:17:50 +0300
From: "Jukka Aho" <jukka.aho at iki.fi>
Subject: [wxpython-users] Converting a wx.Bitmap to a wx.Image and
back; alpha channels; inconsistent behavior between platforms
To: wxpython-users at lists.wxwidgets.org
Message-ID: <fu3k3u$vs5$1 at ger.gmane.org>
Content-Type: text/plain; format=flowed; charset="iso-8859-1";
reply-type=original
Converting a wx.Bitmap to a wx.Image, and back again - and repeating
this process - yields different results on different platforms when
alpha channels are involved. Here's a small sample program that
demonstrates the problem (screenshots below):
<http://www.saunalahti.fi/znark/alpha_bitmaps/alpha_bitmaps.py>
What the program does is as follows:
1) Prepare a blue background bitmap of 16x16 pixels. This
bitmap also features a white "diagonal lines" hatch
pattern.
2) Iterate through a loop of 16 steps while advancing from
left to right. Blit a row of 16 (16x16 pixel) bitmaps.
The algorithm for blitting goes as follows:
- Blit the background bitmap first. (This bitmaps
stays the same throughout the loop.)
- Then prepare a foreground bitmap of the same size -
with an alpha channel - and blit it on the top of
the background bitmap. All foreground bitmaps are
the same shade of red but their alpha channel
grows more opaque in each step.
- Advance to the next position on the right.
In order to manipulate the alpha channel, the red wx.Bitmap is converted
to a wx.Image. The values for the alpha channel are set and the image is
then converted back to a wx.Bitmap, for blitting. Lather, rinse, repeat.
Essentially, the "same" wx.Bitmap - or at least its RGBA buffer data -
is converted back and forth a number of times.
* * *
For some reason, this does not work on GTK. Something weird seems to be
going on with the colors and the transparency values (alpha channel
data):
<http://www.saunalahti.fi/znark/alpha_bitmaps/wxgtk-screenshot.png>
python-wxgtk2.8 (2.8.7.1-0ubuntu3 - again, with Python 2.5)
On MS Windows, however, everything works fine:
<http://www.saunalahti.fi/znark/alpha_bitmaps/wxmsw-screenshot.png>
wxPython 2.8.6.0 (unicode) for Python 2.5
For comparison, the sample program also blits another stripe of blocks
below the first one. This time, the only difference is that a brand new
wx.Bitmap is created for each "foreground" blit - by the force of
wx.EmptyBitmap - instead of reusing the existing bitmap. This approach
works on both platforms.
* * *
Could anyone offer any insight on...
1) Why is this happening in the first place?
2) Is it a bug or a "feature"?
3) If it's "by design", how do I know when I'm allowed to convert
a wx.Bitmap to a wx.Image (and back) without getting these
kind of surprises... and when not?
4) If it is a bug, is it a bug in the actual wxWidgets tookit
or the wxPython wrapper?
--
znark
------------------------------
Message: 4
Date: Wed, 16 Apr 2008 14:13:12 +1000
From: Erik Vandamme <erik1vandamme at gmail.com>
Subject: [wxpython-users] Boa Constructor 0.6.1. beta?
To: wxPython User-List <wxPython-users at lists.wxwidgets.org>
Message-ID: <48057CD8.5090705 at gmail.com>
Content-Type: text/plain; charset="us-ascii"
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/20080416/542cb342/attachment-0001.htm
------------------------------
Message: 5
Date: Wed, 16 Apr 2008 00:13:37 -0400
From: "C M" <cmpython at gmail.com>
Subject: [wxpython-users] slow startup of wxPython application
To: wxPython-users at lists.wxwidgets.org
Message-ID:
<cc8074370804152113m43314e0fsc1ba86b7da3da83a at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
I have a small unfinished application that seems to have an
unexpectedly slow time to start up (by clicking on the Python icon for
the main frame of the application) given how small it is. From a cold
start of not having been run recently, it takes ~37 seconds for the
app to load from the time of clicking to when it is displayed. Then,
after it is closed and reopened, it pops up very quickly, a few
seconds.
This seems really slow to me for such a dinky application, and I've
seen this with many small apps I've made. This application is a frame
(~700 lines) which imports a frame (~500 lines) and a framepanel (~300
lines). It is running with the following specs:
- wxPython 2.8.7.1
- Python 2.5
- Windows XP, SP2
- Gateway Tablet PC, 1.7 Ghz, 512 Meg RAM
- and it import a fair number of modules,
including bigger things like matplotlib and sqlite
I realize that in running the application I am also having to run the
Python interpreter. But are there ways to try to reduce the start up
time of the application or any wxPython application? Some of the
intended apps are to be run at start-up of the computer, and so it is
less important, but generally I'd still like to know ways to reduce
this time if possible.
Thanks,
CM
------------------------------
Message: 6
Date: Tue, 15 Apr 2008 21:18:53 -0700
From: "Marc Tompkins" <marc.tompkins at gmail.com>
Subject: Re: [wxpython-users] Boa Constructor 0.6.1. beta?
To: wxpython-users at lists.wxwidgets.org
Message-ID:
<40af687b0804152118u4ad2257dg6ca3381850fa243a at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
On Tue, Apr 15, 2008 at 9:13 PM, Erik Vandamme <erik1vandamme at gmail.com>
wrote:
> Is there any way of starting BOA in Debugmode perhaps, so I do at least
> get an inkling of what's going on?
>
I'm sure it will horrify the purists out there, but whenever one of my
wxPython programs opens and closes without a message I just run it in IDLE.
Slow and nasty, but the error message stays up there.
-- =
www.fsrtechnologies.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200804=
15/2df48956/attachment.htm
------------------------------
_______________________________________________
wxpython-users mailing list
wxpython-users at lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
End of wxpython-users Digest, Vol 2, Issue 81
*********************************************
This mail has originated outside your organization, either from an external partner or the Global Internet.
Keep this in mind if you answer this message.
The information in this e-mail is confidential. The contents may not be disclosed or used by anyone other then the addressee. Access to this e-mail by anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as it has been sent over public networks. If you have any concerns over the content of this message or its Accuracy or Integrity, please contact Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus scanning software but you should take whatever measures you deem to be appropriate to ensure that this message and any attachments are virus free.
More information about the wxpython-users
mailing list