残念。
前回
- http://ytyaru.hatenablog.com/entry/2020/02/18/000000
- http://ytyaru.hatenablog.com/entry/2020/02/19/000000
- http://ytyaru.hatenablog.com/entry/2020/02/20/000000
対象環境
- Raspbierry pi 3 Model B+
- Raspbian stretch(9.0) 2018-06-27
- Mono 5.16.0
- MonoDevelop 7.6 build 711
- Eto.Forms 2.4.1 拡張機能, NuGetパッケージ
- .NET Core 2.2, MonoDevelop参照方法
手順
前々回のプロジェクトを参照して、新しいプロジェクトを追加してみる。Eto.CodeEditor.Wpf
1. プロジェクト作成
- MonoDevelopを起動する
- メニュー→
ファイル
→新しいソリューション
その他
→.NET
→GTK#2.0プロジェクト
- 名前などを適当に入力する (
HelloGtkSourceView
) - プロジェクトが作成される
コードにGtkSourceView
と書いてもインテリセンスで表示されない。
2. ビルドするとエラー
原因はメモリ不足。
3. NuGetでGtk#3.0を追加
- メニュー→
プロジェクト
→NuGet パッケージの追加
パッケージを追加
ダイアログから欲しいパッケージを探す
- 検索窓に
gtk 3
と入力して絞り込む gtk-sharp-3
を選択しパッケージを追加
ボタンをクリックする
同意する
プロジェクトが壊れてビルドできなくなる。
libgtksourceview はインストールされていた
libgtksourceview-3.0-1
はインストールされていた。これをMonoDevelop C#で使えればいいのだが、情報がまるで見つからない。
$ apt search libgtksourceview ソート中... 完了 全文検索... 完了 libgtksourceview-3.0-1/stable,stable,stable,stable,now 3.22.2-1 armhf [インストール済み、自動] shared libraries for the GTK+ syntax highlighting widget libgtksourceview-3.0-common/stable,stable,stable,stable,now 3.22.2-1 all [インストール済み、自動] common files for the GTK+ syntax highlighting widget libgtksourceview-3.0-dev/stable,stable,stable,stable 3.22.2-1 armhf development files for the GTK+ syntax highlighting widget libgtksourceview-3.0-doc/stable,stable,stable,stable 3.22.2-1 all documentation for the GTK+ syntax highlighting widget libgtksourceview2.0-0/stable,stable,stable,stable 2.10.5-3 armhf shared libraries for the GTK+ syntax highlighting widget libgtksourceview2.0-common/stable,stable,stable,stable 2.10.5-3 all common files for the GTK+ syntax highlighting widget libgtksourceview2.0-dev/stable,stable,stable,stable 2.10.5-3 armhf development files for the GTK+ syntax highlighting widget libgtksourceview2.0-doc/stable,stable,stable,stable 2.10.5-3 all documentation for the GTK+ syntax highlighting widget libgtksourceviewmm-3.0-0v5/stable,stable,stable,stable 3.18.0-1 armhf C++ binding of GtkSourceView libgtksourceviewmm-3.0-dbg/stable,stable,stable,stable 3.18.0-1 armhf C++ binding of GtkSourceView - debugging symbols libgtksourceviewmm-3.0-dev/stable,stable,stable,stable 3.18.0-1 armhf C++ binding of GtkSourceView - development files libgtksourceviewmm-3.0-doc/stable,stable,stable,stable 3.18.0-1 all C++ binding of GtkSourceView liblablgtksourceview2-ocaml/stable,stable,stable,stable 2.18.3+dfsg-2 armhf OCaml bindings for libgtksourceview2 (runtime) liblablgtksourceview2-ocaml-dev/stable,stable,stable,stable 2.18.3+dfsg-2 armhf OCaml bindings for libgtksourceview2, a source editor GTK+ widget
参考
- https://github.com/mono/gnome-desktop-sharp
- https://csharp.hotexamples.com/examples/GtkSourceView/SourceView/-/php-sourceview-class-examples.html
using GtkSourceView; SourceLanguagesManager manager = new SourceLanguagesManager (); SourceLanguage language = manager.GetLanguageFromMimeType ("text/x-csharp"); SourceBuffer buffer = new SourceBuffer (language); buffer.Highlight = true; SourceView view = new SourceView (buffer);
所感
GtkSourceViewをどうやれば参照できるかわからん。