473,327 Members | 1,976 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,327 software developers and data experts.

Problem using wxPython

Hi,
i have a GUI and my GUI Toolkit is wxPython. Now when the GUI opens...whatever tabs and buttons i click...an action is performed. Each mouse click is an event and it is processed in the script accordingly.

Now i want to operate that GUI without using the mouse..i'e thru my script....

for example...in the original python script...there is a function "OnBrowseForReport Directory". When i click on the tab for browse in the GUI....a dialog opens from where i can choose my report directory and click on OK. The directory gets chosen...but all these actions are performed on the click of the mouse...i.e manually. I want to automate the entire thing...i.e I want to open the dialog thru my own python script and choose the directory without clicking on the "OK" tab...i.e thru my script.....i want to use the underlyting fumction "OnBrowseForReport Directory"...

Plz help...it's urgent!!
Apr 2 '07 #1
19 1896
bartonc
6,596 Expert 4TB
Hi,
i have a GUI and my GUI Toolkit is wxPython. Now when the GUI opens...whatever tabs and buttons i click...an action is performed. Each mouse click is an event and it is processed in the script accordingly.

Now i want to operate that GUI without using the mouse..i'e thru my script....

for example...in the original python script...there is a function "OnBrowseForReport Directory". When i click on the tab for browse in the GUI....a dialog opens from where i can choose my report directory and click on OK. The directory gets chosen...but all these actions are performed on the click of the mouse...i.e manually. I want to automate the entire thing...i.e I want to open the dialog thru my own python script and choose the directory without clicking on the "OK" tab...i.e thru my script.....i want to use the underlyting fumction "OnBrowseForReport Directory"...

Plz help...it's urgent!!
"OnBrowseForReport Directory" can't really be the name because of the space in there (I'll use "OnBrowseForReport" in my explanation:
The easiest way to do this is to add a button (or menu item, or whaterver) to start the action you want. Then you can call self.OnBrowseForReport(None) as long as the event handler never calls any event.WhatEver()s. And so on, until all actions are complete.
Apr 2 '07 #2
"OnBrowseForReport Directory" can't really be the name because of the space in there (I'll use "OnBrowseForReport" in my explanation:
The easiest way to do this is to add a button (or menu item, or whaterver) to start the action you want. Then you can call self.OnBrowseForReport(None) as long as the event handler never calls any event.WhatEver()s. And so on, until all actions are complete.
Cudn't get u...let me explain it a bit....
thr's one function which looks like this
Expand|Select|Wrap|Line Numbers
  1.  
  2.     def OnBrowseForDeviceWrapperFile(self, event):
  3.         '''Allows the user to select a 'device wrapper' file via a dialog.'''
  4.  
  5.         dlg = wx.FileDialog(
  6.             self, message="Choose a Device Wrapper file",
  7.             wildcard=deviceWrapperFileFilter, style=wx.OPEN|wx.CHANGE_DIR)
  8.  
  9.         if dlg.ShowModal() == wx.ID_OK:
  10.  
  11.             # get the new filename from the dialog, then update the test setup
  12.             # and GUI to reflect the change...
  13.             filename = dlg.GetPath()
  14.             self.testSetup.DeviceWrapperFilename = filename
  15.             self.textCtrls['DeviceWrapperFilename'].SetValue(filename)
  16.             self.refreshSetupModifiedFlag()
  17.  
  18.         dlg.Destroy()
  19.  
this function takes an event as input. I don't want to select the directory using mouse click.
How do i go about it??
Apr 2 '07 #3
bartonc
6,596 Expert 4TB
Cudn't get u...let me explain it a bit....
thr's one function which looks like this
Expand|Select|Wrap|Line Numbers
  1.  
  2.     def OnBrowseForDeviceWrapperFile(self, event):
  3.         '''Allows the user to select a 'device wrapper' file via a dialog.'''
  4.  
  5.         dlg = wx.FileDialog(
  6.             self, message="Choose a Device Wrapper file",
  7.             wildcard=deviceWrapperFileFilter, style=wx.OPEN|wx.CHANGE_DIR)
  8.  
  9.         if dlg.ShowModal() == wx.ID_OK:
  10.  
  11.             # get the new filename from the dialog, then update the test setup
  12.             # and GUI to reflect the change...
  13.             filename = dlg.GetPath()
  14.             self.testSetup.DeviceWrapperFilename = filename
  15.             self.textCtrls['DeviceWrapperFilename'].SetValue(filename)
  16.             self.refreshSetupModifiedFlag()
  17.  
  18.         dlg.Destroy()
  19.  
