The sql lexer is a little different in that the definition of the keywords is case sensitive. Change your keyword defs to all lower case (i.e ‘SELECT’ => ‘select’) and everything should be good.
Regards,
Cody
···
On Jul 31, 2007, at 11:19 AM, Geoff Skerrett wrote:
Does anyone have any experience using the StyledTextCtrl and the SQL Lexer ?
I can’t get the keywords to become highlighted and I am a little stumped on where to look next.
Here is what I have done so far;
copied the demo to a working file
changed the line self.SetLexer(wx.STC_LEX_PYTHON) to self.SetLexer(wx.STC_LEX_SQL)
added my own keyword list with [‘SELECT’, ‘INSERT’, ‘UPDATE’, … etc]
updated the appropriate spots where the keyword module was referenced
changed all of the appropriate commands dealing with styles to the corresponding wx.STC_SQL_**
This demo file runs fine (without errors) but the words in the keyword list don’t appear as bold.
If I set the lexer back to wx.STC_LEX_PYTHON then the keywords do become bold.
Based on the this brief description, does anyone have any hints/suggestions ?
Geoff Skerrett
Murray, Skerrett & Associates, Jonas Business Software