Comments (3)
@flutefreak7 Hey,
Ex.Co is a standalone PyQt application that uses a subclassed QMainWindow as it's main GUI component on which it relies heavily. So from that standpoint it is not meant to be embedded into another application.
But I think Ex.Co is great if you want to add your light QsciScintilla based editor you mentioned into Ex.Co, that should not be difficult. I can even help you with that.
As far as using the code from Ex.Co, of course you can and in any way you like. You just have to make sure that if you distribute your application, you have to make the entire source code available, as per GPLv3. You can read the LICENSE.txt
for the whole license explanation (github
even has the synopsis of the license in bullet points on the top of that file page).
Matic
from exco.
I'm building a fairly big customized GUI to wrap an analysis code. Much of the GUI is widgets to control analysis input settings and 2D and 3D plots/visualizations to help the user set up the analysis. All the settings are written to an input file for the actual analysis code. Rather than assume my GUI can do everything, I figured I would bake a text editor in as a fallback. So far I am using QsciScintilla as the editor component and enjoying the simliarity of features that it has with Notepad++ which I normally use to edit these files.
Because of my use case, I don't think I'll be able to use Ex.Co directly.
I think Ex.Co will be a great source of inspiration when I go to add things like a find and replace dialog or other similar features that are expected in a simple text editor.
I'm also having issues with Syntax Highlighting bogging it down. My file has multiple contexts unfortunately and so I got the bright idea to parse the entire file in a separate python function that uses tons of regexes and returns a dictionary of styles. Each style key in the dictionary contains a list of every character location that requires that style. The CustomLexer simply calls the python function and then loops through the file 1 character at a time applying the appropriate styles by checking which style the character belongs to. It's so ugly, I'm kinda shocked it runs as fast as it does! I'm not sure I have the experience to do what you've done with Cython lexers and I might need to leverage a faster regex library or something.
Do you know of a way to control how often the editor triggers the lexer? Can I control it with a custom signal?
from exco.
Hey @flutefreak7 ,
Your project sound awesome, best of luck to you.
As far as syntax highlighting goes, you cannot directly control when the QsciScintilla editor triggers the lexer's styling method. You could change it in the QScintilla C++ source and recompile it, but that is the hard way, since you have to get all the correct Qt and SIP source libraries. The easier thing you could do is to add a condition in the lexers styling method to allow styling only when a certain condition is met, or do it like Visual Studio does it, with a timer that styles the text in the background and only styles when there are no text changes after a certain period of time, like 0.5 seconds. Every time a text change occurs, the style method just resets the timer. That way you get the VS style that paints the text after a small delay after typing something and while typing there are no abrupt stylings that hamper performance. You will have to play a bit with either threading.Thread
or QThread
to get it working as you wish.
If you want to try a lexer in Cython, me and Kristof Mulier made documentation for QScintilla. Kristof made the website https://qscintilla.com , but it does not have the Cython lexer stuff yet. In the raw documentation we made: https://github.com/matkuki/qscintilla_docs, check out chapter 4. Lexers
for the documentation and chapter X.7 Cython Lexer module (Cython)
for a example code. It is not that hard to understand the code.
Matic
from exco.
Related Issues (20)
- First run fails due to missing .exco folder HOT 4
- Crash with menu item "System | Show current working directory explorer Alt+F7" HOT 7
- Converting the editor to an executable file to use on Linux 64 HOT 2
- Supporting "Spice" Syntax in Lexers' choice HOT 3
- Supporting Custom autocompletion functions using a custom-defined api HOT 3
- How to build from source on MSYS2 MINGW64? HOT 1
- Make program fonts look better on Windows HOT 1
- Add SmallBASIC lexer HOT 1
- 如何打包? HOT 2
- Please add Lisp/SKILL(Cadence) lexer HOT 1
- QAction setShortcut in QsciScintilla custom menu doesn't work HOT 4
- Hello, do you support Lua language
- Do you consider adding a terminal based on paramiko to connect to SSH client? HOT 1
- is there a debugger for some of the coding langs?? HOT 1
- Add Hy language support in interactive interpreter HOT 1
- is there a user manual? HOT 1
- how to switch theme? HOT 1
- restore session
- feature request:monitor file change and prompt for reload
- extend node tree to support my own language
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from exco.