Program Organization

Thanks to guidance from many of you, the UI for my first python application
is Good Enough(TM) for now. The application has a postgres backend and I'll
be using psycopg2 with it.

   The docs I've found (e.g., Federico's beginning LaTeX doc, other psycopg2
docs, the Douglas*2 postgres book (2nd edition), and wxPython docs) all have
code fragments to illustrate various classes and methods. But, I've not found
one that teaches me the overall program structure.

   Specifically, when the application is run as a stand-alone application,
where do I place the database connection and shutdown code relative to the
wxPython main loop?

   This is the end of the wxGlade-generated file:

class MyApp(wx.App):
     def OnInit(self):
         wx.InitAllImageHandlers()
         frame_1 = MyFrame(None, -1, "")
         self.SetTopWindow(frame_1)
         frame_1.Show()
         return 1

# end of class MyApp

if __name__ == "__main__":
     app = MyApp(0)
     app.MainLoop()

   Do I place the psycopg init calls before the call to
wx.InitAllImageHandlers(), or someplace else?

TIA,

Rich

···

--
Dr. Richard B. Shepard, President | Author of "Quantifying Environmental
Applied Ecosystem Services, Inc. (TM) | Impact Assessments Using Fuzzy Logic"
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863

Hello,

When I open a textEntryDialog above a blackboard window, where the
EVT_LEFT_DOWN has been binded, when I click in the dialog box, wxpython
considers that I clicked in the window behind.

Does anyone have a clue?

Cheers

Raphael

Hello again,

I would like to insert text on a window containe a Bitmap but I would like
the I-BEAM cursor to appear in the bitmap and being able to see each letter
entered, or being able to erase any letter. Does anyone know has to do it?
Shall I create another window (transparent to the user) above the other one
as a temporary entry one ?

Thanks a lot

Raphael

Hi,

I have a class deriving both from wx.Window and wx.FileDropTarget, but when
in the __init__ method I call both these parent classes init, the windows
functions like setBackgroundColour fail.

Does anyone have already experienced this?

Thanks very much

Raphael

Are you using Show() or ShowModal() to open the TextEntryDialog?

Ricardo

···

On Tue, 2005-08-23 at 17:02 +0100, Raphael Arbuz wrote:

Hello,

When I open a textEntryDialog above a blackboard window, where the
EVT_LEFT_DOWN has been binded, when I click in the dialog box, wxpython
considers that I clicked in the window behind.

Does anyone have a clue?

If you post a simple working examples, it's easier to help you.

PS: Please ppl, don't start a new thread replying to an existing one.
because it's more difficult to follow it. See this
http://news.gmane.org/gmane.comp.python.wxpython to have an ideia how it
looks like, in email clients that support threads.

Ricardo

···

On Tue, 2005-08-23 at 19:13 +0100, Raphael Arbuz wrote:

Hi,

I have a class deriving both from wx.Window and wx.FileDropTarget, but when
in the __init__ method I call both these parent classes init, the windows
functions like setBackgroundColour fail.

Does anyone have already experienced this?

Rich Shepard wrote:

   Specifically, when the application is run as a stand-alone
application, where do I place the database connection and
shutdown code relative to the wxPython main loop?

I am no expert, but here goes.

I don't think the gui knows or cares about your db connection. If you need
to get some information from the gui (such as user id) before making the
connection, obviously you must delay the connection until after this point.
Otherwise, provided you do it before your first db call, you can do it
anywhere.

In my case, my startup program reads the connection information from a
config file, so I open the connection straight away, before starting the
gui.

Very roughly my startup program looks like this -

[various imports]
[open and read config file]
[establish db connection]
[declare various wx classes]

class MyApp(wx.App):
    def OnInit(self):
        frame = LoginFrame(None, -1, "")
        frame.Show()
        return True

app = MyApp(0) # Create an instance of the application class
app.MainLoop() # Tell it to start processing events

This was not the result of any grand plan. It just evolved this way, and has
not given any problems, so I think it proves that you can do it any way you
like.

As for closing the connection, I do nothing. I am pretty sure that it is
automatically closed when it is garbage collected at the end of the program.

