[wxPython] EVT_CHAR in a wxNotebook.

I posted this question last week and got limited response, so I posting it
again. :slight_smile:

I have an application the provokes a lot of client windows. For
organization, I decided to use a wxNotebook to manage the windows instead of
having a lot of client framed windows. However, since I added the windows
to the wxnotebook, my EVT_CHAR event handlers don't fire. I've tried making
the window a wxpanel (thanks for whoever suggested that), but it hasn't
helped.

Here's my code snippets:

#creating the client windows

self.note = wxNotebook(self.splitter, -1)

#old code -self.chat = ChatFrame(self.splitter, -1,self.session)
self.chat = ChatFrame(self.note, -1,self.session)
self.tree = XMLTree(self.splitter, IDC_TREE)

self.splitter.SetMinimumPaneSize(100)
#old code - self.splitter.SplitVertically(self.tree, self.chat)
self.splitter.SplitVertically(self.tree, self.note)
elf.splitter.SetSashPosition(150)

self.note.AddPage(self.chat,"Chat")

#chat window class

class ChatFrame(wxWindow):
聽聽聽聽def __init__(self, parent, id, session):
聽聽聽聽聽聽聽聽wxWindow.__init__(self, parent, id)
聽聽...
聽聽聽聽聽聽聽聽self.chattxt = wxTextCtrl(self, -1, "")
聽聽聽聽EVT_CHAR(self.chattxt, self.OnChar)

You're going to kick yourself!

ChatFrame should have a class-parent of wxFrame, not wxWindow...

I hope you didn't hurt yourself too much... ::sunglasses:

Chris

路路路

-----Original Message-----
From: wxpython-users-admin@wxwindows.org
[mailto:wxpython-users-admin@wxwindows.org]On Behalf Of Chris Davis
Sent: Tuesday, 22 August 2000 7:38 AM
To: Wxpython-Users
Subject: [wxPython] EVT_CHAR in a wxNotebook.

I posted this question last week and got limited response, so I posting it
again. :slight_smile:

I have an application the provokes a lot of client windows. For
organization, I decided to use a wxNotebook to manage the windows
instead of
having a lot of client framed windows. However, since I added the windows
to the wxnotebook, my EVT_CHAR event handlers don't fire. I've
tried making
the window a wxpanel (thanks for whoever suggested that), but it hasn't
helped.

Here's my code snippets:

#creating the client windows

self.note = wxNotebook(self.splitter, -1)

#old code -self.chat = ChatFrame(self.splitter, -1,self.session)
self.chat = ChatFrame(self.note, -1,self.session)
self.tree = XMLTree(self.splitter, IDC_TREE)

self.splitter.SetMinimumPaneSize(100)
#old code - self.splitter.SplitVertically(self.tree, self.chat)
self.splitter.SplitVertically(self.tree, self.note)
elf.splitter.SetSashPosition(150)

self.note.AddPage(self.chat,"Chat")

#chat window class

class ChatFrame(wxWindow):
    def __init__(self, parent, id, session):
        wxWindow.__init__(self, parent, id)
  ...
        self.chattxt = wxTextCtrl(self, -1, "")
    EVT_CHAR(self.chattxt, self.OnChar)

_______________________________________________
wxPython-users mailing list wxPython-users@wxwindows.org
http://wxwindows.org/mailman/listinfo/wxpython-users

Wouldn't that make chatframe a separate Framed Window? (I tried it
anyway and that's what it did) I want chatframe to be a client window
in the the wxNotebook window.

Thanks

Chris Fama wrote:

路路路

You're going to kick yourself!

ChatFrame should have a class-parent of wxFrame, not wxWindow...

I hope you didn't hurt yourself too much... ::sunglasses:

Chris

