[wxPython] Text Editor

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[wxPython] Text Editor

Yanko, Curtis (GSP)
Is there an example of a text editor in wxPython?

I have some menu-driven console apps that I want to put a GUI on. Basically
I want to put the output into a TextCtrl and use the GUI menus to drive it.

-Curt

_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users



Reply | Threaded
Open this post in threaded view
|

Re: [wxPython] Text Editor

Robin Dunn
> Is there an example of a text editor in wxPython?
>
> I have some menu-driven console apps that I want to put a GUI on.
Basically
> I want to put the output into a TextCtrl and use the GUI menus to drive
it.

Dirk has done a fairly featureful text editor that you can get at
http://www.spirito.de/pyde/, but I suspect from your message that you are
not looking for something that comprehensive.  You can probably use the
wxTextCtrl with the wxTE_MULTILINE style.  See the docs for details and the
demo for examples.

--
Robin Dunn
Software Craftsman
[hidden email]
http://AllDunn.com/robin/
http://AllDunn.com/wxPython/  Check it out!



_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users



Reply | Threaded
Open this post in threaded view
|

RE: [wxPython] Text Editor

Yanko, Curtis (GSP)
In reply to this post by Yanko, Curtis (GSP)
I could have worded it better. I am using the wxTextCtrl and I'm sure it'll
do what I need. I was looking for some of the other things that go into it.
Like making the size of the control follow the frame (which I have since
figured out using LayoutConstraints). Now I'm having trouble understanding
Events.

I have a TextCtrl in a Panel on a frame. How do I capture the keystrokes in
the TextCtrl so that accelerator keys get routed to the right place? Right
now I just have Alt-x and Ctrl-h. would I use the EVT_TEXT? Once there, how
do I separate my accelerators and let the rest go to the text window?

Thanks for the pointer to Dirk's work. Even though it isn't what I'm trying
to do I'm sure I can learn from it.

-Curt

> -----Original Message-----
> From: Robin Dunn [SMTP:[hidden email]]
> Sent: Wednesday, October 13, 1999 1:32 PM
> To: Yanko, Curtis (GSP); [hidden email]
> Subject: Re: [wxPython] Text Editor
>
> > Is there an example of a text editor in wxPython?
> >
> > I have some menu-driven console apps that I want to put a GUI on.
> Basically
> > I want to put the output into a TextCtrl and use the GUI menus to drive
> it.
>
> Dirk has done a fairly featureful text editor that you can get at
> http://www.spirito.de/pyde/, but I suspect from your message that you are
> not looking for something that comprehensive.  You can probably use the
> wxTextCtrl with the wxTE_MULTILINE style.  See the docs for details and
> the
> demo for examples.
>
> --
> Robin Dunn
> Software Craftsman
> [hidden email]
> http://AllDunn.com/robin/
> http://AllDunn.com/wxPython/  Check it out!
>

_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users



Reply | Threaded
Open this post in threaded view
|

Re: [wxPython] Text Editor

Robin Dunn
> I have a TextCtrl in a Panel on a frame. How do I capture the keystrokes
in
> the TextCtrl so that accelerator keys get routed to the right place? Right
> now I just have Alt-x and Ctrl-h. would I use the EVT_TEXT? Once there,
how
> do I separate my accelerators and let the rest go to the text window?
>

If you mean menu accelerators take alook at wxAcceratorTable ans
wxAcceleratorEntry and the demo for a sample.  If you want to capture
arbitrary keystrokes look at EVT_CHAR or EVT_KEY_DOWN.  You'll have to
attach those to the wxTextCtrl itself as thos kind of events don't travel up
the containment heirachy.

--
Robin Dunn
Software Craftsman
[hidden email]
http://AllDunn.com/robin/
http://AllDunn.com/wxPython/  Check it out!



_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users



Reply | Threaded
Open this post in threaded view
|

RE: [wxPython] Text Editor

Yanko, Curtis (GSP)
In reply to this post by Yanko, Curtis (GSP)
I had tried this:

        # set the menu accellerator table...
        aTable = wxAcceleratorTable([(wxACCEL_ALT,  ord('X'), exitID),
                                     (wxACCEL_CTRL, ord('H'), helpID)])
        self.SetAcceleratorTable(aTable)

But it seemed that if the TextCtrl had the focus, I just got an 'x' or an
'h'

> -----Original Message-----
> From: Robin Dunn [SMTP:[hidden email]]
> Sent: Friday, October 15, 1999 1:05 AM
> To: Yanko, Curtis (GSP); [hidden email]
> Subject: Re: [wxPython] Text Editor
>
> > I have a TextCtrl in a Panel on a frame. How do I capture the keystrokes
> in
> > the TextCtrl so that accelerator keys get routed to the right place?
> Right
> > now I just have Alt-x and Ctrl-h. would I use the EVT_TEXT? Once there,
> how
> > do I separate my accelerators and let the rest go to the text window?
> >
>
> If you mean menu accelerators take alook at wxAcceratorTable ans
> wxAcceleratorEntry and the demo for a sample.  If you want to capture
> arbitrary keystrokes look at EVT_CHAR or EVT_KEY_DOWN.  You'll have to
> attach those to the wxTextCtrl itself as thos kind of events don't travel
> up
> the containment heirachy.
>
> --
> Robin Dunn
> Software Craftsman
> [hidden email]
> http://AllDunn.com/robin/
> http://AllDunn.com/wxPython/  Check it out!
>

_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users



Reply | Threaded
Open this post in threaded view
|

RE: [wxPython] Text Editor

Yanko, Curtis (GSP)
In reply to this post by Yanko, Curtis (GSP)
I take it back... I must be going nuts because now it works!

> -----Original Message-----
> From: Yanko, Curtis (GSP) [SMTP:[hidden email]]
> Sent: Friday, October 15, 1999 6:29 AM
> To: [hidden email]
> Subject: RE: [wxPython] Text Editor
>
> I had tried this:
>
>         # set the menu accellerator table...
>         aTable = wxAcceleratorTable([(wxACCEL_ALT,  ord('X'), exitID),
>                                      (wxACCEL_CTRL, ord('H'), helpID)])
>         self.SetAcceleratorTable(aTable)
>
> But it seemed that if the TextCtrl had the focus, I just got an 'x' or an
> 'h'
>
> > -----Original Message-----
> > From: Robin Dunn [SMTP:[hidden email]]
> > Sent: Friday, October 15, 1999 1:05 AM
> > To: Yanko, Curtis (GSP); [hidden email]
> > Subject: Re: [wxPython] Text Editor
> >
> > > I have a TextCtrl in a Panel on a frame. How do I capture the
> keystrokes
> > in
> > > the TextCtrl so that accelerator keys get routed to the right place?
> > Right
> > > now I just have Alt-x and Ctrl-h. would I use the EVT_TEXT? Once
> there,
> > how
> > > do I separate my accelerators and let the rest go to the text window?
> > >
> >
> > If you mean menu accelerators take alook at wxAcceratorTable ans
> > wxAcceleratorEntry and the demo for a sample.  If you want to capture
> > arbitrary keystrokes look at EVT_CHAR or EVT_KEY_DOWN.  You'll have to
> > attach those to the wxTextCtrl itself as thos kind of events don't
> travel
> > up
> > the containment heirachy.
> >
> > --
> > Robin Dunn
> > Software Craftsman
> > [hidden email]
> > http://AllDunn.com/robin/
> > http://AllDunn.com/wxPython/  Check it out!
> >
>
> _______________________________________________
> wxPython-users maillist  -  [hidden email]
> http://starship.python.net/mailman/listinfo/wxpython-users

_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users