Expand description
Preview, context-bound ImGuiColorTextEdit bindings through cimCTE.
Persistent TextEditor and TextDiff values are created from a
dear_imgui_rs::Context and rendered through CteUiExt on that same Context.
This fragment assumes an attached managed renderer and platform frame setup;
see examples/03-features/cte_minimal.rs for a runnable application:
use dear_imgui_cte::{CteUiExt, Language, TextEditor};
use dear_imgui_rs::Context;
let mut imgui = Context::create();
let mut editor = TextEditor::try_create(&imgui)?;
editor.set_text("int main() { return 0; }\n")?;
editor.set_language(Some(Language::Cpp));
let ui = imgui.frame();
ui.text_editor(&mut editor, "Source")
.size([640.0, 480.0])
.build()?;Native owners are neither Send nor Sync. Rendering with a Ui from another Context is
rejected before FFI, and applications should drop every CTE owner before its Context. If the
Context has already died, Drop deliberately leaks the native handle rather than dereferencing
invalid native state.
Stateful callbacks are owned by their editor. Reentering the same mutable callback skips the nested invocation; text filters validate a complete batch before mutation. A callback panic is diagnosed and aborts rather than unwinding through native C++ frames. Trie autocomplete uses upstream-exclusive callback slots, so conflicts are reported instead of silently replacing user callbacks.
Add dejavu_font_source to the managed font atlas before renderer initialization. Do not use
the raw cimCTE SetDejavu helper from safe integrations: it clears the complete atlas and
changes its loader outside renderer texture management.
Structs§
- Autocomplete
Config - Configuration copied into an editor when autocomplete is installed.
- Autocomplete
Context - Copied syntax context for one autocomplete request.
- Autocomplete
Request - Callback-scoped access to the current autocomplete request.
- Caret
Event - Copied caret geometry and style for one render callback.
- Decorator
Event - Copied line-decorator geometry for one render callback.
- Line
Number Event - Copied geometry and palette color for one line-number render callback.
- Palette
- An owned copy of all editor palette colors.
- Popup
Event - Copied document position for a context-menu or hover callback.
- Position
- A document position expressed as a zero-based line and glyph column.
- Search
Options - Matching options used by occurrence search operations.
- Selection
- A half-open document selection.
- Squiggle
Kind - Application-defined diagnostic category for a squiggle.
- Text
Change - A text transaction view valid only for one callback invocation.
- Text
Diff - An owned, context-bound syntax-highlighted text diff.
- Text
Diff Renderer - Builder for one TextDiff render submission.
- Text
Editor - An owned, context-bound ImGuiColorTextEdit editor.
- Text
Editor Renderer - Builder for one TextEditor render submission.
- Trie
Autocomplete - A transient view proving that Trie autocomplete is owned by its editor.
- Visual
Position - A visual row and column after wrapping and folding are applied.
Enums§
- CteError
- Errors reported by the safe cimCTE layer.
- Language
- A built-in ImGuiColorTextEdit language definition.
- Middle
Mouse Mode - Middle-mouse interaction behavior.
- Palette
Color - Semantic color slots used by ImGuiColorTextEdit.
- Scroll
Alignment - Vertical alignment used when scrolling a line into view.
- Squiggle
Style - Rendering style for a diagnostic or search-result annotation.
- Text
Change Kind - Whether a transaction inserted or deleted text.
Traits§
- CteUi
Ext - Extension methods for rendering cimCTE widgets from a Dear ImGui frame.
Functions§
- dejavu_
font_ source - Returns cimCTE’s bundled DejaVu font as a safe Dear ImGui font source.
- noto_
sans_ sc_ font_ source - Returns cimCTE’s bundled Noto Sans SC font through the managed font atlas.
Type Aliases§
- CteResult
- Result alias used by the safe cimCTE layer.