j_arun_mani,
I just tested this on Windows, where this “works natively”.
I set the linit to be 20 and the control initially empty.
Start typing you can’t emter more than 20 symbols and the cursor keeps the end position.
Trying to enter text in the middle - new text will not be entered and the cursor will keep its position.
Delete everything. Control is empty.
Try to paste a long string - the paste will be truncated and the cursor will be at the position 20.
Enter some text, move the cursor in the middle and try to paste - paste will be partially allowed and the cursor will keep its relative position.
So I guess you are right - paste will be partially allowed.
I will see if I can convert my code to C - should be straightforward…
Please tag usernames using @. For example I can tag you by @oneeyeman1. By tagging a person, the person gets a notification. It helps
Sorry, I’m not so fluent in C, but as far as I know, converting GI (GObject Introspection) based code should be pretty straight forward.
I think you are referring to syntax highlighting as “code format”. To wrap code in our message, you can enclose them in triple back ticks. To get syntax highlighting of a specific language, specify the language after the first triple back ticks.
python
print(“hello”)
Coming back to the topic, I will also try my best in finding an appropriate solution for your case.
Cheers