Help us understand the problem. What is going on with this article?

お手軽Linux Guiアプリ開発 入門

お手軽Linux Guiアプリ開発 入門

VisualStudioMacだけでWindows Formsを作る感覚でLinuxGUIアプリが作れます

利点
ターミナルで開発環境を整えなくてよい。VisualStudioMacが自動で整えてくれます

VisualStudioMacをダウンロード

GTK#2を選択する
スクリーンショット 2020-03-29 12.52.41.png

ツールボックスを選択
スクリーンショット 2020-03-29 12.53.22.png

ツールボックスが表示される インターフェース Main Windowを選択
スクリーンショット 2020-03-29 12.53.49.png

FiexedをMain Windowにドラッグします。編集可能領域を作成します
スクリーンショット 2020-03-29 12.54.05.png

ボタンをドラッグします。ボタンを移動させるには白い四角をクリックしドラッグします
スクリーンショット 2020-03-29 12.54.25.png

プロパティを表示します。
スクリーンショット 2020-03-29 12.54.52.png

Clickedの文字の部分をダブルクリックします。クリックイベントメソッドが自動生成します。
スクリーンショット 2020-03-29 12.57.42.png

クリックイベントメソッドが自動生成されます。ラベルに文字を入れる処理を加えます
スクリーンショット 2020-03-29 12.58.07.png

実行します
スクリーンショット 2020-03-29 13.29.40.png

ボタンを押すと実行されます
スクリーンショット 2020-03-29 12.59.46.png

ビルドされたプログラムはBinファイルの中に生成されています
スクリーンショット 2020-03-29 13.42.47.png

ラズベリーパイで動作させるにはMonoDevelopをインストールします
スクリーンショット 2020-03-29 13.31.37.png

MonoDevelop

感想

VisualStudioのWindowsFormを作成する感覚でお手軽に作成できました。
WindowsのVusualStudioだとGUIデザイナーが組み込まれていないため、GladeやSteticといったGUIデザイナーをダウンロードし、
交互に使わないといけない。クリックなどのイベントも自分で書かないといけない。

Gladeをターミナルでダウンロードしたり、Monoの開発環境を手動で整えなくても、VisualStudioMacが自動で環境を作ってくれます。。
あとはWindows Formsを作る感覚でC#を書くだけで作れます。

mono stetic

参考

C# VisualStudio for Mac でGtk#を使ってみた。gtk-sharp

次回 開発予定

C#からPythonを実行する 参考 C#からPythonスクリプトを呼び出す
Dapperの導入 参考 Dapperについてまとめてみた
DataGrideViewとModelのバインディングの実現 参考URL treeView
Swaggerを使う Stoplight Studioなどを使う  参考 本当に使ってよかったOpenAPI (Swagger) ツール
RazurebyPiへのデプロイの仕方
Sqlite3の利用

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした