[Gtk-sharp-list] TextViewer
Patrik Olterman
patrik@olterman.se
19 May 2003 07:49:42 +0200
--=-SFpU2tL2FNPW924YDJkv
Content-Type: multipart/mixed; boundary="=-of6csPyS2R8Z2HWrxmDh"
--=-of6csPyS2R8Z2HWrxmDh
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable
Hello=20
I am writing a C# editor to leran C# and GTK# right now the main editor
window is a textviewer added to a scrolled window. Is there a better way
to do this.=20
What methods and members are there of the TextViewer class, that is how
can I access the text written in there?=20
Also I am creating a separate window for my settings, if I destroy that
window I cannot open a new one. How do I create a window without the
destroy window button? 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
Thirdly is there a way to get System.IO.Directory.Exists to acknowledge
a path like ~/.mydir so that I can create a custom settings file per
user ?=20
--=-of6csPyS2R8Z2HWrxmDh
Content-Disposition: attachment; filename=compile.cs
Content-Type: x-directory/normal; name=compile.cs
Content-Transfer-Encoding: base64
LyoKICogIFRoaXMgcHJvZ3JhbSBpcyBmcmVlIHNvZnR3YXJlOyB5b3UgY2FuIHJlZGlzdHJpYnV0
ZSBpdCBhbmQvb3IgbW9kaWZ5CiAqICBpdCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5l
cmFsIFB1YmxpYyBMaWNlbnNlIGFzIHB1Ymxpc2hlZCBieQogKiAgdGhlIEZyZWUgU29mdHdhcmUg
Rm91bmRhdGlvbjsgZWl0aGVyIHZlcnNpb24gMiBvZiB0aGUgTGljZW5zZSwgb3IKICogIChhdCB5
b3VyIG9wdGlvbikgYW55IGxhdGVyIHZlcnNpb24uCiAqCiAqICBUaGlzIHByb2dyYW0gaXMgZGlz
dHJpYnV0ZWQgaW4gdGhlIGhvcGUgdGhhdCBpdCB3aWxsIGJlIHVzZWZ1bCwKICogIGJ1dCBXSVRI
T1VUIEFOWSBXQVJSQU5UWTsgd2l0aG91dCBldmVuIHRoZSBpbXBsaWVkIHdhcnJhbnR5IG9mCiA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kv
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+yHB1HeA7AF1UGKMRAtWbAJ90FeCXPRRecnaJRP27VevlRGTZMACfanDo
UhErAvvVDGsE+r4Cmr2TEsw=
=fB/u
-----END PGP SIGNATURE-----
--=-SFpU2tL2FNPW924YDJkv--