this function takes an event as input. I don't want to select the directory using mouse click.
How do i go about it??
You may want to consider refactoring.
Let's see if I can explain:
Presumably, OnBrowseForDeviceWrapperFile() is caused by a button or menu, etc., which gives an interactive (file dialog) means of getting file name.

If you have the file name already you would refactor thusly:
Expand|Select|Wrap|Line Numbers
  1.  
  2.     def OnBrowseForDeviceWrapperFile(self, event):
  3.         '''Allows the user to select a 'device wrapper' file via a dialog.'''
  4.          filename = ""  # Use  filename as a flag
  5.         dlg = wx.FileDialog(
  6.             self, message="Choose a Device Wrapper file",
  7.             wildcard=deviceWrapperFileFilter, style=wx.OPEN|wx.CHANGE_DIR)
  8.  
  9.         if dlg.ShowModal() == wx.ID_OK:
  10.  
  11.             # get the new filename from the dialog, then update the test setup
  12.             # and GUI to reflect the change...
  13.             filename = dlg.GetPath()
  14.         dlg.Destroy()  # best to do this sooner than later
  15.  
  16.         if filename:
  17.             self.UpdateInterface(filename)
  18.  
  19.     def UpdateInterface(self, filename):
  20.         self.testSetup.DeviceWrapperFilename = filename
  21.         self.textCtrls['DeviceWrapperFilename'].SetValue(filename)
  22.         self.refreshSetupModifiedFlag()
  23.  
By refactoring, you make the update code available to other methods.

If you don't already have the file name and you are trying to (say) start your program with command-line arguments, those will be availble in the first module that is used to launch your program as in
Expand|Select|Wrap|Line Numbers
  1. # file 'MyModule.py'
  2. import sys
  3. print sys.argv
The first argument is always the name of the first module as in
Expand|Select|Wrap|Line Numbers
  1. python 'MyModule.py
['MyModule.py']
Apr 2 '07 #4
You may want to consider refactoring.
Let's see if I can explain:
Presumably, OnBrowseForDeviceWrapperFile() is caused by a button or menu, etc., which gives an interactive (file dialog) means of getting file name.

If you have the file name already you would refactor thusly:
Expand|Select|Wrap|Line Numbers
  1.  
  2.     def OnBrowseForDeviceWrapperFile(self, event):
  3.         '''Allows the user to select a 'device wrapper' file via a dialog.'''
  4.          filename = ""  # Use  filename as a flag
  5.         dlg = wx.FileDialog(
  6.             self, message="Choose a Device Wrapper file",
  7.             wildcard=deviceWrapperFileFilter, style=wx.OPEN|wx.CHANGE_DIR)
  8.  
  9.         if dlg.ShowModal() == wx.ID_OK:
  10.  
  11.             # get the new filename from the dialog, then update the test setup
  12.             # and GUI to reflect the change...
  13.             filename = dlg.GetPath()
  14.         dlg.Destroy()  # best to do this sooner than later
  15.  
  16.         if filename:
  17.             self.UpdateInterface(filename)
  18.  
  19.     def UpdateInterface(self, filename):
  20.         self.testSetup.DeviceWrapperFilename = filename
  21.         self.textCtrls['DeviceWrapperFilename'].SetValue(filename)
  22.         self.refreshSetupModifiedFlag()
  23.  
By refactoring, you make the update code available to other methods.

If you don't already have the file name and you are trying to (say) start your program with command-line arguments, those will be availble in the first module that is used to launch your program as in
Expand|Select|Wrap|Line Numbers
  1. # file 'MyModule.py'
  2. import sys
  3. print sys.argv