Incidentally, it is no longer necessary to call wx.InitAllImageHandlers(). I
don't remember the details, but it was mentioned in the notes to a fairly
recent release of wxPython.

HTH

Frank Millman

[snip]

Incidentally, it is no longer necessary to call wx.InitAllImageHandlers(). I
don't remember the details, but it was mentioned in the notes to a fairly
recent release of wxPython.

2.6 series has a call to wx.InitAllImageHandlers() included in the code of wx.App so it is true, you don't need that unless you plan on supporting 2.4 and even in that case you're better off using wx.PySimpleApp instead of an App +wx.InitAllImageHandlers()

HTH

Frank Millman

Peter

···

On Wed, 24 Aug 2005 09:02:51 +0300, Frank Millman <frank@chagford.com> wrote:

Thanks Ricardo,

here is the beginning of my class :

class BlackboardWindow(wx.Window, wx.FileDropTarget):

    def __init__(self, parent, ID, appliClass, id):

        wx.Window.__init__(self, parent, ID,
style=wx.NO_FULL_REPAINT_ON_RESIZE, size=(450,405))

        wx.FileDropTarget.__init__(self)

        self.SetBackgroundColour("WHITE")

And this last list does not work since I have inserted the
wx.FileDropTarget.__init__(self) before. If I put it after, I have other
errors in the other methods.

Thanks your very much for your help and sorry for the replying stuff

Raphael

···

----- Original Message -----
From: "Ricardo Pedroso" <ricardo.pedroso@netvisao.pt>
To: <wxPython-users@lists.wxwidgets.org>
Sent: Wednesday, August 24, 2005 5:04 AM
Subject: Re: [wxPython-users] Multi init prob

On Tue, 2005-08-23 at 19:13 +0100, Raphael Arbuz wrote:
> Hi,
>
> I have a class deriving both from wx.Window and wx.FileDropTarget, but

when

> in the __init__ method I call both these parent classes init, the

windows

> functions like setBackgroundColour fail.
>
> Does anyone have already experienced this?

If you post a simple working examples, it's easier to help you.

PS: Please ppl, don't start a new thread replying to an existing one.
because it's more difficult to follow it. See this
http://news.gmane.org/gmane.comp.python.wxpython to have an ideia how it
looks like, in email clients that support threads.

Ricardo

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

I have tried both, with sadly the same result.

Raphael

···

----- Original Message -----
From: "Ricardo Pedroso" <ricardo.pedroso@netvisao.pt>
To: <wxPython-users@lists.wxwidgets.org>
Sent: Wednesday, August 24, 2005 3:39 AM
Subject: Re: [wxPython-users] Dialog over Window

On Tue, 2005-08-23 at 17:02 +0100, Raphael Arbuz wrote:
> Hello,
>
> When I open a textEntryDialog above a blackboard window, where the
> EVT_LEFT_DOWN has been binded, when I click in the dialog box, wxpython
> considers that I clicked in the window behind.
>
> Does anyone have a clue?
>

Are you using Show() or ShowModal() to open the TextEntryDialog?

Ricardo

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

I don't think the gui knows or cares about your db connection.

Frank,

   No, it doesn't. It does have the main loop watching for events to process,
but I thought the db initialization should be before that. As a python
newcomer I wanted to check for proper placement.

In my case, my startup program reads the connection information from a
config file, so I open the connection straight away, before starting the
gui.

   Thanks for confirming.

Incidentally, it is no longer necessary to call wx.InitAllImageHandlers().
I don't remember the details, but it was mentioned in the notes to a fairly
recent release of wxPython.

   I've no idea what wx.InitAllImageHandlers() is doing there, but since it
was generated by wxGlade I shrugged and left it.

Again, many thanks,

Rich

···

On Wed, 24 Aug 2005, Frank Millman wrote:

--
Dr. Richard B. Shepard, President | Author of "Quantifying Environmental
Applied Ecosystem Services, Inc. (TM) | Impact Assessments Using Fuzzy Logic"
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863

Peter,

   I do not yet know just what's needed to run this as a stand-alone app. But,
I will find out. For my use, there's no need to support anything not
installed here, so the 2.6.x code works for me.

Thanks,

Rich

···

