Hello, sorry about the lengthy message.
I finding difficult to execute this program. The wx.Notebook i created
is coming on the splitted frame(self.p2). How do I that. I am started
to learn wxPython, and when I run the code, the code doesnot close
gracefully, it throughs me an error.
"pythonw.exe has encountered a problem and needs to close. We are
sorry for the inconvenience"
I clicked for more information, then I got the error message which is
"AppName: pythonw.exe AppVer: 0.0.0.0 ModName: wxmsw26uh_vc.dll
ModVer: 2.6.3.3 Offset: 0016bb6f
<?xml version="1.0" encoding="UTF-16"?>
<DATABASE>
<EXE NAME="pythonw.exe" FILTER="GRABMI_FILTER_PRIVACY">
<MATCHING_FILE NAME="MSVCRT.dll" SIZE="290869"
CHECKSUM="0x46EE5D1C" BIN_FILE_VERSION="6.1.9359.0"
BIN_PRODUCT_VERSION="6.1.9359.0" PRODUCT_VERSION="6.10.9359.0"
FILE_DESCRIPTION="Microsoft (R) C Runtime Library"
COMPANY_NAME="Microsoft Corporation" PRODUCT_NAME="Microsoft (R) Visual
C++" FILE_VERSION="6.10.9359.0"
ORIGINAL_FILENAME="MSVCRT.DLL" INTERNAL_NAME="MSVCRT.DLL"
LEGAL_COPYRIGHT="Copyright (C) Microsoft Corp. 1981-1999"
VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x40004"
VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x48405"
LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="6.1.9359.0"
UPTO_BIN_PRODUCT_VERSION="6.1.9359.0" LINK_DATE="09/20/2001 21:52:56"
UPTO_LINK_DATE="09/20/2001 21:52:56" VER_LANGUAGE="English (United
States) [0x409]" />
..............."
here is the code.... seems a bit lengthy, sorry about that.
Please help me to find my mistake, and how do I go forward resolving
this problem. -
import wx
-
-
ID_ADD_NEW = 5001
-
ID_DEACTIVATE = 5002
-
ID_EXIT = 5003
-
-
class _AddNewFund(wx.Panel):
-
def __init__(self, parent):
-
wx.Panel.__init__(self, parent)
-
box=wx.StaticBox(self, -1, "Add New Fund")
-
boxsizer=wx.StaticBoxSizer(box, wx.HORIZONTAL)
-
-
t=wx.StaticText(self, -1, "Please select an Excel file to
-
upload new funds.", (20,20))
-
boxsizer.Add(t, 0, wx.TOP|wx.LEFT, 10)
-
t=wx.StaticText(self, -1, "This is page one content2", (20,40))
-
boxsizer.Add(t, 0, wx.TOP|wx.LEFT, 10)
-
-
self.text1=wx.TextCtrl(self, -1, "")
-
-
b1 = wx.Button(self, 10, " Browse ")
-
b2 = wx.Button(self, 10, " Upload ", (60, 20))
-
self.Bind(wx.EVT_BUTTON, self.OnBrowse, b1)
-
self.Bind(wx.EVT_BUTTON, self.OnUpload, b2)
-
b1.SetDefault()
-
b1.SetSize(b1.GetBestSize())
-
b2.SetSize(b2.GetBestSize())
-
-
grid1=wx.FlexGridSizer(0,2,0,0)
-
grid1.Add( self.text1, 0,
-
wx.ALIGN_CENTRE|wx.LEFT|wx.RIGHT|wx.TOP, 5 )
-
grid1.Add( b1, 0, wx.ALIGN_CENTRE|wx.LEFT|wx.RIGHT|wx.TOP, 5 )
-
#grid1.Add( b2, 0, wx.ALIGN_CENTRE|wx.LEFT|wx.RIGHT|wx.TOP, 5 )
-
border=wx.BoxSizer()
-
border.Add(boxsizer, 1, wx.EXPAND)
-
self.SetSizer(border)
-
boxsizer.Add(grid1, 0, wx.ALIGN_CENTRE)
-
border.Add(boxsizer, 0, wx.ALIGN_CENTRE)
-
#print "end ADD NEW class"
-
-
def OnBrowse(self, event):
-
self.dirname=""
-
d=wx.FileDialog(self, "Choose a file", self.dirname, "", "*.*",
-
wx.Open)
-
if d.ShowModal() == wx.ID_OK:
-
self.filename=d.GetFilename()
-
self.dirname=d.GetDirectory()
-
self.text1.WriteTest(join(os.path.join(self.dirname,
-
self.filename)))
-
d.Destroy()
-
-
def OnUpload(self, event):
-
pass
-
-
class ParentWindow(wx.Frame):
-
def __init__(self):
-
wx.Frame.__init__(self, None, -1, "Euro Fund manager")
-
self.createMenu()
-
self.Bind(wx.EVT_MENU, self.onAddnewfund, id=ID_ADD_NEW)
-
self.Bind(wx.EVT_MENU, self.onDeactivate, id=ID_DEACTIVATE)
-
self.Bind(wx.EVT_MENU, self.onExit, id=ID_EXIT)
-
self.spw=wx.SplitterWindow(self)
-
self.p1=wx.Panel(self.spw, style=wx.BORDER_NONE)
-
self.p1.SetBackgroundColour("white")
-
self.p2=wx.Panel(self.spw, style=wx.BORDER_NONE)
-
-
self.spw.SplitVertically(self.p1, self.p2, 200)
-
-
self.CreateStatusBar()
-
-
def createMenu(self):
-
menu=wx.Menu()
-
menu.Append(ID_ADD_NEW, "&Add new fund(s)", "Add new fund(s)")
-
menu.Append(ID_DEACTIVATE, "&Deactivate fund(s)", "Deactivate
-
fund(s)")
-
menu.AppendSeparator()
-
menu.Append(ID_EXIT, "E&xit", "Exit")
-
-
menubar=wx.MenuBar()
-
menubar.Append(menu, "&File")
-
self.SetMenuBar(menubar)
-
-
def onAddnewfund(self, event):
-
#p=wx.Panel(self.p2)
-
#print "panel created"
-
nb=wx.Notebook(self.p2)
-
#print "notebook created"
-
addPage=_AddNewFund(nb)
-
nb.AddPage(addPage, "Add new Fund")
-
#print "page got added"
-
sizer=wx.BoxSizer()
-
sizer.Add(nb, 1, wx.EXPAND)
-
self.p2.SetSizer(sizer)
-
#print "end of add function"
-
-
def onDeactivate(self, event): pass
-
-
def onExit(self, event):
-
self.Close()
-
-
-
app = wx.App()
-
frm=ParentWindow()
-
frm.SetSize((800,500))
-
frm.Show()
-
app.SetTopWindow(frm)
-
app.MainLoop()
-
-
thank you,
Regards,
kath 1 2166
kath wrote:
Hello, sorry about the lengthy message.
I finding difficult to execute this program. The wx.Notebook i created
is coming on the splitted frame(self.p2). How do I that. I am started
to learn wxPython, and when I run the code, the code doesnot close
gracefully, it throughs me an error.
"pythonw.exe has encountered a problem and needs to close. We are
sorry for the inconvenience"
I get a segmentation fault on Linux, after running the script, choosing
"Add new fund" from the menu, and then closing the application. I don't
get the segmentation fault if I merely start the app and close it.
here is the code.... seems a bit lengthy, sorry about that.
Please help me to find my mistake, and how do I go forward resolving
this problem.
You actually have several problems. But, the segmentation fault appears
to be directly related to the fact that you add boxsizer to the border
sizer twice.
Another problem is that you create the notebook every single time, and
add just one page to it, but you probably want just one notebook with
one or more pages.
--
pkm ~ http://paulmcnett.com This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: John Kinson |
last post by:
Hi,
I'm trying to get the wxPython demo to run on a Debian sarge testing
installation, but encounter the following error when I run the demo script:
# ./demo.py
Traceback (most recent call...
|
by: twsnnva |
last post by:
Could anyone give me an example (code) of a simple program with a button
that when clicked executes a linux shell or windows dos command like
"ifconfig" or "ipconfig" and prints the output...
|
by: Peter Maas |
last post by:
Recently I replaced Win2k with Linux on my desktop computer. Using mostly
multi-platform software I thought this would be easy. It was not as
easy as expected getting wxPython to work. There seemed...
|
by: Grzegorz |
last post by:
Hello, I'm using eclipse with pydev plugin, I'm working on a program using
wxpython .
When I'm executing that application standard error output does not show in
eclipse console window - wxpython...
|
by: Joseph |
last post by:
I've encountered a DB2 error that seems to be quite serious. This is from
DB2 7.2.5 running on Windows 2000 Server. Here are the entries from
the db2diag.log file (with database name changed per...
|
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....
|
by: f rom |
last post by:
----- Forwarded Message ----
From: Josiah Carlson <jcarlson@uci.edu>
To: f rom <etaoinbe@yahoo.com>; wxpython-users@lists.wxwidgets.org
Sent: Monday, December 4, 2006 10:03:28 PM
Subject: Re: ...
|
by: Kevin Walzer |
last post by:
I'm porting a Tkinter application to wxPython and had a question about
wxPython's event loop.
The Tkinter app provides a GUI to a command-line tool. It gathers user
input, and opens an...
|
by: Stef Mientki |
last post by:
Peter Anderson wrote:
In PyScripter, you should run wxPython in the plain remote machine (not
the wxPython remote),
and you should set "reset before run flag" or reset the remote machine
each...
|
by: Kemmylinns12 |
last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
|
by: Naresh1 |
last post by:
What is WebLogic Admin Training?
WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
|
by: Carina712 |
last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
|
by: BLUEPANDA |
last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
|
by: Ricardo de Mila |
last post by:
Dear people, good afternoon...
I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control.
Than I need to discover what...
|
by: Johno34 |
last post by:
I have this click event on my form. It speaks to a Datasheet Subform
Private Sub Command260_Click()
Dim r As DAO.Recordset
Set r = Form_frmABCD.Form.RecordsetClone
r.MoveFirst
Do
If...
|
by: ezappsrUS |
last post by:
Hi,
I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
|
by: jack2019x |
last post by:
hello, Is there code or static lib for hook swapchain present?
I wanna hook dxgi swapchain present for dx11 and dx9.
|
by: DizelArs |
last post by:
Hi all)
Faced with a problem, element.click() event doesn't work in Safari browser.
Tried various tricks like emulating touch event through a function:
let clickEvent = new Event('click', {...
| |