The first argument is always the name of the first module as in
Expand|Select|Wrap|Line Numbers
  1. python 'MyModule.py
['MyModule.py']

Hi,
I did what u had asked, when i call the function "OnBrowseForDeviceWrapperFile", it opens a dialog but i have to manually select the file and click on open. It is not doing it on it's own.
Apr 3 '07 #5
bartonc
6,596 Expert 4TB
Hi,
I did what u had asked, when i call the function "OnBrowseForDeviceWrapperFile", it opens a dialog but i have to manually select the file and click on open. It is not doing it on it's own.
I suggested that you use
Expand|Select|Wrap|Line Numbers
  1.     def UpdateInterface(self, filename):
  2.         self.testSetup.DeviceWrapperFilename = filename
  3.         self.textCtrls['DeviceWrapperFilename'].SetValue(filename)
  4.         self.refreshSetupModifiedFlag()
  5.  
and call it
Expand|Select|Wrap|Line Numbers
  1. self.UpdateInterface(aKnownFileName)
Apr 3 '07 #6
I suggested that you use
Expand|Select|Wrap|Line Numbers
  1.     def UpdateInterface(self, filename):
  2.         self.testSetup.DeviceWrapperFilename = filename
  3.         self.textCtrls['DeviceWrapperFilename'].SetValue(filename)
  4.         self.refreshSetupModifiedFlag()
  5.  
and call it
Expand|Select|Wrap|Line Numbers
  1. self.UpdateInterface(aKnownFileName)
i called UpdateInterface with a known filename sa input...this time the dialog did not open ...however the GUI remained empty i.e the column where the file name(after it is selected thru the GUI) is reflected, remained vacent.
Apr 3 '07 #7
bartonc
6,596 Expert 4TB
i called UpdateInterface with a known filename sa input...this time the dialog did not open ...however the GUI remained empty i.e the column where the file name(after it is selected thru the GUI) is reflected, remained vacent.
Thats odd. If it works one way (file dialog get file name) it will work the other.
Try
Expand|Select|Wrap|Line Numbers
  1.     def UpdateInterface(self, filename):
  2.         print filename
  3.         self.testSetup.DeviceWrapperFilename = filename
  4.         self.textCtrls['DeviceWrapperFilename'].SetValue(filename)
  5.         self.refreshSetupModifiedFlag()
  6.  
as a quick debugging test. If filename gets printed, it should also be Set in the TextCtrl.

Are you working in an IDE that will show you if an error occured?
Apr 3 '07 #8
Thats odd. If it works one way (file dialog get file name) it will work the other.
Try
Expand|Select|Wrap|Line Numbers
  1.     def UpdateInterface(self, filename):
  2.         print filename
  3.         self.testSetup.DeviceWrapperFilename = filename
  4.         self.textCtrls['DeviceWrapperFilename'].SetValue(filename)
  5.         self.refreshSetupModifiedFlag()
  6.  
as a quick debugging test. If filename gets printed, it should also be Set in the TextCtrl.

Are you working in an IDE that will show you if an error occured?
Hi,
My script looks something like this
Expand|Select|Wrap|Line Numbers
  1. import traceback
  2. import thread
  3. import pst
  4. import petShopTest
  5.  
  6. class newclass:
  7.  
  8.     def __init__(self):
  9.         newApp = petShopTest.MyApp(0)
  10.         newFrame = petShopTest.MyFrame(None, -1, "PetShopTest")
  11.         self.testsetup = pst.TestSetup()
  12.         self.Log = logging.getLogger('GUI')
  13.         path = "c:\pst\pst_modified\Flash_Test.py"
  14.         path1 = "c:\pst\pst_modified\DeviceCommsLayer_984_v6_00.py"
  15.         path2 = "c:\python23"
  16.  
  17.  
  18.         newFrame.UpdateInterfaceForDeviceWrapper(path1)
  19.  
  20.         newApp.MainLoop()
  21.  
  22.  
and the UpdateInterfaceForDeviceWrapper function looks like this:
Expand|Select|Wrap|Line Numbers
  1.     def UpdateInterfaceForDeviceWrapper(self,filename):
  2.         print filename
  3.         print "in update"    
  4.         self.testSetup.DeviceWrapperFilename = filename
  5.         self.textCtrls['DeviceWrapperFilename'].SetValue(filename)
  6.         self.refreshSetupModifiedFlag()
  7.  
i am executing this on python command promt window like this:

Expand|Select|Wrap|Line Numbers
  1. import myfilename
  2. myfilename.newclass()
  3.  
and it shows the following:

Expand|Select|Wrap|Line Numbers
  1. c:\pst\pst_modified\DeviceCommsLayer_984_v6_00.py
  2. in update
  3.  
  4.  
and nothing appears on the GUI...the GUI remains vacant!!:(
It's not showing any errors.
Apr 3 '07 #9
bartonc
6,596 Expert 4TB
Hi,
My script looks something like this
Expand|Select|Wrap|Line Numbers
  1. import traceback
  2. import thread
  3. import pst
  4. import petShopTest
  5.  
  6. class newclass:
  7.  
  8.     def __init__(self):
  9.         newApp = petShopTest.MyApp(0)
  10.         newFrame = petShopTest.MyFrame(None, -1, "PetShopTest")
  11.         self.testsetup = pst.TestSetup()
  12.         self.Log = logging.getLogger('GUI')
  13.         path = "c:\pst\pst_modified\Flash_Test.py"
  14.         path1 = "c:\pst\pst_modified\DeviceCommsLayer_984_v6_00.py"
  15.         path2 = "c:\python23"
  16.  
  17.  
  18.         newFrame.UpdateInterfaceForDeviceWrapper(path1)
  19.  
  20.         newApp.MainLoop()
  21.  
  22.  
and the UpdateInterfaceForDeviceWrapper function looks like this:
Expand|Select|Wrap|Line Numbers
  1.     def UpdateInterfaceForDeviceWrapper(self,filename):
  2.         print filename
  3.         print "in update"    
  4.         self.testSetup.DeviceWrapperFilename = filename
  5.         self.textCtrls['DeviceWrapperFilename'].SetValue(filename)
  6.         self.refreshSetupModifiedFlag()
  7.  
i am executing this on python command promt window like this:

Expand|Select|Wrap|Line Numbers
  1. import myfilename
  2. myfilename.newclass()
  3.  
and it shows the following:

Expand|Select|Wrap|Line Numbers
  1. c:\pst\pst_modified\DeviceCommsLayer_984_v6_00.py
  2. in update
  3.  
  4.  
and nothing appears on the GUI...the GUI remains vacant!!:(
It's not showing any errors.
That helps a lot!
Mainloop() has to be running before widgets will act.
Expand|Select|Wrap|Line Numbers
  1. class newclass:
  2.  
  3.     def __init__(self):
  4.         newApp = petShopTest.MyApp(0)
  5.         self.newFrame = newFrame = petShopTest.MyFrame(None, -1, "PetShopTest")
  6.         self.testsetup = pst.TestSetup()
  7.         self.Log = logging.getLogger('GUI')
  8.         path = "c:\pst\pst_modified\Flash_Test.py"
  9.         path1 = "c:\pst\pst_modified\DeviceCommsLayer_984_v6_00.py"
  10.         path2 = "c:\python23"
  11.  
  12.  
  13.         wx.FutureCall(100, self.SendFileName)
  14.  
  15.         newApp.MainLoop()
  16.  
  17.     def SendFileName(self):
  18.         self.newFrame.UpdateInterfaceForDeviceWrapper(path1)
But if you are calling from the command-line, why not
Expand|Select|Wrap|Line Numbers
  1. import sys
  2.  
  3.  
  4.         wx.FutureCall(100, self.GetFileName)
  5.  
  6.         newApp.MainLoop()
  7.  
  8.     def GetFileName(self):
  9.         filename = sys.argv[1]
  10.         self.newFrame.UpdateInterfaceForDeviceWrapper(filename)
python TestWhatever c:\pst\pst_modified\DeviceCommsLayer_984_v6_00.py
Apr 3 '07 #10
That helps a lot!
Mainloop() has to be running before widgets will act.
Expand|Select|Wrap|Line Numbers
  1. class newclass:
  2.  
  3.     def __init__(self):
  4.         newApp = petShopTest.MyApp(0)
  5.         self.newFrame = newFrame = petShopTest.MyFrame(None, -1, "PetShopTest")
  6.         self.testsetup = pst.TestSetup()
  7.         self.Log = logging.getLogger('GUI')
  8.         path = "c:\pst\pst_modified\Flash_Test.py"
  9.         path1 = "c:\pst\pst_modified\DeviceCommsLayer_984_v6_00.py"
  10.         path2 = "c:\python23"
  11.  
  12.  
  13.         wx.FutureCall(100, self.SendFileName)
  14.  
  15.         newApp.MainLoop()
  16.  
  17.     def SendFileName(self):
  18.         self.newFrame.UpdateInterfaceForDeviceWrapper(path1)
But if you are calling from the command-line, why not
Expand|Select|Wrap|Line Numbers
  1. import sys
  2.  
  3.  
  4.         wx.FutureCall(100, self.GetFileName)
  5.  
  6.         newApp.MainLoop()
  7.  
  8.     def GetFileName(self):
  9.         filename = sys.argv[1]
  10.         self.newFrame.UpdateInterfaceForDeviceWrapper(filename)
python TestWhatever c:\pst\pst_modified\DeviceCommsLayer_984_v6_00.py
Did according to what u suggested. No change in the output. It is the same as before: :(
Expand|Select|Wrap|Line Numbers
  1. c:\pst\pst_modified\DeviceCommsLayer_984_v6_00.py
  2. in update
  3.  
and nothing was reflected in the GUI!! :(
Apr 3 '07 #11
bartonc
6,596 Expert 4TB
Did according to what u suggested. No change in the output. It is the same as before: :(
Expand|Select|Wrap|Line Numbers
  1. c:\pst\pst_modified\DeviceCommsLayer_984_v6_00.py
  2. in update
  3.  
and nothing was reflected in the GUI!! :(
I'll try to get some time to work up some running code later on today or tonight.
This one has me baffled, because that should have worked.
Apr 3 '07 #12
I'll try to get some time to work up some running code later on today or tonight.
This one has me baffled, because that should have worked.
Hi,
Did u see it?? it's still not working!!
Apr 4 '07 #13
I'll try to get some time to work up some running code later on today or tonight.
This one has me baffled, because that should have worked.
Hi,
Please help me out with the problem. Did u find some way out of it??
Apr 9 '07 #14
bartonc
6,596 Expert 4TB
Hi,
Please help me out with the problem. Did u find some way out of it??
I did a test:
Expand|Select|Wrap|Line Numbers
  1. #Boa:Frame:Frame2
  2.  
  3. import wx
  4.  
  5. def create(parent):
  6.     return Frame1(parent)
  7.  
  8. [wxID_FRAME1, wxID_FRAME1PANEL1, wxID_FRAME1TEXTCTRL1,
  9. ] = [wx.NewId() for _init_ctrls in range(3)]
  10.  
  11. class Frame1(wx.Frame):
  12.     def _init_sizers(self):
  13.         # generated method, don't edit
  14.         self.boxSizer1 = wx.BoxSizer(orient=wx.VERTICAL)
  15.  
  16.         self._init_coll_boxSizer1_Items(self.boxSizer1)
  17.  
  18.         self.SetSizer(self.boxSizer1)
  19.  
  20.  
  21.     def _init_coll_boxSizer1_Items(self, parent):
  22.         # generated method, don't edit
  23.  
  24.         parent.AddWindow(self.panel1, 1, border=0, flag=wx.EXPAND)
  25.  
  26.     def _init_ctrls(self, prnt):
  27.         # generated method, don't edit
  28.         wx.Frame.__init__(self, id=wxID_FRAME1, name='', parent=prnt, pos=wx.Point(22, 22),
  29.                 size=wx.Size(400, 250), style=wx.DEFAULT_FRAME_STYLE, title='Frame1')
  30.         self.SetClientSize(wx.Size(392, 223))
  31.  
  32.         self.panel1 = wx.Panel(id=wxID_FRAME1PANEL1, name='panel1', parent=self, pos=wx.Point(0, 0),
  33.                 size=wx.Size(392, 223), style=wx.TAB_TRAVERSAL)
  34.  
  35.         self.textCtrl1 = wx.TextCtrl(id=wxID_FRAME1TEXTCTRL1, name='textCtrl1', parent=self.panel1,
  36.                 pos=wx.Point(16, 72), size=wx.Size(360, 21), style=0, value='')
  37.  
  38.         self._init_sizers()
  39.  
  40.     def __init__(self, parent):
  41.         self._init_ctrls(parent)
  42.  
Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/env python
  2. #Boa:App:BoaApp
  3.  
  4. import wx
  5.  
  6. import Frame2
  7.  
  8. modules ={u'Frame2': [1, 'Main frame of Application', u'Frame2.py']}
  9.  
  10. class BoaApp(wx.App):
  11.     def OnInit(self):
  12.         self.main = Frame2.create(None)
  13.         ## this is NOT good OOP encapulation, but it works ##
  14.         self.main.textCtrl1.SetValue('this is a test')
  15.         #                                                   #
  16.         self.main.Show()
  17.         self.SetTopWindow(self.main)
  18.         return True
  19.  
  20. def main():
  21.     application = BoaApp(0)
  22.     application.MainLoop()
  23.  
  24. if __name__ == '__main__':
  25.     main()
  26.  
I can set the TextCtrl Value while the app is being initialized.
Apr 9 '07 #15
I did a test:
Expand|Select|Wrap|Line Numbers
  1. #Boa:Frame:Frame2
  2.  
  3. import wx
  4.  
  5. def create(parent):
  6.     return Frame1(parent)
  7.  
  8. [wxID_FRAME1, wxID_FRAME1PANEL1, wxID_FRAME1TEXTCTRL1,
  9. ] = [wx.NewId() for _init_ctrls in range(3)]
  10.  
  11. class Frame1(wx.Frame):
  12.     def _init_sizers(self):
  13.         # generated method, don't edit
  14.         self.boxSizer1 = wx.BoxSizer(orient=wx.VERTICAL)
  15.  
  16.         self._init_coll_boxSizer1_Items(self.boxSizer1)
  17.  
  18.         self.SetSizer(self.boxSizer1)
  19.  
  20.  
  21.     def _init_coll_boxSizer1_Items(self, parent):
  22.         # generated method, don't edit
  23.  
  24.         parent.AddWindow(self.panel1, 1, border=0, flag=wx.EXPAND)
  25.  
  26.     def _init_ctrls(self, prnt):
  27.         # generated method, don't edit
  28.         wx.Frame.__init__(self, id=wxID_FRAME1, name='', parent=prnt, pos=wx.Point(22, 22),
  29.                 size=wx.Size(400, 250), style=wx.DEFAULT_FRAME_STYLE, title='Frame1')
  30.         self.SetClientSize(wx.Size(392, 223))
  31.  
  32.         self.panel1 = wx.Panel(id=wxID_FRAME1PANEL1, name='panel1', parent=self, pos=wx.Point(0, 0),
  33.                 size=wx.Size(392, 223), style=wx.TAB_TRAVERSAL)
  34.  
  35.         self.textCtrl1 = wx.TextCtrl(id=wxID_FRAME1TEXTCTRL1, name='textCtrl1', parent=self.panel1,
  36.                 pos=wx.Point(16, 72), size=wx.Size(360, 21), style=0, value='')
  37.  
  38.         self._init_sizers()
  39.  
  40.     def __init__(self, parent):
  41.         self._init_ctrls(parent)
  42.  
Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/env python
  2. #Boa:App:BoaApp
  3.  
  4. import wx
  5.  
  6. import Frame2
  7.  
  8. modules ={u'Frame2': [1, 'Main frame of Application', u'Frame2.py']}
  9.  
  10. class BoaApp(wx.App):
  11.     def OnInit(self):
  12.         self.main = Frame2.create(None)
  13.         ## this is NOT good OOP encapulation, but it works ##
  14.         self.main.textCtrl1.SetValue('this is a test')
  15.         #                                                   #
  16.         self.main.Show()
  17.         self.SetTopWindow(self.main)
  18.         return True
  19.  
  20. def main():
  21.     application = BoaApp(0)
  22.     application.MainLoop()
  23.  
  24. if __name__ == '__main__':
  25.     main()
  26.  
I can set the TextCtrl Value while the app is being initialized.
Hi,
This does not serve my purpose. I want to set some value in a box thru my script which wud have ,otherwise,been set by clicking on a browse tab and then selecting a file by a mouse click.
Apr 9 '07 #16
bartonc
6,596 Expert 4TB
Hi,
This does not serve my purpose. I want to set some value in a box thru my script which wud have ,otherwise,been set by clicking on a browse tab and then selecting a file by a mouse click.
It may not serve your purpose, but it shows you that you should be able to set the Value of a TextCtrl from outside the frame that creates it.

And since you have not provided the frame to work on, this is the best that I could whip up in order to show you.
Apr 9 '07 #17
bartonc
6,596 Expert 4TB
It may not serve your purpose, but it shows you that you should be able to set the Value of a TextCtrl from outside the frame that creates it.

And since you have not provided the frame to work on, this is the best that I could whip up in order to show you.
This may be of interest to you:
wxApp::argv
wxChar ** argv

Command line arguments (after environment-specific processing).
Apr 9 '07 #18
This may be of interest to you:
wxApp::argv
wxChar ** argv

Command line arguments (after environment-specific processing).
hey hi...
the code snippet u had posted as an example worked. I created a GUI of my own...rather than using the already available one.It's working the way i wanted it to....:)
thanks!! :)
Apr 16 '07 #19
bartonc
6,596 Expert 4TB
hey hi...
the code snippet u had posted as an example worked. I created a GUI of my own...rather than using the already available one.It's working the way i wanted it to....:)
thanks!! :)
That's awesome. I am SO glad that you got it working.

Thanks for the update,
Barton
Apr 16 '07 #20

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

Similar topics

0
by: RJS | last post by:
Hi all, I can't get a py2exe compiled app to run with numarray (numarray-0.5.win32- py2.2). Also wxPythonWIN32-2.3.3.1-Py22 and ActivePython-2.2.1-222. In the sample below, commenting out...
0
by: Doug Farrell | last post by:
Hi all, I just installed the wxPython-2.4.1.2 demo RPM on my RedHat Linux 9.0 machine, which has Python 2.2.2 on it, and I'm having a problem running the demo.py program. Here is a trace of the...
0
by: achrist | last post by:
I've just installed the new wxPython, version 2.4.2.4 (under Windows NT, sp6, python 2.3.2) and tried to create an exe using the McMillan installer. Seems to be a new problem ... I've got the...
0
by: Russell Reagan | last post by:
I installed wxPython 2.4.2.4 from the prebuilt binary for Windows. I am using the Cygwin version of Python 2.3.2. After installing wxPython, I ran the minimal window script:...
1
by: timothy.williams | last post by:
I'm trying to install wxPython 2.5.3.1 using Python 2.3.2 on a Fedora 2 machine. I have python in a non-standard place, but I'm using --prefix with the configure script to point to where I have...
3
by: Kenneth McDonald | last post by:
If this is not an appropriate newsgroup for this type of posting, please let me know and (if possible) suggest an alternative. I've done a fair bit of research on the net, but information is...
1
by: Francach | last post by:
Hi, I'm using python 2.4.1, wxPython 2.6.1.0 and py2exe 1.6.3 on Windows XP. My script runs fine with python, but the .exe produced with py2exe crashes out with: Traceback (most recent...
4
by: BH | last post by:
Hi ! I have a small problem with wx.Grid and scrollbars. Scrollbars definitively dissapears after resizing the frame. Thx for help ...
3
by: gatoruss | last post by:
Newbie here with a (hopefully not) dumb question....tried searching around on the 'Net without success, so here goes.... I have been playing around with python. I wrote a script that sends an smtp...
0
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.