ofxKit Code Editor
README
ofxCodeEditorKit

ofxKit Runtime glue that wires the
ofxImGuiTextEdit code editor panel into an ofxKit app.Usage
#include "ofxCodeEditorKit.h"
class ofApp : public ofBaseApp {
ofxCodeEditorKit::CodeEditorKit m_codeKit;
public:
void setup() override {
// The entire integration: dialogs + window + font, wired once.
ofxCodeEditorKit::CodeEditorKit::Options opts;
opts.windowVisible = true;
m_codeKit.registerWith(runtime(), opts);
// Talk to the panel directly
m_codeKit.panel().setText(src, TextEditor::LanguageDefinitionId::Glsl);
}
};m_codeKit.registerWith() is safe to call once from ofApp::setup(), before or after runtime().attach() — the editor font loads via the Runtime post-setupAPI
namespace ofxCodeEditorKit {
class CodeEditorKit {
struct Options { bool registerWindow=true, windowVisible=false, loadFont=true; float fontSize=14.f; };
void registerWith(ofkitty::Runtime&);
void registerWith(ofkitty::Runtime&, const Options&);
TextEditorPanel& panel();
const TextEditorPanel& panel() const;
ImFont* font() const;
void draw(bool& visible); // when registerWindow=false
};
}Dependencies
ofxKit, ofxImGuiTextEdit, ofxImGuiStyle, ofxImGui Reference example
example-codeEditor — attaches the Runtime, registers the kit, and seeds the editor.License
MIT ofKitty
ofxAddons