473,396 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

WxPython, on show() complete frame is selected

1
Hello,

I am a novice inwxPython. I created a Fram with a textcontrol, radiobox and checkbox. On showing the frame, every widget, from static text to button on the bottom, everything is selected... None of the controls work. Can anybody give a tip to solve this problem.

Thanks,

Luc
Mar 9 '08 #1
4 1912
jlm699
314 100+
Sounds like an initialization problem.. not quite sure what you're experiencing however... can you give us your code that is causing this problem?
Mar 10 '08 #2
I usually keep a basic template when im developing wxPython GUIs and then add to it accordingly. That way i cant go wrong and my code looks readable

Expand|Select|Wrap|Line Numbers
  1. import wx
  2.  
  3. class MyFrame(wx.Frame):
  4.     def __init__(self):
  5.         wx.Frame.__init__(self, None, wx.ID_ANY, " My Frame ")
  6.  
  7.         panel = MyPanel(self)
  8.         sizerv = wx.BoxSizer(wx.VERTICAL)
  9.         sizerv.Add(panel, 10, wx.EXPAND|wx.ALL, 0)
  10.         self.SetSizerAndFit()
  11.         self.SetSize((600,400))
  12.  
  13. class MyPanel(wx.Panel):
  14.     def __init__(self, parent):
  15.         wx.Panel.__init__(self, parent, wx.ID_ANY)
  16.  
  17.         # Button and text controls go here
  18.  
  19. def Main():
  20.     app = wx.PySimpleApp()
  21.     frame = MyFrame()
  22.     frame.Show()
  23.     app.MainLoop()
  24.  
  25. if __name__ == '__main__':
  26.     Main()
Mar 12 '08 #3
jlm699
314 100+
Expand|Select|Wrap|Line Numbers
  1. self.SetSizerAndFit() # doesn't this need the sizer in () ?
  2.  
Doesn't that call need the sizer within the () ?
Mar 12 '08 #4
heh, i was at work when i typed the code up i didnt test it but yeah you're right self.SetSizerAndFit(sizerv) is the correct way ;p
Mar 12 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jim Shady | last post by:
Hi, I am looking at the feasibility in using wxPython on a project our company needs. I intend to show a bar graph in a frame. I can either generate an image and show it in a panel, or maybe...
1
by: wang xiaoyu | last post by:
Hello: i want use activex in wxpython program,but when i use MakeActiveXClass an exception occurs. this is my source code dealing the DICOM ocx.I must note that in this program "hwtxcontrol" is...
0
by: Piet | last post by:
Hello wxPythoneers. I have a problem with a dialog box derived from wxFrame which has a wxComboBox as main element. Depending on the entry selected from the ComboBox, the dialog box will be...
1
by: mdk.R | last post by:
Hello all: i'am installed wxPython 2.5 and Python2.3.4..i try execute script with wxPython but it show error: Traceback (most recent call last): File "E:\py\test.py", line 7, in ? import wx...
8
by: Jan Danielsson | last post by:
Hello all, I wanted to plot some statistics, so I wrote a simple wxPython class to do it. Then I realized that I would like to draw bar graphs, so I added that too. Since I'm a complete...
3
by: John Salerno | last post by:
I'm using the sample code of the file 'simple.py' and trying to make a single window with a panel in it, but I keep getting an error. Here's my code: (I know I might need something else, like a...
9
by: zxo102 | last post by:
Hi everyone, I am using a python socket server to collect data from a socket client and then control a image location ( wxpython) with the data, i.e. moving the image around in the wxpython frame....
9
by: Tyler | last post by:
Hello All: I am currently working on a project to create an FEM model for school. I was thinking about using wxPython to gather the 12 input variables from the user, then, after pressing the...
4
by: Marcpp | last post by:
Hi I need to call a widget from a button in WXPYTHON. I've tried to this from a function like this, but when push the button, the program opens a window and do error. Any idea? ...... def...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.