[Gtk-sharp-list] TextViewer

Patrik Olterman patrik@olterman.se
19 May 2003 10:39:23 +0200


--=-+HNPDdR9slOPC6feiLd1
Content-Type: multipart/mixed; boundary="=-4qxVNSFDCmPlwNK+r5lf"


--=-4qxVNSFDCmPlwNK+r5lf
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

got it all together with a lot of guess work and a text buffer, now i
get somewhat magical errors. When I try to write the textbuffer to disc
it sometimes writes an empty buffer and sometimes it writes all lines
except tha last 17 lines (in a 420 line code) and yet again sometimes it
behaves perfectly. Is there any attributes to text buffer I can check
what gives ? also is there an alternative method of wrtiting a buffer to
disc than streamwriter?=20

On Mon, 2003-05-19 at 10:06, Lee Mallabone wrote:
> On Mon, 2003-05-19 at 06:49, Patrik Olterman wrote:
> >=20
> > What methods and members are there of the TextViewer class, that is how
> > can I access the text written in there?=20
>=20
> IIRC there is a Text property on the TextBuffer class. You can probably
> get the relevant text buffer with a Buffer property - until the C# docs
> are complete, it often helps to check the Gtk+ docs for better info.
>=20
> >  Alternatively how do I make it so I can reuse the
> > window even when destroyed (submitting the code here, forgive the messy
> > code its my first try)=20
>=20
> If you destroy the window, it is no longer usable.=20
> If you hide the window and you find that it is getting destroyed implicit=
ly, you need to call window.Ref() before hiding it so that Gtk doesn't deci=
de it's no longer needed....
>=20
> Regards,
>=20
> Lee.
>=20
>=20
> _______________________________________________
> Gtk-sharp-list maillist  -  Gtk-sharp-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

--=-4qxVNSFDCmPlwNK+r5lf
Content-Disposition: attachment; filename=compile.cs
Content-Type: x-directory/normal; name=compile.cs
Content-Transfer-Encoding: base64

LyoKICogIFRoaXMgcHJvZ3JhbSBpcyBmcmVlIHNvZnR3YXJlOyB5b3UgY2FuIHJlZGlzdHJpYnV0
ZSBpdCBhbmQvb3IgbW9kaWZ5CiAqICBpdCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5l
cmFsIFB1YmxpYyB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AgZmlsZS5Xcml0ZShidWYuVGV4dCk7CiAgICBmaWxlLldyaXRlKCJcbiBFT0YiKTsKICAgIENv
bnNvbGUuV3JpdGVMaW5lKCJzYXZlZCBcbi0tLS0tLS0tLS0tLS0tLS0tLS1cbiIgKyBidWYuVGV4
dCk7CiAgICBGaWxlSW5mbyBmaSA9IG5ldyBGaWxlSW5mbyggZGlyTmFtZSArICIvIiArIGZpbGVO
YW1lICk7CiAgICAgIHN0cmluZyBzdGF0dXMgPSAiU2F2ZWQgRmlsZSAiICsgZGlyTmFtZSArICIv
IiArIGZpbGVOYW1lICsgIigiICsgZmkuTGVuZ3RoICsgIikiOwogICAgICB1aW50IGNvbnRleHRf
aWQgPSBzdGF0MS5HZXRDb250ZXh0SWQgKCJmb28iKTsKICAgICAgc3RhdDEuUHVzaCAoY29udGV4
dF9pZCwgc3RhdHVzKTsKICB9CiAgcHVibGljIHZvaWQgZGVsZXRlKG9iamVjdCBvYmosIEV2ZW50
QXJncyBhcmdzKQogICAgLy9jYWxsZWQgd2hlbiB3aW5kb3cgaXMgY2xvc2VkCiAgewogICAgQXBw
bGljYXRpb24uUXVpdCgpOwogIH0KICAKICBwdWJsaWMgdm9pZCBkZWxldGUob2JqZWN0IG9iaiwg
RGVsZXRlRXZlbnRBcmdzIGFyZ3MpCiAgICAvL2NhbGxlZCB3aGVuIHdpbmRvdyBpcyBjbG9zZWQK
ICB7CiAgICBBcHBsaWNhdGlvbi5RdWl0KCk7CiAgfQp9Cn==

--=-4qxVNSFDCmPlwNK+r5lf--

--=-+HNPDdR9slOPC6feiLd1
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQA+yJg7HeA7AF1UGKMRArpbAJ9eT+3icZRn+UglnqBZKLZ+aKHn8wCgkgAo
xNyndE1xv2lOqVzes6OP/yY=
=CzQz
-----END PGP SIGNATURE-----

--=-+HNPDdR9slOPC6feiLd1--