0

Any one know how i can create a text area which displays lines of text which can not be edited but allows you to edit the bottom most line for text.

basically in a similar fashion to embedded consoles inside applications that allow you to run code direct on the application.

currently using a textview i can go and edit the code above and the output response are also editable.

Oly
  • 370
  • 5
  • 16
  • Is there some restriction not using a GtkEntry as entry plus a secondary widget for your ltes call it history? – drahnr Oct 08 '13 at 10:01
  • not really it just does not look as good, and other have managed it some how maybe using some other widget. – Oly Oct 08 '13 at 10:45

1 Answers1

3

It's possible using a GtkTextView, but not trivial. You have to create a tag that makes the text uneditable, and apply it from the beginning of the buffer to just before the end position. Then when you receive and process input, extend or re-apply the tag to cover that line of input and your program's response to it.

Here's an example of it being done:

ptomato
  • 56,175
  • 13
  • 112
  • 165