> -----Original Message-----
> From: wxpython-users-admin@wxwindows.org
> [mailto:wxpython-users-admin@wxwindows.org]On Behalf Of Chris Davis
> Sent: Tuesday, 22 August 2000 7:38 AM
> To: Wxpython-Users
> Subject: [wxPython] EVT_CHAR in a wxNotebook.
>
>
> I posted this question last week and got limited response, so I posting it
> again. :slight_smile:
>
> I have an application the provokes a lot of client windows. For
> organization, I decided to use a wxNotebook to manage the windows
> instead of
> having a lot of client framed windows. However, since I added the windows
> to the wxnotebook, my EVT_CHAR event handlers don't fire. I've
> tried making
> the window a wxpanel (thanks for whoever suggested that), but it hasn't
> helped.
>
> Here's my code snippets:
>
> #creating the client windows
>
> self.note = wxNotebook(self.splitter, -1)
>
> #old code -self.chat = ChatFrame(self.splitter, -1,self.session)
> self.chat = ChatFrame(self.note, -1,self.session)
> self.tree = XMLTree(self.splitter, IDC_TREE)
>
> self.splitter.SetMinimumPaneSize(100)
> #old code - self.splitter.SplitVertically(self.tree, self.chat)
> self.splitter.SplitVertically(self.tree, self.note)
> elf.splitter.SetSashPosition(150)
>
> self.note.AddPage(self.chat,"Chat")
>
>
> #chat window class
>
> class ChatFrame(wxWindow):
> def __init__(self, parent, id, session):
> wxWindow.__init__(self, parent, id)
> ...
> self.chattxt = wxTextCtrl(self, -1, "")
> EVT_CHAR(self.chattxt, self.OnChar)
>
>
>
>
>
> _______________________________________________
> wxPython-users mailing list wxPython-users@wxwindows.org
> http://wxwindows.org/mailman/listinfo/wxpython-users
>

_______________________________________________
wxPython-users mailing list wxPython-users@wxwindows.org
http://wxwindows.org/mailman/listinfo/wxpython-users

--
chris davis
chris@rpgarchive.com

news and adventure database!

open source role playing!

Sorry, I misunderstood your message...

Have you tried replacing wxWindow with wxPanel? I vaguely recall an earlier
posting about something like this with such a solution...

Sorry if this reply comes too late, not to mention whether it's a totally
useless suggestion!

Cheerio, Chris

路路路

-----Original Message-----
From: wxpython-users-admin@wxwindows.org
[mailto:wxpython-users-admin@wxwindows.org]On Behalf Of chris
Sent: Thursday, 24 August 2000 8:24 AM
To: wxpython-users@wxwindows.org; Chris.Fama@uq.net.au
Subject: Re: [wxPython] EVT_CHAR in a wxNotebook.

Wouldn't that make chatframe a separate Framed Window? (I tried it
anyway and that's what it did) I want chatframe to be a client window
in the the wxNotebook window.

Thanks

Chris Fama wrote:
>
> You're going to kick yourself!
>
> ChatFrame should have a class-parent of wxFrame, not wxWindow...
>
> I hope you didn't hurt yourself too much... ::sunglasses:
>
> Chris
>
> > -----Original Message-----
> > From: wxpython-users-admin@wxwindows.org
> > [mailto:wxpython-users-admin@wxwindows.org]On Behalf Of Chris Davis
> > Sent: Tuesday, 22 August 2000 7:38 AM
> > To: Wxpython-Users
> > Subject: [wxPython] EVT_CHAR in a wxNotebook.
> >
> >
> > I posted this question last week and got limited response, so
I posting it
> > again. :slight_smile:
> >
> > I have an application the provokes a lot of client windows. For
> > organization, I decided to use a wxNotebook to manage the windows
> > instead of
> > having a lot of client framed windows. However, since I
added the windows
> > to the wxnotebook, my EVT_CHAR event handlers don't fire. I've
> > tried making
> > the window a wxpanel (thanks for whoever suggested that), but
it hasn't
> > helped.
> >
> > Here's my code snippets:
> >
> > #creating the client windows
> >
> > self.note = wxNotebook(self.splitter, -1)
> >
> > #old code -self.chat = ChatFrame(self.splitter, -1,self.session)
> > self.chat = ChatFrame(self.note, -1,self.session)
> > self.tree = XMLTree(self.splitter, IDC_TREE)
> >
> > self.splitter.SetMinimumPaneSize(100)
> > #old code - self.splitter.SplitVertically(self.tree, self.chat)
> > self.splitter.SplitVertically(self.tree, self.note)
> > elf.splitter.SetSashPosition(150)
> >
> > self.note.AddPage(self.chat,"Chat")
> >
> >
> > #chat window class
> >
> > class ChatFrame(wxWindow):
> > def __init__(self, parent, id, session):
> > wxWindow.__init__(self, parent, id)
> > ...
> > self.chattxt = wxTextCtrl(self, -1, "")
> > EVT_CHAR(self.chattxt, self.OnChar)
> >
> >
> >
> >
> >
> > _______________________________________________
> > wxPython-users mailing list wxPython-users@wxwindows.org
> > http://wxwindows.org/mailman/listinfo/wxpython-users
> >
>
> _______________________________________________
> wxPython-users mailing list wxPython-users@wxwindows.org
> http://wxwindows.org/mailman/listinfo/wxpython-users

