The attachment contains two programs written using PyScripter.
The Open File Dialog (OFD) works well in Program 1 but never appears
in Program 2. I believe the OFD code is the same in both programs.
Resulting errors are shown after Program 2.
Any ideas ?
TIA
TypeError: FileDialog(): argument 1 has unexpected type 'bool'
Hint: You probably want to be using self.
<details class='elided'>
<summary title='Show trimmed content'>···</summary>
On Wednesday, October 3, 2018 at 2:43:33 PM UTC-7, srfpala wrote:
> The attachment contains two programs written using PyScripter.
> The Open File Dialog (OFD) works well in Program 1 but never appears
> in Program 2. I believe the OFD code is the same in both programs.
> Resulting errors are shown after Program 2.
> Any ideas ?
--
Hi,
I believe, the difference might be the scoping regarding "frame"
in the first example, frame remains within the same class (with now
further structuring via functinos etc.) and is accessible for the the
call "wx.FileDialog(frame, ...)"
in the second example, these parts of code belong to separate
functions/method definitions (__init__ and onOpenFile respectively); i
believe making "frame" available within the class like self.frame =
... might solve the immediate problem with displaying a dialog, but
there seem to be other differences as well (it's not clear, whether it
is intended or not).
The attachment contains two programs written using PyScripter.
The Open File Dialog (OFD) works well in Program 1 but never appears
in Program 2. I believe the OFD code is the same in both programs.
Resulting errors are shown after Program 2.
Any ideas ?
TIA
Bob