Win XP, Python 2.5, wxPython 2.8 /ansi using Scipy and Pylab
humm difficult. I will try. It is inside big code - a workbench based on wxpython.
I started a small workbench based on Scipy and wxPython. May be you would be interested to give opinion/Advises?
It will be out in few days as alpha but I am struggling with sourceforge upload system …
Best Regards,
Robert
wxPython-users-digest-help@lists.wxwidgets.org a écrit :
···
wxPython-users Digest 19 Jan 2007 18:53:48 -0000 Issue 1831
Topics (messages 60237 through 60266):
Status
60237 by: Returned mailRe: Upgraded System, New Error Generated
60238 by: Robin
Dunn
60244 by: Werner F. Bruhin
60258 by: Rich Shepard
60261 by: Tim Roberts
60262 by: Robin Dunn
60263 by: Robin DunnRe: memory usage and custom compilation
60239 by: Robin Dunn
60255 by: Christopher Barker
60256 by: Christopher Barker
60266 by: Robin DunnRe: Q: .PopupMenu…
60240 by: Robin DunnRe: capturing video snapshots
60241 by: Robin DunnRe: What Versions of GTK+ Have Problems?
60242 by: Robin Dunn
60249 by: Rich ShepardRe: weirdness in TreeCtrl
60243 by: Robin Dunn
60253 by: Danny Shevitzpass varialbe to a standalone executable
60245 by: Ye Naiquan
60260 by: Robin DunnSubthreads updating widgets in main loop
60246 by: Frank Aune
60251 by: Chris Melloncombox inside collapsible pane do not want to refresh list at runtime
60247 by: Robert VERGNES
60264 by: Robin DunnRe: PluginMixin proposal #2
60248 by:
Philippe C. MartinListCtrl problem
60250 by: Igor Jese
60265 by: Robin DunnRe: Select item without triggering event handler
60252 by: Peter Damoc
60254 by: Igor JeseRe: Multiline Text Input in Grid Cell?
60257 by: wccpppRe: PluginMixin proposal #1
60259 by: Kevin OllivierAdministrivia:
To subscribe to the digest, e-mail:
To unsubscribe from the digest, e-mail:
To post to the list, e-mail:
De: “Returned mail” noreply@lists.wxwindows.org
À: wxpython-users@lists.wxwindows.org
Date: Thu, 18 Jan 2007 22:43:24 -0600
Objet: StatusThis message has been processed by Symantec AntiVirus.
readme.htm .pif was infected with the malicious virus W32.Mydoom!gen and has been deleted because the file cannot be cleaned.
De: “Returned mail” noreply@lists.wxwindows.org
À: wxpython-users@lists.wxwindows.org
Objet: Status
Date: Thu, 18 Jan 2007 22:43:24 -0600This message was undeliverable due to the following reason:
Your message was not delivered because the destination server was
unreachable within the allowed queue period. The amount of time
a message is queued before it is returned depends on local configura-
tion parameters.Most likely there is a network problem that prevented delivery, but
it is also possible that the computer is turned off, or does not
have a mail system running right now.Your message could not be delivered within
4 days:
Host 210.146.212.132 is not responding.The following recipients could not receive this message:
Please reply to postmaster@lists.wxwindows.org
if you feel this message to be in error.Date: Thu, 18 Jan 2007 23:46:43 -0800
De: Robin Dunn robin@alldunn.com
À: wxPython-users@lists.wxwidgets.org
Objet: Re: [wxPython-users] Upgraded System, New Error GeneratedRich Shepard wrote:
On Thu, 18 Jan 2007, Rich Shepard wrote:
What I now have is this:
I’ve checked the new API docs for DirDialog and FileDialog and ensured
that I’m calling them correctly. But, the function is still not working.The latest changes:
def openFile(self, event):
wd = wx.DirDialog(None, “Choose a default directory:”,
defaultPath=“.”,
style=wx.DD_DEFAULT_STYLE)Now, as soon as the function is called, the console displays this
message:(python:9274): Gtk-CRITICAL **: gtk_file_system_unix_get_folder:
assertion `g_path_is_absolute (filename)’ failedJust a guess based on the message, but try using defaultPath=os.getcwd()
instead of ‘.’. Sounds to me like it is wanting a full pathname.Pressing the “OK” button does nothing. Pressing the “Cancel” button
closes
the dialog box and brings up the FileDialog. That seems backward to me.Not sure what’s going on with the OK button, maybe it’s a bug caused by
the error above. However the way you have the code organized it is
setup to go to the file dialog no matter what the result of the dir
dialog is. A bit of reorg and simplification of the code will probably
help it make more sense to you:def
openFile(self, event):
wd = wx.DirDialog(None, “Choose a default directory:”,
defaultPath=“.”,
style=wx.DD_DEFAULT_STYLE)
if wd.ShowModal() == wx.ID_OK:
self.appData.dirname = wd.GetPath()
wildcard = ‘Project databases (.db)|.db|’
dlg = wx.FileDialog(None, “Choose a project”,
self.appData.dirname,
wildcard=wildcard,
style=wx.FD_OPEN|wx.FD_CHANGE_DIR)
if wd.ShowModal() == wx.ID_OK:
self.appData.projname=dlg.GetFilename()
self.appData.dirname=dlg.GetDirectory()
self.appData.dbFileName=dlg.GetFilename()
titleStr = self.appData.projname[:-4]
self.SetTitle((‘FuzzyEI-Assessor: - %s’) %
self.appData.projname)dlg.Destroy()
wd.Destroy()Regardless, when I then double-click on a file name, rather than
displaying that name in the appropriate widget and loading other data from
the database tables, the same error message as before is displayed; that
is,Traceback (most recent call last):
File “/data1/eikos/modelPage.py”, line 201, in OnOpenMod
pName = functions.openFile(self, event)
File “/data1/eikos/functions.py”, line 51, in openFile
self.SetTitle((‘FuzzyEI-Assessor: - %s’) % self.appData.projname)
AttributeError: ‘modModel’ object has no attribute ‘SetTitle’What is the type of self? Does that class have a SetTitle method?
–
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!Date: Fri, 19 Jan 2007 10:14:53 +0100
De: “Werner F. Bruhin” werner.bruhin@free.fr
À: wxPython-users@lists.wxwidgets.org
Objet: Re: [wxPython-users] Upgraded System, New Error GeneratedHi Robin and Rich,
I think there is a little copy/paste error in the code, see below.
Robin Dunn wrote:
…
Not sure what’s going on with the OK button, maybe it’s a bug caused
by the error above. However the way you have the code organized it is
setup to go to the file dialog no matter what the result of the dir
dialog is. A bit of reorg and simplification of the code will
probably help it make more sense to you:def openFile(self, event):
wd = wx.DirDialog(None, “Choose a default directory:”,
defaultPath=“.”,
style=wx.DD_DEFAULT_STYLE)
if wd.ShowModal() == wx.ID_OK:
self.appData.dirname = wd.GetPath()
wildcard = ‘Project databases
(.db)|.db|’
dlg = wx.FileDialog(None, “Choose a project”,
self.appData.dirname,
wildcard=wildcard,
style=wx.FD_OPEN|wx.FD_CHANGE_DIR)
if wd.ShowModal() == wx.ID_OK:
I think above should use dlg and not wd:
if dlg.ShowModal() == wx.ID_OK:
self.appData.projname=dlg.GetFilename()
self.appData.dirname=dlg.GetDirectory()
self.appData.dbFileName=dlg.GetFilename()
titleStr = self.appData.projname[:-4]
self.SetTitle((‘FuzzyEI-Assessor: - %s’) %
self.appData.projname)
dlg.Destroy()
wd.Destroy()I use try/finally with dialogs to ensure that they always get destroyed,
a habit I picked from Boa which generates the dialog code along
these lines.dlg = wx.FileDialog(self, ‘Choose a file’, ‘.’, ‘’, ‘.’, wx.OPEN)
try:
if dlg.ShowModal() == wx.ID_OK:
filename = dlg.GetPath()
# Your code
finally:
dlg.Destroy()Werner
Date: Fri, 19 Jan 2007 09:50:37 -0800 (PST)
De: Rich Shepard rshepard@appl-ecosys.com
À: wxPython-users@lists.wxwidgets.org
Objet: Re: [wxPython-users] Upgraded System, New Error GeneratedOn Thu, 18 Jan 2007, Robin Dunn wrote:
(python:9274): Gtk-CRITICAL **: gtk_file_system_unix_get_folder:
assertion `g_path_is_absolute (filename)’ failedJust a guess based on the message, but try using defaultPath=os.getcwd()
instead of ‘.’. Sounds to me like it is wanting a full pathname.Robin, et al.:
Changing the ‘.’ to ‘os.getcwd()’ makes no difference at all.
Pressing the “OK” button does nothing. Pressing the “Cancel”
button
closes the dialog box and brings up the FileDialog. That seems backward
to me.Not sure what’s going on with the OK button, maybe it’s a bug caused by the
error above. However the way you have the code organized it is setup to go
to the file dialog no matter what the result of the dir dialog is. A bit of
reorg and simplification of the code will probably help it make more sense to
you:Trying to isolate the problem, I’ve commented out everything after the
test whether the dialog’s OK button was pressed, except a line to print the
pwd. Nothing’s printed. Here’s the truncated version:def openFile(self, event):
wd = wx.DirDialog(None, “Choose a default directory:”, defaultPath=“os.getcwd()”,
style=wx.DD_DEFAULT_STYLE)
if wd.ShowModal() == wx.ID_OK:
print os.getcwd()
wd.Destroy()What might have
happened during the upgrade to break this so badly?
Despite the poor structure, this function worked over the past six or so
months since I first wrote it. Now a call to wx.DirDialog() won’t work at
all for me. Is this related to wxGTK? Which library may be involved?This is obviously both a critical function and a major source of delay.
I’d greatly appreciate some suggestions on how to get it all working as
intended once again.Thanks,
Rich
–
Richard B. Shepard, Ph.D. | The Environmental Permitting
Applied Ecosystem Services, Inc. | Accelerator™
Voice: 503-667-4517 Fax: 503-667-8863
Date: Fri, 19 Jan 2007 10:48:18 -0800
De: Tim Roberts timr@probo.com
À: wxPython-users@lists.wxwidgets.org
Objet: Re: [wxPython-users] Upgraded System, New Error GeneratedOn Thu, 18 Jan 2007 16:17:12 -0800 (PST), Rich Shepard > > wrote:
I’ve checked the new API docs for DirDialog and FileDialog and ensured
that I’m calling them correctly. But, the function is still not working.The latest changes:
def openFile(self, event):
wd = wx.DirDialog(None, “Choose a default directory:”,
defaultPath=“.”,
style=wx.DD_DEFAULT_STYLE)
result = wd.ShowModal()
if result == wx.ID_CANCEL:
wd.Destroy()
if result == wx.ID_OK:
self.appData.dirname = wd.GetPath()
wd.Destroy()What is “self” here? Is it a dialog? A window?
I noticed in the traceback that this function lives in a separate file
from its caller. Am I correct in thinking that this function lives in a
separate module from the window class definition, so that it isn’t
actually part of the class? Is it part of ANY class? I’m not convinced
this is supposed to work. wxPython wraps the wxWidgets C++ classes in
magical ways. Robin will probably have to give the real story here.This code will destroy wd twice when you press Cancel, and will always
flow through to the following code. Did you mean this:result = wd.ShowModal() if result == wx.ID_OK: self.addData.dirname = wd.GetPath() wd.Destroy() if result == wx.ID_CANCEL: return
By the way, if “self” is a window, why don’t you pass it to the dialog
constructors as the parent, instead of None?wildcard = ‘Project databases (.db)|.db|’
dlg = wx.FileDialog(None, “Choose a project”, self.appData.dirname,
wildcard=wildcard,
style=wx.FD_OPEN|wx.FD_CHANGE_DIR)
result = dlg.ShowModal()
if result == wx.ID_CANCEL:
dlg.Destroy()
if result
== wx.ID_OK:
self.appData.projname=dlg.GetFilename()
self.appData.dirname=dlg.GetDirectory()
self.appData.dbFileName=dlg.GetFilename()
titleStr = self.appData.projname[:-4]
self.SetTitle((‘FuzzyEI-Assessor: - %s’) % self.appData.projname)
dlg.Destroy()You don’t do anything with titleStr here. Is that used later in the
function?Now, as soon as the function is called, the console displays this
message:(python:9274): Gtk-CRITICAL **: gtk_file_system_unix_get_folder:
assertion `g_path_is_absolute (filename)’ failedThat is probably ignorable. Gtk seems to have an awfully low threshhold
of “critical”.Pressing the “OK” button does nothing. Pressing the “Cancel” button
closes
the dialog box and brings up the FileDialog. That seems backward to me.Indeed. Both
buttons should have closed the dialog and brought up the
FileDialog, unless the GetPath call failed.Regardless, when I then double-click on a file name, rather than
displaying that name in the appropriate widget and loading other data
from
the database tables, the same error message as before is displayed;
that is,Traceback (most recent call last):
File “/data1/eikos/modelPage.py”, line 201, in OnOpenMod
pName = functions.openFile(self, event)
File “/data1/eikos/functions.py”, line 51, in openFile
self.SetTitle((‘FuzzyEI-Assessor: - %s’) % self.appData.projname)
AttributeError: ‘modModel’ object has no attribute ‘SetTitle’This implies that openFile received a “modModel” object as its “self”
parameter. Is a “modModel” supposed to be a window?–
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.Date:
Fri, 19 Jan 2007 10:51:49 -0800
De: Robin Dunn robin@alldunn.com
À: wxPython-users@lists.wxwidgets.org
Objet: Re: [wxPython-users] Upgraded System, New Error GeneratedWerner F. Bruhin wrote:
Hi Robin and Rich,
I think there is a little copy/paste error in the code, see below.
if wd.ShowModal() == wx.ID_OK:
I think above should use dlg and not wd:Yep, you are right.
–
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!Date: Fri, 19 Jan 2007 10:52:46 -0800
De: Robin Dunn robin@alldunn.com
À: wxPython-users@lists.wxwidgets.org
Objet: Re: [wxPython-users] Upgraded System, New Error GeneratedRich Shepard wrote:
Trying to isolate the problem, I’ve commented out everything after the
test whether the dialog’s OK button was pressed, except a line to
print the
pwd. Nothing’s printed. Here’s the truncated version:def openFile(self, event):
wd = wx.DirDialog(None, “Choose a default directory:”,
defaultPath=“os.getcwd()”,
style=wx.DD_DEFAULT_STYLE)
if wd.ShowModal() == wx.ID_OK:
print os.getcwd()
wd.Destroy()You want to call os.getcwd(), not pass it as a string.
BTW, you could probably solve a lot of your problems if you take the
time to experiment in a PyShell. It’s much easier to try things out,
along with lots of variations, etc. until you understand what is going
on. For example:import wx, os
dlg = wx.DirDialog(None, “hello”, defaultPath=os.getcwd())
dlg.ShowModal()
5100
dlg.GetPath()
u’/home/robind/Documents/wxPython’BTW, your issue with the
Open button (or the wx.ID_OK one) not doing
anything is probably due to a quirk in the GTK dialog. You don’t want
to drill down all the way into the dialog you are selecting, but
instead just drill down into the parent, and then select (without double
clicking) the dir you want. In the example above I drilled down into
/home/robind/Documents and then clicked once on the wxPython folder and
then pressed the Open button. The Open button only does something if
there is data in the Name field at the top of the dialog.What might have happened during the upgrade to break this so badly?
You were apparently using the generic dialog before, probably because of
a very old libgtk that doesn’t have the new version of the native common
dialogs. The generic one somewhat emulated the native dialog on
Windows, and so it behaved somewhat differently, had different
limitations, etc.Despite the poor
structure, this function worked over the past six or so
months since I first wrote it. Now a call to wx.DirDialog() won’t work at
all for me.I expect it is just because of drilling down too far, as I described above.
–
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!Date: Thu, 18 Jan 2007 23:47:07 -0800
De: Robin Dunn robin@alldunn.com
À: wxPython-users@lists.wxwidgets.org
Objet: Re: [wxPython-users] memory usage and custom compilationKevin Watters wrote:
My question, finally, is: has anyone done custom compilation of wxPython, taking
out big chunks like Media, STC, XRC, XML, Net, and the DB stuff (all of which we
make no use of) and measured the difference in (startup) memory usage? I’m not
entirely knowledgeable in the how the modularity of wx works, but I do know that
all of the mentioned “sub”
frameworks get their own DLLs, and that that might
mean that their native code segments (?) are only loaded when needed. But does
the same go for the SWIG bindings to that code?If you don’t import wx.media, wx.stc, wx.xrc modules then you won’t be
loading that code. The wx XML code is used by the wx.xrc module, and
Net is used by wx.html, and the DB code is already disabled by default.–
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!Date: Fri, 19 Jan 2007 08:49:24 -0800
De: Christopher Barker Chris.Barker@noaa.gov
À: wxPython-users@lists.wxwidgets.org
Objet: Re: [wxPython-users] memory usage and custom compilationRobin Dunn wrote:
If you don’t import wx.media, wx.stc, wx.xrc modules then you won’t be
loading that code. The wx XML code is used by the wx.xrc module, and
Net is used by wx.html, and the DB code is
already disabled by default.Darn.
I’m hoping to get wxPython working on the Nokia 770, which is pretty
memory limited (64mb). I was hoping it would be possible to trim down
memory usage a fair bit by not using some of those modules.Do you think it’s as small as can be?
What about removing wxGrid, maybe wxHtml, or other “large” classes that
might not be used by a given app?Is there hope? or should I just give up and buy the new Nokia n800,
which at least has 128mb?-Chris
–
Christopher Barker, Ph.D.
OceanographerEmergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main receptionChris.Barker@noaa.gov
Date: Fri, 19 Jan 2007 08:55:31 -0800
De: Christopher Barker Chris.Barker@noaa.gov
À: wxPython-users@lists.wxwidgets.org
Objet: Re:
[wxPython-users] memory usage and custom compilationKevin,
Robin’s reply was discouraging, but if you do find a way to reduce
memory usage – please post it on this list. It has come up a fair bit
in the past, but I think most people have found it easier to increase
the hardware requirements than really try to modularize the code enough
to reduce the footprint substantially.-Chris
–
Christopher Barker, Ph.D.
OceanographerEmergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main receptionChris.Barker@noaa.gov
Date: Fri, 19 Jan 2007 10:53:23 -0800
De: Robin Dunn robin@alldunn.com
À: wxPython-users@lists.wxwidgets.org
Objet: Re: [wxPython-users] memory usage and custom compilationChristopher Barker wrote:
Do you think it’s as small as
can be?There is probably be something that can be done, I’ve just been looking
at the forest for so long it’s kinda hard to see the trees.A
fresh set of eyes and hands working on the problem could help.–
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!Date: Thu, 18 Jan 2007 23:47:21 -0800
De: Robin Dunn robin@alldunn.com
À: wxPython-users@lists.wxwidgets.org
Objet: Re: [wxPython-users] Q: .PopupMenu…Stefan Holmgren wrote:
Hi
When using .PopupMenu(menu) for a wx object, in my case a wxTreeCtrl, the
main thread is freezing until a menu item is selected or menu is closed…
Is there a way to make it continue while the popup menu is active?No, PopupMenu works like wx.Dialog.ShowModal, it has it’s own event loop
and doesn’t return until either an item is selected or the menu is
dismissed with ESC or
clicking elsewhere.–
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!Date: Thu, 18 Jan 2007 23:47:30 -0800
De: Robin Dunn robin@alldunn.com
À: wxPython-users@lists.wxwidgets.org
Objet: Re: [wxPython-users] capturing video snapshotssimon kagwe wrote:
hi,
i am writing a program that is supposed to play a video and do some
processing on the frames. Actually it is supposed to track motion. I
have already been able to play the video using MediaCtrl but cant
capture the frames/snapshots. Can MediaCtrl do this? If not, can someone
please suggest a way of capturing snapshots?This question came up the other day and somebody suggested using the
ffmpeg library.–
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!Date: Thu, 18 Jan 2007 23:47:39
-0800
De: Robin Dunn robin@alldunn.com
À: wxPython-users@lists.wxwidgets.org
Objet: Re: [wxPython-users] What Versions of GTK+ Have Problems?Rich Shepard wrote:
I’ve found that the “Gtk-CRITICAL **: gtk_file_system_unix_get_folder:
assertion `g_path_is_absolute (filename)’ failed” error is quite common;
Google has 1100 hits for the assertion.Since my distribution upgrade, I have installed gtk+2-2.8.20,
pygtk-2.10.3, and wxGTK-2.8.0.Are any of these known to be particularly buggie? Are these versions
mutually incompatible?Nope, they should be fine. (Although if you’re trying to use pygtk from
wxPython then you have other problems.)
–
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!Date: Fri, 19 Jan 2007 06:19:31 -0800 (PST)
De: Rich Shepard
rshepard@appl-ecosys.com
À: wxPython-users@lists.wxwidgets.org
Objet: Re: [wxPython-users] What Versions of GTK+ Have Problems?On Thu, 18 Jan 2007, Robin Dunn wrote:
Nope, they should be fine. (Although if you’re trying to use pygtk from
wxPython then you have other problems.)
Thanks, Robin. And, I’m not trying to use pygtk. If I don’t need it to
write the wxPython components of our application, then I’ll remove the
package. I don’t need more things to cause confusion; I can generate enough
on my own.Rich
–
Richard B. Shepard, Ph.D. | The Environmental Permitting
Applied Ecosystem Services, Inc. | Accelerator™
Voice: 503-667-4517 Fax: 503-667-8863
Date: Thu, 18 Jan 2007 23:48:19 -0800
De: Robin Dunn robin@alldunn.com
À: wxPython-users@lists.wxwidgets.org
Objet: Re: [wxPython-users] weirdness in
TreeCtrlDanny Shevitz wrote:
Howdy,
I’ve discovered something I really don’t understand. I have a tree control
with editable labels. After editing a label, I need to decorate the text
by prepending
a text label on the front, so the following example isn’t as contrived
as it might seem.I have two questions. the first is that after editing a label,
event.GetItem()
doesn’t return the same TreeItemId as the original item, even though
they do
test equal logically. I don’t really understand this, but I assume it’s
something related
to references.The TreeItemId’s are more or less just an opaque handle to the tree
item, and are generated on the fly as needed.The second question is that after editing
the label, I can’t SetItemText and have the label change. If I pretend
to edit
(open for
editing and then immediately hit return) I can change the
label. Is there
a refresh of some sort I need to call?The text in the item isn’t actually changed until after the
wx.EVT_TREE_END_LABEL_EDIT handler returns. This is because it is
giving you a chance to prevent the change by calling event.Veto. If you
want to further change the text then you can use wx.CallAfter to call a
method later to make the change.–
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!Date: Fri, 19 Jan 2007 08:38:59 -0700
À: wxPython-users@lists.wxwidgets.org
De: Danny Shevitz shevitz@lanl.gov
Objet: Re: [wxPython-users] weirdness in TreeCtrlThe text in the item isn’t actually changed until after the
wx.EVT_TREE_END_LABEL_EDIT handler returns. This is because it is giving
you a chance to prevent the change by calling
event.Veto. If you want to
further change the text then you can use wx.CallAfter to call a method
later to make the change.thanks, definitely something totally outside my wx experience.
D
Date: Fri, 19 Jan 2007 10:25:53 +0100
De: Ye Naiquan Naiquan.Ye@marintek.sintef.no
À: wxPython-users@lists.wxwidgets.org
Objet: pass varialbe to a standalone executableHi, lists
I am trying to start a standalone exe file running under dospromt. The program will ask for a user input from the screen to be able to run through.
I have started that from a wxpython application and just wonder how can one pass the input from within the python instead of type the string in the dos-promt window?
It seems one has to get the handle of the dos-promt window and control the key strike from the python app.
There is no problem if the dos-promt is redirected by using wx.process where both the input and outputstream can be accessed.
thanks
n.ye
Date: Fri, 19 Jan 2007 10:46:16 -0800
De: Robin Dunn robin@alldunn.com
À: wxPython-users@lists.wxwidgets.org
Objet: Re: [wxPython-users] pass
varialbe to a standalone executableYe Naiquan wrote:
Hi, lists
I am trying to start a standalone exe file running under dospromt. The
program will ask for a user input from the screen to be able to run through.I have started that from a wxpython application and just wonder how can
one pass the input from within the python instead of type the string in
the dos-promt window?It seems one has to get the handle of the dos-promt window and control
the key strike from the python app.There is no problem if the dos-promt is redirected by using wx.process
where both the input and outputstream can be accessed.thanks
n.ye
–
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!De: Frank Aune
frank.aune@broadpark.no
À: wxpython-users@lists.wxwidgets.org
Date: Fri, 19 Jan 2007 10:29:42 +0100
Objet: Subthreads updating widgets in main loopHello wxpythons,
Ive got a python program using wx, which uses a decorator function to spawn
long-running methods into subthreads. In each long-running subthread, I
acquire a reentrant global lock and MutexGuiEnter() and when the thread is
finished executing, I release the lock and MutexGuiLeave().The subthread does update the main GUI, specifically it adds text as it
progresses to a wxTextCtrl field (thus the reason for the
MutexGuiEnter/Leave-part, since this alllows subthreads to access the
non-threaded wx library according to doc)The program works as intended on Mac OSX 10.4 using wx 2.8. Text is added
on-the-fly to the wxTextCtrl as the thread progresses. But on GNU/Linux
Kubuntu Edgy using python-wxgtk2.6 version 2.6.3.2.1.5 and gcc
4.1.2, the
wxTextCtrl is not updated on the fly.Granted the GUI does not “hang” in GNU/Linux when the thread is spawned, like
it did previous to the threading implementation. But it seems the text only
appears when the thread is finished processing and returns to the main loop.So Im really curious how this difference can manifest itself, and more
importantly - how do I “fix” it for GNU/Linux?Thanks for any feedback!
Regards,
Frank Aune
Date: Fri, 19 Jan 2007 09:01:20 -0600
De: “Chris Mellon” arkanes@gmail.com
À: wxPython-users@lists.wxwidgets.org
Objet: Re: [wxPython-users] Subthreads updating widgets in main loopOn 1/19/07, Frank Aune wrote:
Hello wxpythons,
Ive got a python program using wx, which uses a decorator function to spawn
long-running methods into subthreads. In each long-running subthread, I
acquire a reentrant
global lock and MutexGuiEnter() and when the thread is
finished executing, I release the lock and MutexGuiLeave().The subthread does update the main GUI, specifically it adds text as it
progresses to a wxTextCtrl field (thus the reason for the
MutexGuiEnter/Leave-part, since this alllows subthreads to access the
non-threaded wx library according to doc)The program works as intended on Mac OSX 10.4 using wx 2.8. Text is added
on-the-fly to the wxTextCtrl as the thread progresses. But on GNU/Linux
Kubuntu Edgy using python-wxgtk2.6 version 2.6.3.2.1.5 and gcc 4.1.2, the
wxTextCtrl is not updated on the fly.Granted the GUI does not “hang” in GNU/Linux when the thread is spawned, like
it did previous to the threading implementation. But it seems the text only
appears when the thread is finished processing and returns to the main loop.So Im
really curious how this difference can manifest itself, and more
importantly - how do I “fix” it for GNU/Linux?Thanks for any feedback!
Regards,
Frank AuneDon’t make direct calls from a secondary thread, even if you aquire
the GUI lock. Use wx.CallAfter to execute any UI code from the main
thread.
Date: Fri, 19 Jan 2007 14:28:06 +0100 (CET)
De: Robert VERGNES robert.vergnes@yahoo.fr
À: wxPython-users@lists.wxwidgets.org
Objet: combox inside collapsible pane do not want to refresh list at runtimeHello,
combox inside collapsible pane do not want to refresh list at runtime.
My static control refresh ok but the combo box not at all.
Even when I force a redraw. Any idea ?
Thanx
Robertself.cp = wx.CollapsiblePane(self, label="Variables Settings for Graph ")
self.Bind(wx.EVT_COLLAPSIBLEPANE_CHANGED,
self.OnPaneChanged, self.cp)
self.MakePaneContent(self.cp.GetPane())
self.GraphSizer.Add(self.cp)# wx.EXPAND)def MakePaneContent(self, pane):
locallabel = wx.StaticText(pane, -1,“X-Axis”, style=wx.ALIGN_RIGHT)
sizerhoriz.Add(locallabel,1)
cbx1 = wx.ComboBox(pane, 101 , “default value” , (90, 80), (95, -1),, wx.CB_DROPDOWN)
pane.Bind(wx.EVT_COMBOBOX, self.EvtComboBox, cbx1)
sizerhoriz.Add(cbx1,1)for item in labels:
cbx1.Append(item, item.upper())
#wx.LogMessage(“Appending:”+item)pane.SetSizer(sizergpan)
This is not working at all. neither append nor changing the list. The list get stuck with the original list of initialisation.
Découvrez une nouvelle façon d’obtenir des réponses à toutes vos questions ! Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses.Date: Fri, 19 Jan 2007 10:52:52 -0800
De: Robin Dunn robin@alldunn.com
À: wxPython-users@lists.wxwidgets.org
Objet: Re: [wxPython-users] combox inside collapsible pane do not want to
refresh list at runtime
Robert VERGNES wrote:Hello,
combox inside collapsible pane do not want to refresh list at runtime.
My static control refresh ok but the combo box not at all.
Even when I force a redraw. Any idea ?This is not working at all. neither append nor changing the list. The
list get stuck with the original list of initialisation.
Platform and version? Please make a small runnable sample that shows
the problem.
–
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
De: “Philippe C. Martin” pmartin@snakecard.com
À: wxPython-users@lists.wxwidgets.org
Date: Fri, 19 Jan 2007 07:38:48 +0100
Cc: Kevin Ollivier kevino@theolliviers.com
Objet: Re: [wxPython-users] PluginMixin proposal #2
Hi guys,
As I need to get started I will do the following: implement evenrything I can
think of / need using the “architecture” of proposal #1.
If the functionalities are then to your liking, I will integrate the stub
PluginFrame class into wx.Frame and will present a package which shows not
link with the Py
framework.
Regards,
Philippe
–
Philippe C. Martin
www.snakecard.com
Date: Fri, 19 Jan 2007 15:39:30 +0100
À: wxPython-users@lists.wxwidgets.org
De: “Igor Jese” igor@jeseonline.com
Objet: ListCtrl problem
Hi all,
I have to manually recreate the ListCtrl after selection, but the
following code doesn’t work (no selection is made).
What do I do wrong?
Thanks,
Igor
import wx
class WinList(wx.Frame):
def init(self,parent,id,title):
wx.Frame.init(self,parent,id,title)
self.lista =
wx.ListCtrl(self,-1,style=wx.LC_REPORT|wx.LC_SINGLE_SEL)
self.lista.InsertColumn(0,“ID”)
self.lista.InsertColumn(1,“Summary”)
self.populateList()
self.lista.Bind(wx.EVT_LIST_ITEM_SELECTED,self.onItemSelected)
self.Show(True)def populateList(self): self.lista.InsertStringItem(0,"1") self.lista.SetStringItem(0,1,"First item") self.lista.InsertStringItem(1,"2") self.lista.SetStringItem(1,1,"Second item") def onItemSelected(self,e): if self.lista.GetSelectedItemCount() == 1: self.refreshGui(self.lista.GetFirstSelected()) def refreshGui(self,id): self.lista.DeleteAllItems() self.populateList() self.lista.SetEvtHandlerEnabled(False) #avoid infinite loop self.lista.Select(id) self.lista.SetEvtHandlerEnabled(True)
if name == “main”:
app = wx.App()
frame = WinList(None,-1,“ListCtrl problem”)
app.MainLoop()Igor Jese, igor@jeseonline.com
http://mockupscreens.com
igor@mockupscreens.com
Date: Fri, 19 Jan 2007 10:53:09 -0800
De: Robin Dunn robin@alldunn.com
À: wxPython-users@lists.wxwidgets.org
Objet: Re: [wxPython-users] ListCtrl problem
Igor Jese wrote:Hi all,
I have to manually recreate the ListCtrl after selection, but the
following code doesn’t work (no selection is made).What do I do wrong?
IIRC, there is some internal cleanup that the control does after
deleting all items. That is probably also clearing the selection. So
if you delay your reselection for a short time then it should work fine
for you, something like this:
def refreshGui(self, id):
self.lista.DeleteAllItems()
self.populateList()
wx.CallLater(100, self.afterRefresh, id)
def afterRefresh(self, id):
self.lista.SetEvtHandlerEnabled(False) #avoid infinite loop
self.lista.Select(id)
self.lista.SetEvtHandlerEnabled(True)
–
Robin Dunn
Software
Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
Date: Fri, 19 Jan 2007 17:12:26 +0200
De: “Peter Damoc” pdamoc@gmail.com
À: wxPython-users@lists.wxwidgets.org
Objet: Re: [wxPython-users] Select item without triggering event handler
On 1/19/07, Igor Jese igor@jeseonline.com wrote:
The reason I want to do this is I have many GUI dependencies on the
underlaying data, so I want to refresh whole gui in one sweep each time a
relevant event happens.
This is a very very wrong way to approach things… DON’T DO IT!
I know it looks easier now but take my word for it… you will live to regret it!
I’m not speaking from theory but from the
pain that I’m feeling every time I try to change some code in one of my programs.Take a piece of paper and a pen and just try to brainstorm a way to break the app in modules… do it now while it is still young.
Independent modules are way easier to maintain.
I know it feels like wasting time… it sure did seamed that way to me too, and now I’m looking at some very weird flickering in some areas that shouldn’t change…
You can either learn from my mistake or just repeat it… your choice
Peter
There is NO FATE, we are the creators. Date: Fri, 19 Jan 2007 17:14:08 +0100
À: wxPython-users@lists.wxwidgets.org
De: “Igor Jese” igor@jeseonline.com
Objet: Re: [wxPython-users] Select item without triggering event handlerThanks for sound advice, Peter!
I do try to break app in pieces with as little dependencies as possible.
What I have meant is that GUI has many logical
dependencies on my data:
many parts of the screen has to be updated reflected changes on exactly
the same data. Up to now, I have been dealing with this by implementing
Model-View-Controller, with GUI “views” (parts of screen) subscribing to
changes in the model.This time I want to implement different flavor of MVC, Martin Fowler
describes it as “Passive View”:
Passive ViewWhat I’m fed up with when implementing MVC using observers/publishers is
very painfull and troublesome both testing and debugging.But this is my first app in wxPython, so I’m quite prepared for a long
journey. I started reading “wxPython in Action” and also I have found this
list’s archives very informativeBest regards,
IgorThe reason I want to do this is I have many GUI dependencies on the
underlaying data, so I want to refresh whole gui in one sweep
each time
a
relevant event happens.This is a very very wrong way to approach things… DON’T DO IT!
I know it looks easier now but take my word for it… you will live to
regret it!
I’m not speaking from theory but from the pain that I’m feeling every
time I
try to change some code in one of my programs.Take a piece of paper and a pen and just try to brainstorm a way to break
the app in modules… do it now while it is still young.Independent modules are way easier to maintain.
I know it feels like wasting time… it sure did seamed that way to me
too,
and now I’m looking at some very weird flickering in some areas that
shouldn’t change…You can either learn from my mistake or just repeat it… your choice
Peter
–
Igor Jese,
igor@jeseonline.com
http://mockupscreens.com
igor@mockupscreens.com
Date: Fri, 19 Jan 2007 07:42:03 -1000
De: wccppp wccppp@gmail.com
À: wxPython-users@lists.wxwidgets.org
Objet: Re: [wxPython-users] Multiline Text Input in Grid Cell?I still could not figure out why my code does not work. When press CTRL+ENTER, the program just activate the next cell. Please see code shown below. Also, how do I know the background color of the frame? I’d like to use it as the background color for the first column, instead of using wx.LIGHT_GREY. Thank you.
import wx
import wx.grid
import wx.lib.colourdb as wxcolorclass DocVarGridResult(object):
def init(self):
self.value = Noneclass DocVarGrid(wx.grid.Grid ):
def init(self, parent, lst):cntRow = len(lst)
cntCol = len(lst[0])
wx.grid.Grid.init(self, parent, -1)
self.CreateGrid(cntRow,cntCol)
self.SetDefaultEditor(wx.grid.GridCellAutoWrapStringEditor())for row in range(cntRow): for col in range(cntCol): self.SetCellValue(row, col, lst[row][col]) for row in
range(cntRow):
self.SetCellAlignment(row, 0, wx.ALIGN_LEFT, wx.ALIGN_CENTER)
self.SetCellAlignment(row, 1, wx.ALIGN_LEFT, wx.ALIGN_CENTER)
self.SetCellBackgroundColour(row, 0, wx.LIGHT_GREY)
if row in [1,22]:
self.SetRowSize(row, 60)
else:
self.SetRowSize(row, 20)self.SetColLabelSize(0) self.SetRowLabelSize(0) self.SetGridLineColour(wx.BLACK) self.SetColSize(1, 500) self.SetColSize(0,120) self.SetColSize (1,500) def GetGridValues (self): cntRow = self.GetNumberRows() cntCol = self.GetNumberCols() lst = [[]]*cntRow for row in range(cntRow): for col in range(cntCol): lst[row].append(self.GetCellValue(row,col)) return lst
class DocVarGridFrame(wx.Frame):
def init(self, lst, data, title = “”, msg = “”):
wx.Frame.init(self, None, -1, title, pos = (200, 100), size = (900,600))
panel = wx.Panel(self)
self.data = datamsgLbl = wx.StaticText(panel, -1, msg) topSizer = wx.BoxSizer(wx.HORIZONTAL) topSizer.Add (msgLbl,0)
self.okBtn = wx.Button(panel, -1, “&Ok”)
self.cancelBtn = wx.Button(panel, -1, “&Cancel”)
btnSizer = wx.BoxSizer(wx.VERTICAL)
btnSizer.Add(self.okBtn, 0)
btnSizer.Add((10,10), 0)
btnSizer.Add(self.cancelBtn, 0)self.Bind(wx.EVT_BUTTON, self.OnOkClick, self.okBtn) self.Bind(wx.EVT_BUTTON , self.OnCancelClick, self.cancelBtn) self.grid = DocVarGrid(panel, lst) botSizer = wx.BoxSizer(wx.HORIZONTAL) botSizer.Add (self.grid, 1, wx.EXPAND | wx.ALL, 10) botSizer.Add(btnSizer, 0, wx.EXPAND | wx.ALL, 10) mainSizer = wx.BoxSizer (wx.VERTICAL) mainSizer.Add(topSizer, 0, wx.EXPAND | wx.ALL , 10) mainSizer.Add(botSizer, 1, wx.EXPAND | wx.ALL, 10) panel.SetSizer(mainSizer) mainSizer.Fit (self) mainSizer.SetSizeHints(self)
self.SetClientSize (panel.GetSize()+(16,60))
def OnOkClick(self, event): self.data.value = self.grid.GetGridValues() self.Destroy() def OnCancelClick(self, event): self.data.value = None self.Destroy()
def WordDocVar():
title = “Document Variables”
lst = [[“Transmittal Number”, “”],
[“Address”, “”],
[“Addressee Name”, “”],
[“Addressee Title”, “”],
[“Sender Name”,
“”],
[“Sender Title”, “”],
[“Sender Company”, “”],
[“Date”, “”],
[“Subject”, “”],
[“Project Number”, “”],
[“Quantity 1”, “”],
[“Description 1”, “”],
[“Quantity 2”, “”],
[“Description 2”, “”],
[“Quantity 3”, “”],
[“Description 3”, “”],["Quantity 4", ""], ["Description 4", ""], ["Quantity 5", ""], ["Description 5", ""], ["Quantity 6", ""], ["Description 6", ""], ["Message", ""], ["Copy To", ""]] msg = "Edit document variables in grid" app = wx.PySimpleApp() data = DocVarGridResult() DocVarGridFrame(lst, data, title,
msg).Show()
app.MainLoop()
return data.valueif name == “main”:
print WordDocVar()De: Kevin Ollivier kevino@theolliviers.com
Date: Fri, 19 Jan 2007 10:42:05 -0800
À: wxPython-users@lists.wxwidgets.org
Objet: Re: [wxPython-users] PluginMixin proposal #1Hi Philippe,
On Jan 16, 2007, at 4:46 AM, Philippe C. Martin wrote:
[snip]
Hi Kevin,
I did not explain myself correctly.
The reason the classes are in the Py framework is only so you can
download and
the package right away without touching wx.
: PuginMixin will eventually be somewhere else (root of wx ?)Also, BTW, why do you duplicate the entire Py framework? Wouldn’t it
be difficult for you to
keep up with any changes to the wxPython
version (i.e. bug-fixes, etc.) this way?Not sure I understand: maybe the same confusion as above ?
So to reiterate:
Class MixinPlugin should be eventually in its own module/file
(currently in
py.Frame)Class PluginFrame is a stub (located again for simplicity in
Py.Frame for
testing purpose) that should disappear as its code will be
integrated in
wx.Frame itself.So really, the Py Framework is not linked in anyway to this
architecture.Not sure I fully understand your concern … am I making sense ?
As we’re talking about contributing code to wxPython, what I am
interested in seeing is a “Hello World” example of how the
PluginMixin code you’d like to contribute would be used to allow a
(ny) wx.Frame class to add a plugin menu
and register plugins using a
standardized system. This way Robin and I (or anyone else) can easily
review and test only the code that is to be contributed. But since
you’ve embedded your code in the Py framework, I need to go through
each file in the Py framework looking for code that is part of the
plugin code you want to contribute, and I have to have some
understanding of how the Py framework works in order to see the flow
of events in your code. The Py framework is hundreds, if not
thousands, of lines of code that have nothing to do with this
contribution, but yet I have to sift through all that to try and get
a comprehensive picture of the code that you want to contribute.I hope this is more clear. I really don’t know how else to explain it
but it is pretty much standard for contributors to not include any
code that is irrelevant to the contribution when submitting code for
review, and as you
say, the Py framework is really not tied to this
code at all.Thanks,
Kevin
Regards,
Philippe
–
Philippe C. Martin
www.snakecard.com
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-
help@lists.wxwidgets.org
Découvrez une nouvelle façon d’obtenir des réponses à toutes vos questions ! Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses.