Problem with frame

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()

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@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@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Thanks

···

From:
wxpython-users-bounces+pthippan=mc.com@lists.wxwidgets.org [mailto:wxpython-users-bounces+pthippan=mc.com@lists.wxwidgets.org] On Behalf Of raffaello
Sent: Tuesday, April 15, 2008 5:20 PM
To:
wxpython-users@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@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@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users