A few questions on GtkTextView



Hi All,
I have a few questions on GtkTextView.
It will be helpful, if someone can throw some light on this.

First:
a.TextView and 80 column limit:
 I need to create a TextView widget, which can take inputs
to a maximum of only 80 characters.
How do I set this limit on the textview widget? I need to do this, so that the
this input is saved into a file and regenerated as a C file, which can display only
80 chars on any standard terminal.

For eg:

Text View:

| This line should be of only 80 characters. I need to wrap anything after this
| for sure.
|
|
-------------------------------------------------------------------------------
Note: I have tried using the API: set_border_window_size, but it also did
not have any effect.
To get the above setting, do I need to tinker with the width of the GtkTextView
widget or does the TextView widget itself support this through an API?
[Note: I am using a fixed  font for this, Courier].

b. TextView and formatting of input:
Whenever, I save the contents of the TextView widget into a file, I observe
that multi lines are saved as only one big line in the stored file. Due
to this, the formatting done on the TextView[for eg: newlines or an enter
in the input] are all lost in the saved file. Is there a way in which I
store the inputs from the GtkTextView with the corresponding \r\n, etc in the
saved file?

Thanks
Ashwin



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]