On Wed, 24 Aug 2005, Peter Damoc wrote:

2.6 series has a call to wx.InitAllImageHandlers() included in the code of
wx.App so it is true, you don't need that unless you plan on supporting 2.4
and even in that case you're better off using wx.PySimpleApp instead of an
App +wx.InitAllImageHandlers()

--
Dr. Richard B. Shepard, President | Author of "Quantifying Environmental
Applied Ecosystem Services, Inc. (TM) | Impact Assessments Using Fuzzy Logic"
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863

Hello Raphaël:

I think you would be better off using 2 separate classes, like this:

class BlackboardDropTarget(wx.FileDropTarget):
    def __init__(self):
       wx.FileDropTarget.__init__(self)

class BlackboardWindow(wx.Window, wx.FileDropTarget):
   def __init__(self, parent, ID, appliClass, id):
       wx.Window.__init__(self, parent, ID,
style=wx.NO_FULL_REPAINT_ON_RESIZE, size=(450,405))

       self.SetBackgroundColour("WHITE")

       objDropTarget = BlackboardDropTarget()
       self.SetDropTarget(objDropTarget)

···

On 8/24/05, Raphaël ARBUZ <raphaelarbuz@netcourrier.com> wrote:

Thanks Ricardo,

here is the beginning of my class :

class BlackboardWindow(wx.Window, wx.FileDropTarget):

    def __init__(self, parent, ID, appliClass, id):

        wx.Window.__init__(self, parent, ID,
style=wx.NO_FULL_REPAINT_ON_RESIZE, size=(450,405))

        wx.FileDropTarget.__init__(self)

        self.SetBackgroundColour("WHITE")

And this last list does not work since I have inserted the
wx.FileDropTarget.__init__(self) before. If I put it after, I have other
errors in the other methods.

Thanks your very much for your help and sorry for the replying stuff

Raphael

----- Original Message -----
From: "Ricardo Pedroso" <ricardo.pedroso@netvisao.pt>
To: <wxPython-users@lists.wxwidgets.org>
Sent: Wednesday, August 24, 2005 5:04 AM
Subject: Re: [wxPython-users] Multi init prob

> On Tue, 2005-08-23 at 19:13 +0100, Raphael Arbuz wrote:
> > Hi,
> >
> > I have a class deriving both from wx.Window and wx.FileDropTarget, but
when
> > in the __init__ method I call both these parent classes init, the
windows
> > functions like setBackgroundColour fail.
> >
> > Does anyone have already experienced this?
>
> If you post a simple working examples, it's easier to help you.
>
> PS: Please ppl, don't start a new thread replying to an existing one.
> because it's more difficult to follow it. See this
> http://news.gmane.org/gmane.comp.python.wxpython to have an ideia how it
> looks like, in email clients that support threads.
>
> Ricardo
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
> For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Sorry, I meant to type:

class BlackboardWindow(wx.Window):

···

On 8/24/05, Michael Moriarity <datasmith@gmail.com> wrote:

Hello Raphaël:

I think you would be better off using 2 separate classes, like this:

class BlackboardDropTarget(wx.FileDropTarget):
    def __init__(self):
       wx.FileDropTarget.__init__(self)

class BlackboardWindow(wx.Window, wx.FileDropTarget):
   def __init__(self, parent, ID, appliClass, id):
       wx.Window.__init__(self, parent, ID,
style=wx.NO_FULL_REPAINT_ON_RESIZE, size=(450,405))

       self.SetBackgroundColour("WHITE")

       objDropTarget = BlackboardDropTarget()
       self.SetDropTarget(objDropTarget)

