### Install QTMonaco with PySide6 Source: https://github.com/bec-project/qtmonaco/blob/main/README.md Install QTMonaco with all dependencies using PySide6 as the Qt backend. This is the recommended installation method. ```bash pip install qtmonaco[all,pyside6] ``` -------------------------------- ### Install QTMonaco with PyQt6 Source: https://github.com/bec-project/qtmonaco/blob/main/README.md Install QTMonaco with all dependencies using PyQt6 as the Qt backend. ```bash pip install qtmonaco[all,pyqt6] ``` -------------------------------- ### Install QTMonaco without Qt dependencies Source: https://github.com/bec-project/qtmonaco/blob/main/README.md Install QTMonaco without extra dependencies if a Qt framework is already installed. ```bash pip install qtmonaco ``` -------------------------------- ### Monaco Class: Text Operations Source: https://github.com/bec-project/qtmonaco/blob/main/README.md Provides Python code examples for basic text manipulation within the Monaco editor widget, including setting and getting text content, and positioning the cursor. ```python # Text operations monaco.set_text(content: str) monaco.get_text() -> str monaco.set_cursor(line: int, column: int) # Set cursor position monaco.current_cursor() -> tuple[int, int] # Get current cursor position ``` -------------------------------- ### Quick Start: Basic Monaco Editor Widget Source: https://github.com/bec-project/qtmonaco/blob/main/README.md Demonstrates how to create and display a basic Monaco editor widget with Python syntax highlighting and a dark theme. The widget is configured with a default size and initial text content. ```python from qtpy.QtWidgets import QApplication from qtmonaco import Monaco qapp = QApplication([]) widget = Monaco() # set the default size widget.resize(800, 600) widget.set_language("python") widget.set_theme("vs-dark") widget.set_minimap_enabled(False) widget.set_text( """ import numpy as np from typing import TYPE_CHECKING if TYPE_CHECKING: from bec_lib.devicemanager import DeviceContainer from bec_lib.scans import Scans dev: DeviceContainer scans: Scans ####################################### ########## User Script ##################### ####################################### # This is a comment def hello_world(): print("Hello, world!") """) widget.show() qapp.exec_() ``` -------------------------------- ### Monaco Class: Language and Syntax Source: https://github.com/bec-project/qtmonaco/blob/main/README.md Shows how to set and get the programming language for syntax highlighting in the Monaco editor widget. ```python # Language and syntax monaco.set_language(language: str) monaco.get_language() -> str ``` -------------------------------- ### Monaco Class: Editor Configuration Source: https://github.com/bec-project/qtmonaco/blob/main/README.md Demonstrates Python code for configuring the Monaco editor's appearance and behavior, including setting themes, read-only mode, and minimap visibility. ```python # Editor configuration monaco.set_theme(theme: str) # "vs", "vs-dark", "hc-black" monaco.get_theme() -> str monaco.set_read_only(read_only: bool) monaco.set_minimap_enabled(enabled: bool) ``` -------------------------------- ### Monaco Class - Basic Methods Source: https://github.com/bec-project/qtmonaco/blob/main/README.md Provides methods for basic text manipulation, language setting, and editor configuration within the Monaco Editor widget. ```APIDOC ## Monaco Class - Basic Methods ### Description Provides methods for basic text manipulation, language setting, and editor configuration within the Monaco Editor widget. ### Methods #### Text Operations - `set_text(content: str)`: Sets the content of the editor. - `get_text() -> str`: Retrieves the current text content of the editor. - `set_cursor(line: int, column: int)`: Sets the cursor position to a specific line and column. - `current_cursor() -> tuple[int, int]`: Gets the current cursor position (line, column). #### Language and Syntax - `set_language(language: str)`: Sets the programming language for syntax highlighting and features. - `get_language() -> str`: Retrieves the currently set programming language. #### Editor Configuration - `set_theme(theme: str)`: Sets the editor's visual theme. Supported themes include "vs", "vs-dark", and "hc-black". - `get_theme() -> str`: Retrieves the currently active editor theme. - `set_read_only(read_only: bool)`: Enables or disables read-only mode for the editor. - `set_minimap_enabled(enabled: bool)`: Toggles the visibility of the minimap overview. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.