| | |
Detecting changes in RichTextCtrl
Thread Solved |
•
•
Join Date: Nov 2008
Posts: 41
Reputation:
Solved Threads: 1
Hi there.
I am using a RichTextCtrl on a window with a toolbar. The toolbar has a save button on it that is disabled by default when the application starts.
I need this button to become enabled when the user changes something in the RichTextCtrl, but I'm having trouble working out how to detect such a change. I managed to create a KEY_DOWN event for the RichTextCtrl, but while that allowed me to enable the save button, it also prevented me from typing anything!
Can anyone point me in the right direction please?
regards
Max
I am using a RichTextCtrl on a window with a toolbar. The toolbar has a save button on it that is disabled by default when the application starts.
I need this button to become enabled when the user changes something in the RichTextCtrl, but I'm having trouble working out how to detect such a change. I managed to create a KEY_DOWN event for the RichTextCtrl, but while that allowed me to enable the save button, it also prevented me from typing anything!
Can anyone point me in the right direction please?
regards
Max
try using wx.EVT_TEXT and bind it to the Rich Text control.
Make it idiot proof and someone will make a better idiot.
Check out my Site | and join us on IRC | Python Specific IRC
Check out my Site | and join us on IRC | Python Specific IRC
I think the better way would just be to map CTRL+<character> to the items under an Edit menu.
ie,
ie,
Python Syntax (Toggle Plain Text)
File, Edit, Help |_Bold Ctrl+B |_Italic Ctrl+I
Are you trying to make a text editor? In my opinion, a text editor would most definitely benefit from a menu system.
•
•
Join Date: Nov 2008
Posts: 41
Reputation:
Solved Threads: 1
Hmm. Text Editor. Well, sort of.
I'm an author, and the program is called 'Author Tool'. It does incorporate a text editor, but the menu would be sort of superfluous - As a tool it is designed to speed up my writing, which means Keyboard shortcuts for pretty much everything that I might do while actually typing. I use a toolbar for navigation, character creation etc.
I'm trying to re-write this program in Python, basically as a learning exercise - I have a copy that I use most days, written in Gambas.
Regards
Max
I'm an author, and the program is called 'Author Tool'. It does incorporate a text editor, but the menu would be sort of superfluous - As a tool it is designed to speed up my writing, which means Keyboard shortcuts for pretty much everything that I might do while actually typing. I use a toolbar for navigation, character creation etc.
I'm trying to re-write this program in Python, basically as a learning exercise - I have a copy that I use most days, written in Gambas.
Regards
Max
I guess what you could do is set up a menu with the CTRL+<Letter> shortcuts binded and then just keep it hidden.
That way the bindings are taken care of but you don't have to see it...
That way the bindings are taken care of but you don't have to see it...
![]() |
Other Threads in the Python Forum
- Previous Thread: screen scraping
- Next Thread: Batch Processing
| Thread Tools | Search this Thread |
abrupt ansi anti approximation assignment avogadro backend beginner binary bluetooth calculator character cmd code customdialog cx-freeze data decimals dictionaries dictionary directory dynamic error examples exe file float format function gnu graphics gui heads homework http ideas import input itunes java launcher leftmouse line linux list lists loop module mouse number numbers output parsing path pointer port prime programming progressbar projects push py2exe pygame pyglet pyqt python random recursion schedule screensaverloopinactive script scrolledtext sqlite ssh statistics string strings sudokusolver sum table terminal text thread threading time tlapse tricks tuple tutorial twoup ubuntu unicode urllib urllib2 variable ventrilo wikipedia write wxpython xlib






