On Wednesday 29 May 2013 21:38:03 Adrián Chaves Fernández wrote: > Hi, > > I want to start an application with a text editor that provides a specific > syntax highlighting, as the application is only going to support a specific > type of files (MediaWiki). Then I plan to build some features > (auto-complete, etc.) on top of it. > > Not to reinvent the wheel, I wanted to reuse Kate’s text edition widget. > I’ve actually been working on improving the MediaWiki syntax highlighting > support in Kate, so reusing that work for my app would be ideal. > > So I found myself copying and pasting the code in > http://techbase.kde.org/Development/Tutorials/Using_KParts > > Now I have a working KatePart. But I have no idea whatsoever about > interacting with it from code (such as getting an instance of > KateDocument). Any recommendation that puts me in the right direction to > set the KatePart syntax highlighting from code?
Look at KTextEditor and its apidox. If in doubt grep for it in KDevplatform to see how its being used. > Also, I want to manually define the context-menu items and any other actions > in the interface, so I’m not calling createGUI(m_part). Most KatePart > actions I don’t want to provide, so is KatePart the right choice for me > nonetheless? Or is there another way (without kparts) of reusing Kate’s > text edition widget that fits my use case better? You can use KTextEditor::Editor::createDocument (e.g. from KTextEditor::Factory) and then create a view for that document. Regarding filtering of context menu items, I'm not sure anymore whether there is anything being added automatically. If so and you cannot find a way to circumvent that, feel free to contact us on kwrite-devel and we'll find a way to solve this. Cheers -- Milian Wolff m...@milianw.de http://milianw.de
signature.asc
Description: This is a digitally signed message part.
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<