On 8/24/05, Raphaël ARBUZ <raphaelarbuz@netcourrier.com> wrote:
> Thanks Ricardo,
>
> here is the beginning of my class :
>
> class BlackboardWindow(wx.Window, wx.FileDropTarget):
>
> def __init__(self, parent, ID, appliClass, id):
>
> wx.Window.__init__(self, parent, ID,
> style=wx.NO_FULL_REPAINT_ON_RESIZE, size=(450,405))
>
> wx.FileDropTarget.__init__(self)
>
> self.SetBackgroundColour("WHITE")
>
> And this last list does not work since I have inserted the
> wx.FileDropTarget.__init__(self) before. If I put it after, I have other
> errors in the other methods.
>
> Thanks your very much for your help and sorry for the replying stuff
>
> Raphael
>
> ----- Original Message -----
> From: "Ricardo Pedroso" <ricardo.pedroso@netvisao.pt>
> To: <wxPython-users@lists.wxwidgets.org>
> Sent: Wednesday, August 24, 2005 5:04 AM
> Subject: Re: [wxPython-users] Multi init prob
>
>
> > On Tue, 2005-08-23 at 19:13 +0100, Raphael Arbuz wrote:
> > > Hi,
> > >
> > > I have a class deriving both from wx.Window and wx.FileDropTarget, but
> when
> > > in the __init__ method I call both these parent classes init, the
> windows
> > > functions like setBackgroundColour fail.
> > >
> > > Does anyone have already experienced this?
> >
> > If you post a simple working examples, it's easier to help you.
> >
> > PS: Please ppl, don't start a new thread replying to an existing one.
> > because it's more difficult to follow it. See this
> > http://news.gmane.org/gmane.comp.python.wxpython to have an ideia how it
> > looks like, in email clients that support threads.
> >
> > Ricardo
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
> > For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
> For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
>
>

There’s no hard and fast rule here except that whatever goes before
can’t block the startup permenantly. Besides that, common sense
prevails.

Anything that HAS to be up and running should be placed before you fire
up the app. Anything that CAN wait until after the thing is open,
should, since otherwise it will cause the app to appear to be
‘sluggish’ coming up, which is sometimes important (impressions count
in GUIs).

For shutting things down, I always let the GUI close and return control
to the user for a good impression, then take things apart in
background, unless they’re trivial. Trivial does not include saving a
two-gigabyte file to disk, obviously :slight_smile: Anything that has
dependencies in the GUI has to be closed out (unless you like
exceptions) but besides that, it’s a matter of what gives it the
appearance of responsiveness, really.

Trivial stuff I actually open in my main frame, in fact - such as
preference files (serialized window dimensions, etc) and other trival
stuff. For really BIG stuff, such as a database of 100 RSS feeds, I
usually open all windows in a ‘please wait’ state (i.e. telling the
user that the control is not yet available) and then use the wx event
loop to drive opening the stuff. Once it’s opened, it sends an event to
the control in question, the control populates, and all is well.

There are truly dozens of good strategies here. It’s just a matter of
having things prioritized so they make sense. #1 is not making the user
fret at responsivness issues, without landing in hot water.

I’ve developed a bunch of ‘boilerplate’ frameworks I use here at work
depending on the type of test tool I’m writing. Each represents a
successful strategy for a specific situation. The rest get called “1.0”
and refactored at earlest convenience. I guess what I’m saying here is
that it doesn’t matter what you try at first, as long as you try
something, then adjust as needed until you have what you truly want.

···


“Things fall apart. The Center cannot hold.”
-
Life as a QA geek, in a nutshell.

Best,

Jeff

Hello Michael,

Thank you very much for your answer, it works!!

Raphael

···

----- Original Message -----
From: "Michael Moriarity" <datasmith@gmail.com>
To: <wxPython-users@lists.wxwidgets.org>
Sent: Wednesday, August 24, 2005 2:46 PM
Subject: Re: [wxPython-users] Multi init prob

Sorry, I meant to type:

class BlackboardWindow(wx.Window):

On 8/24/05, Michael Moriarity <datasmith@gmail.com> wrote:

Hello Raphaël:

I think you would be better off using 2 separate classes, like this:

class BlackboardDropTarget(wx.FileDropTarget):
    def __init__(self):
       wx.FileDropTarget.__init__(self)

class BlackboardWindow(wx.Window, wx.FileDropTarget):
   def __init__(self, parent, ID, appliClass, id):
       wx.Window.__init__(self, parent, ID,
style=wx.NO_FULL_REPAINT_ON_RESIZE, size=(450,405))

       self.SetBackgroundColour("WHITE")

       objDropTarget = BlackboardDropTarget()
       self.SetDropTarget(objDropTarget)

On 8/24/05, Raphaël ARBUZ <raphaelarbuz@netcourrier.com> wrote:
> Thanks Ricardo,
>
> here is the beginning of my class :
>
> class BlackboardWindow(wx.Window, wx.FileDropTarget):
>
> def __init__(self, parent, ID, appliClass, id):
>
> wx.Window.__init__(self, parent, ID,
> style=wx.NO_FULL_REPAINT_ON_RESIZE, size=(450,405))
>
> wx.FileDropTarget.__init__(self)
>
> self.SetBackgroundColour("WHITE")
>
> And this last list does not work since I have inserted the
> wx.FileDropTarget.__init__(self) before. If I put it after, I have other
> errors in the other methods.
>
> Thanks your very much for your help and sorry for the replying stuff
>
> Raphael
>
> ----- Original Message -----
> From: "Ricardo Pedroso" <ricardo.pedroso@netvisao.pt>
> To: <wxPython-users@lists.wxwidgets.org>
> Sent: Wednesday, August 24, 2005 5:04 AM
> Subject: Re: [wxPython-users] Multi init prob
>
>
> > On Tue, 2005-08-23 at 19:13 +0100, Raphael Arbuz wrote:
> > > Hi,
> > >
> > > I have a class deriving both from wx.Window and wx.FileDropTarget,

but

> when
> > > in the __init__ method I call both these parent classes init, the
> windows
> > > functions like setBackgroundColour fail.
> > >
> > > Does anyone have already experienced this?
> >
> > If you post a simple working examples, it's easier to help you.
> >
> > PS: Please ppl, don't start a new thread replying to an existing one.
> > because it's more difficult to follow it. See this
> > http://news.gmane.org/gmane.comp.python.wxpython to have an ideia how

it

> > looks like, in email clients that support threads.
> >
> > Ricardo
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
> > For additional commands, e-mail:

wxPython-users-help@lists.wxwidgets.org

> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
> For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Thanks, Jeff.

Rich

···

On Wed, 24 Aug 2005, Jeff Grimmett wrote:

There's no hard and fast rule here except that whatever goes before can't
block the startup permenantly. Besides that, common sense prevails.

--
Dr. Richard B. Shepard, President | Author of "Quantifying Environmental
Applied Ecosystem Services, Inc. (TM) | Impact Assessments Using Fuzzy Logic"
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863

I don't understand what really is your problem, so I attached a small
sample. See if it's the behavior you want.

Ricardo

test.py (872 Bytes)

···

On Wed, 2005-08-24 at 10:55 +0100, Raphael Arbuz wrote:

----- Original Message -----
From: "Ricardo Pedroso" <ricardo.pedroso@netvisao.pt>
To: <wxPython-users@lists.wxwidgets.org>
Sent: Wednesday, August 24, 2005 3:39 AM
Subject: Re: [wxPython-users] Dialog over Window

> On Tue, 2005-08-23 at 17:02 +0100, Raphael Arbuz wrote:
> > Hello,
> >
> > When I open a textEntryDialog above a blackboard window, where the
> > EVT_LEFT_DOWN has been binded, when I click in the dialog box, wxpython
> > considers that I clicked in the window behind.
> >
> > Does anyone have a clue?
> >
>
> Are you using Show() or ShowModal() to open the TextEntryDialog?
>
> Ricardo
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
> For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
>
I have tried both, with sadly the same result.

Thanks Ricargo, that's what I've done I think.

Here is my code if you can drop an eye that would help a lot!

Cheers

Raphael

class BlackboardWindow(wx.Window):
    maxThickness = 16

    def __init__(self, parent, window, ID, appliClass, id):
        wx.Window.__init__(self, parent, ID,
style=wx.NO_FULL_REPAINT_ON_RESIZE, size=(450,405))
        self.window = window
        self.appliClass = appliClass
        self.textMode = False
        self.textDialog = False
        dt = InputFileDropTarget(frame = self)
        self.SetDropTarget(dt)
        self.erase = False

        self.SetCursor(wx.StockCursor(wx.CURSOR_PENCIL))

        # hook some mouse events
        self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
        self.Bind(wx.EVT_LEFT_UP, self.OnLeftUp)
        self.Bind(wx.EVT_RIGHT_UP, self.OnRightUp)
        self.Bind(wx.EVT_MOTION, self.OnMotion)

        # the window resize event and idle events for managing the buffer
        self.Bind(wx.EVT_SIZE, self.OnSize)
        self.Bind(wx.EVT_IDLE, self.OnIdle)

        # and the refresh event
        self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground)

        # When the window is destroyed, clean up resources.
        self.Bind(wx.EVT_WINDOW_DESTROY, self.Cleanup)

    def Cleanup(self, evt):
        if hasattr(self, "menu"):
            self.menu.Destroy()
            del self.menu

    def InitBuffer(self):
        """Initialize the bitmap used for buffering the display."""
        size = self.GetClientSize()
        self.buffer = wx.EmptyBitmap(max(1,size.width), max(1,size.height))
        dc = wx.BufferedDC(None, self.buffer)
        dc.SetBackground(wx.Brush(self.GetBackgroundColour()))
        dc.Clear()
        self.DrawLines(dc)
        self.reInitBuffer = False

    def OnLeftUp(self, event):
        """called when the left mouse button is released"""

        if not self.textMode:
             if self.HasCapture():
               self.lines.append(
(self.colours[self.appliClass.getColour()], self.thickness, self.curLine) )
               if self.colour == "White":
                   self.appliClass.Communications.sendDrawing([self.id, 0,
self.curLine])
               else:
                   self.appliClass.Communications.sendDrawing([self.id,
self.thickness, self.curLine])
               self.curLine =
               self.ReleaseMouse()
        else:
             if not self.textDialog:
               self.SetCursor(wx.StockCursor(wx.CURSOR_ARROW))
               textDialog = wx.TextEntryDialog(self.window.panel, "type in
the text to insert", "type in the text to insert")
               self.textDialog = True
               if textDialog.ShowModal() == wx.ID_OK:
                  text = textDialog.GetValue()
                  self.write(text, self.pos, None,
self.colours[self.appliClass.getColour()])
                  self.appliClass.Communications.sendDrawing([self.id, 'T',
str(self.pos.x) + ";" + str(self.pos.y) + ";" + text ]) # we use the format
as for a line to make things easy
               self.textDialog = False
               self.SetCursor(wx.StockCursor(wx.CURSOR_IBEAM))

···

----- Original Message -----
From: "Ricardo Pedroso" <ricardo.pedroso@netvisao.pt>
To: <wxPython-users@lists.wxwidgets.org>
Sent: Thursday, August 25, 2005 7:48 PM
Subject: Re: [wxPython-users] Dialog over Window

On Wed, 2005-08-24 at 10:55 +0100, Raphael Arbuz wrote:
> ----- Original Message -----
> From: "Ricardo Pedroso" <ricardo.pedroso@netvisao.pt>
> To: <wxPython-users@lists.wxwidgets.org>
> Sent: Wednesday, August 24, 2005 3:39 AM
> Subject: Re: [wxPython-users] Dialog over Window
>
>
> > On Tue, 2005-08-23 at 17:02 +0100, Raphael Arbuz wrote:
> > > Hello,
> > >
> > > When I open a textEntryDialog above a blackboard window, where the
> > > EVT_LEFT_DOWN has been binded, when I click in the dialog box,

wxpython

> > > considers that I clicked in the window behind.
> > >
> > > Does anyone have a clue?
> > >
> >
> > Are you using Show() or ShowModal() to open the TextEntryDialog?
> >
> > Ricardo
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
> > For additional commands, e-mail:

wxPython-users-help@lists.wxwidgets.org

> >
> I have tried both, with sadly the same result.

I don't understand what really is your problem, so I attached a small
sample. See if it's the behavior you want.

Ricardo

----------------------------------------------------------------------------
----

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Why are you giving self.window.panel as the parent to TextEntryDialog?

Why not just self as the parent? Did you already try?

Ricardo

···

On Fri, 2005-08-26 at 18:14 +0100, Raphael Arbuz wrote:

Thanks Ricargo, that's what I've done I think.

Here is my code if you can drop an eye that would help a lot!

textDialog = wx.TextEntryDialog(self.window.panel,
  "type in the text to insert", "type in the text to insert")