--
chris davis
chris@rpgarchive.com

http://www.rpgarchive.com
news and adventure database!

http://www.openrpg.com
open source role playing!

_______________________________________________
wxPython-users mailing list wxPython-users@wxwindows.org
http://wxwindows.org/mailman/listinfo/wxpython-users

Yes I did, thanks for the suggestion, but it didn't work. Actually, the
way I fixed it was to use the wxTE_PROCESS_ENTER style on the
wxTextCtrl. Which makes sense, but wasn't required until I put the
parent window it a wxNotebook.

chris

Chris Fama wrote:

路路路

Sorry, I misunderstood your message...

Have you tried replacing wxWindow with wxPanel? I vaguely recall an earlier
posting about something like this with such a solution...

Sorry if this reply comes too late, not to mention whether it's a totally
useless suggestion!

Cheerio, Chris

> -----Original Message-----
> From: wxpython-users-admin@wxwindows.org
> [mailto:wxpython-users-admin@wxwindows.org]On Behalf Of chris
> Sent: Thursday, 24 August 2000 8:24 AM
> To: wxpython-users@wxwindows.org; Chris.Fama@uq.net.au
> Subject: Re: [wxPython] EVT_CHAR in a wxNotebook.
>
>
> Wouldn't that make chatframe a separate Framed Window? (I tried it
> anyway and that's what it did) I want chatframe to be a client window
> in the the wxNotebook window.
>
> Thanks
>
> Chris Fama wrote:
> >
> > You're going to kick yourself!
> >
> > ChatFrame should have a class-parent of wxFrame, not wxWindow...
> >
> > I hope you didn't hurt yourself too much... ::sunglasses:
> >
> > Chris
> >
> > > -----Original Message-----
> > > From: wxpython-users-admin@wxwindows.org
> > > [mailto:wxpython-users-admin@wxwindows.org]On Behalf Of Chris Davis
> > > Sent: Tuesday, 22 August 2000 7:38 AM
> > > To: Wxpython-Users
> > > Subject: [wxPython] EVT_CHAR in a wxNotebook.
> > >
> > >
> > > I posted this question last week and got limited response, so
> I posting it
> > > again. :slight_smile:
> > >
> > > I have an application the provokes a lot of client windows. For
> > > organization, I decided to use a wxNotebook to manage the windows
> > > instead of
> > > having a lot of client framed windows. However, since I
> added the windows
> > > to the wxnotebook, my EVT_CHAR event handlers don't fire. I've
> > > tried making
> > > the window a wxpanel (thanks for whoever suggested that), but
> it hasn't
> > > helped.
> > >
> > > Here's my code snippets:
> > >
> > > #creating the client windows
> > >
> > > self.note = wxNotebook(self.splitter, -1)
> > >
> > > #old code -self.chat = ChatFrame(self.splitter, -1,self.session)
> > > self.chat = ChatFrame(self.note, -1,self.session)
> > > self.tree = XMLTree(self.splitter, IDC_TREE)
> > >
> > > self.splitter.SetMinimumPaneSize(100)
> > > #old code - self.splitter.SplitVertically(self.tree, self.chat)
> > > self.splitter.SplitVertically(self.tree, self.note)
> > > elf.splitter.SetSashPosition(150)
> > >
> > > self.note.AddPage(self.chat,"Chat")
> > >
> > >
> > > #chat window class
> > >
> > > class ChatFrame(wxWindow):
> > > def __init__(self, parent, id, session):
> > > wxWindow.__init__(self, parent, id)
> > > ...
> > > self.chattxt = wxTextCtrl(self, -1, "")
> > > EVT_CHAR(self.chattxt, self.OnChar)
> > >
> > >
> > >
> > >
> > >
> > > _______________________________________________
> > > wxPython-users mailing list wxPython-users@wxwindows.org
> > > http://wxwindows.org/mailman/listinfo/wxpython-users
> > >
> >
> > _______________________________________________
> > wxPython-users mailing list wxPython-users@wxwindows.org
> > http://wxwindows.org/mailman/listinfo/wxpython-users
>
> --
> chris davis
> chris@rpgarchive.com
>
> http://www.rpgarchive.com
> news and adventure database!
>
> http://www.openrpg.com
> open source role playing!
>
>
> _______________________________________________
> wxPython-users mailing list wxPython-users@wxwindows.org
> http://wxwindows.org/mailman/listinfo/wxpython-users
>

