I'm working on an editor for the Flat Assembler programming language so I need to use the wxStyledTextCtrl_2 for syntax highlighting. I've been trying for hours to use the code from the demo, but I keep getting errors no matter what I do.
Can someone please provide a simple example of the most minimal way to show a wxStyledTextCtrl_2 that is set to fill the empty space of my frame and redraw itself when the window is resized (or whatever it has to do to update itself)? I would really appreciate it.
I'm working on an editor for the Flat Assembler programming language so I need to use the wxStyledTextCtrl_2 for syntax highlighting. I've been trying for hours to use the code from the demo, but I keep getting errors no matter what I do.
Can someone please provide a simple example of the most minimal way to show a wxStyledTextCtrl_2 that is set to fill the empty space of my frame and redraw itself when the window is resized (or whatever it has to do to update itself)? I would really appreciate it.
Thanks,
David
Never mind about the above. I finally got it working. My next problem is that nothing is getting highlighted. Here's my code:
I'm working on an editor for the Flat Assembler programming language so I need to use the wxStyledTextCtrl_2 for syntax highlighting. I've been trying for hours to use the code from the demo, but I keep getting errors no matter what I do.
Can someone please provide a simple example of the most minimal way to show a wxStyledTextCtrl_2 that is set to fill the empty space of my frame and redraw itself when the window is resized (or whatever it has to do to update itself)? I would really appreciate it.
Thanks,
David
Never mind about the above. I finally got it working. My next problem is that nothing is getting highlighted. Here's my code:
You are not setting any styles, and so all styles used by the lexer are going to be drawn exactly the same way. So it's not a matter of things not getting highlighted, but that the highlighted things are indistinguishable from everything else.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
I'm working on an editor for the Flat Assembler programming language so I need to use the wxStyledTextCtrl_2 for syntax highlighting. I've been trying for hours to use the code from the demo, but I keep getting errors no matter what I do.
Can someone please provide a simple example of the most minimal way to show a wxStyledTextCtrl_2 that is set to fill the empty space of my frame and redraw itself when the window is resized (or whatever it has to do to update itself)? I would really appreciate it.
Thanks,
David
Never mind about the above. I finally got it working. My next problem is that nothing is getting highlighted. Here's my code:
You are not setting any styles, and so all styles used by the lexer are going to be drawn exactly the same way. So it's not a matter of things not getting highlighted, but that the highlighted things are indistinguishable from everything else.
I removed the keyword stuff. I had no idea what that was for, so I just put it there just in case it was required. How do I find out what style types are used in the ASM lexer? Are they the same as the Python lexer? I'm pretty new to Python, so please forgive my dumb questions.
Generally speaking, if you are using a lexer XXX, setting the lexer with
the name stc.STC_LEX_XXX, then the styles for that language is listed
under stc.STC_XXX_* . You can discover all such names if you do...
import wx.stc
for i in dir(wx.stc):
if i.startswith('STC_ASM_'):
print i
- Josiah
···
David Brown <david@atomicbinary.com> wrote:
Robin Dunn wrote:
> You are not setting any styles, and so all styles used by the lexer
> are going to be drawn exactly the same way. So it's not a matter of
> things not getting highlighted, but that the highlighted things are
> indistinguishable from everything else.
>
I removed the keyword stuff. I had no idea what that was for, so I just
put it there just in case it was required. How do I find out what style
types are used in the ASM lexer? Are they the same as the Python lexer?
I'm pretty new to Python, so please forgive my dumb questions.