| | |
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 |
alarm ansi anydbm app assignment backend beginner binary bluetooth character cipher cmd coordinates customdialog cx-freeze data decimals development directory dynamic exe feet file float format function generator getvalue gnu graphics halp handling heads homework http ideas input ip itunes java keycontrol leftmouse line linux list lists loop maintain maze millimeter module mouse number numbers output parsing path pointer prime programming progressbar push py2exe pygame pymailer python queue random recursion recursive schedule screensaverloopinactive script slicenotation sqlite ssh statistics string strings sudokusolver text thread time tlapse tuple ubuntu unicode url urllib urllib2 variable ventrilo vigenere web webservice wikipedia write wxpython xlib xlwt