_______________________________________________
wxPython-users mailing list wxPython-users@wxwindows.org
http://wxwindows.org/mailman/listinfo/wxpython-users

--
chris davis
chris@rpgarchive.com

news and adventure database!

open source role playing!

Yes I did, thanks for the suggestion, but it didn't work. Actually, the
way I fixed it was to use the wxTE_PROCESS_ENTER style on the
wxTextCtrl. Which makes sense, but wasn't required until I put the
parent window it a wxNotebook.

Hmm... I added an EVT_CHAR handler to the wxTextCtrl demo, which is on a
panel in a notebook, and it works fine...

wxNotebook does steal key events in order to handle navigation keys, but
everything else is supposed to be passed to the window with focus.

Maybe you can reduce your problem to a minimal sample and send it so I can
take a closer look.

路路路

--
Robin Dunn
Software Craftsman
robin@AllDunn.com
http://wxpython.org Java give you jitters?
http://wxpros.com Relax with wxPython!

Thanks. Using the wxTE_PROCESS_ENTER style fixed my problem.

路路路

-----Original Message-----
From: wxpython-users-admin@wxwindows.org
[mailto:wxpython-users-admin@wxwindows.org]On Behalf Of Robin Dunn
Sent: Thursday, August 24, 2000 11:58 PM
To: wxPython-users
Subject: Re: [wxPython] EVT_CHAR in a wxNotebook.

> Yes I did, thanks for the suggestion, but it didn't work. Actually, the
> way I fixed it was to use the wxTE_PROCESS_ENTER style on the
> wxTextCtrl. Which makes sense, but wasn't required until I put the
> parent window it a wxNotebook.
>

Hmm... I added an EVT_CHAR handler to the wxTextCtrl demo, which is on a
panel in a notebook, and it works fine...

wxNotebook does steal key events in order to handle navigation keys, but
everything else is supposed to be passed to the window with focus.

Maybe you can reduce your problem to a minimal sample and send it so I can
take a closer look.

--
Robin Dunn
Software Craftsman
robin@AllDunn.com
http://wxpython.org Java give you jitters?
http://wxpros.com Relax with wxPython!

_______________________________________________
wxPython-users mailing list wxPython-users@wxwindows.org
http://wxwindows.org/mailman/listinfo/wxpython-users