Re: printing text in area by calling a function



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

"Raghul Jagan" <jraghul85 hotmail com> writes:

>>From: Roger Leigh <rleigh whinlatter ukfsn org>

>>"Raghul Jagan" <jraghul85 hotmail com> writes:
>>
>> > Please give a solution for printing a text in text area
>>
>>What is a "Text Area" in this context?  A Label, an Entry, a
>>TextView/TextBuffer?  Something else?
>>
>>Please could you be a little more precise about what you would like to
>>do?
>
> to print in text area in text buffer  .It should be like a function so
> when I call that particular function say  "printtext" It should get
> printed over the text area .It should be possible for me  to call that
> function anywhere in function even after main too.Please give me a
> solution

I haven't used the text buffer/view to do anything very
sophisticated.  This is just a suggestion:

At the position in the text buffer where the text should go, insert
two GtkTextMark objects (you'll need to get a GtkTextIter at this
position first).  Store these in the object containing/derived from
GtkTextBuffer/View, and create methods that use them:

Now you have the marks, you can keep them there for the lifetime of
the object.  When it comes to inserting text, you can delete the text
between the marks using gtk_text_buffer_delete() (convert them both to
iterators first).  Next, you can insert the new text between them
using gtk_text_buffer_insert().

This is just from reading the API reference.  You'll need to test it
first, but it should be fairly straightforward.


Regards,
Roger

- -- 
Roger Leigh
                Printing on GNU/Linux?  http://gimp-print.sourceforge.net/
                Debian GNU/Linux        http://www.debian.org/
                GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>

iD8DBQFB7ry6VcFcaSW/uEgRAjQZAJ9odoH2/1xhJWBLzZg3LDlviXyMOgCg6lMg
iCYs0xmHREHz26aKoQr001c=
=8qeh
-----END PGP SIGNATURE-----



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