1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

#概要

raspberry pi 1でgtkmmやってみた。
raspberry pi 1 model bに、インストールしてみた。
hello worldやってみた。

#環境

Raspberry pi 1 model b(element14)
sd-card 8GB
raspbian 2016-11-25 jessie with pixel

#インストール

sudo aptitude install gtkmm-3.0-dev

#写真
2018-12-22-094302_1440x900_scrot.png

#Makefileを書く。

CXXFLAGS ?= `pkg-config gtkmm-3.0 --cflags --libs` -I../tensorflow -I../tensorflow/tensorflow/lite/tools/make/downloads/flatbuffers/include
LDFLAGS ?= -L../tensorflow/tensorflow/lite/tools/make/gen/rpi_armv6l/lib

.PHONY: all clean

all: main

main: main.cpp
	g++ --std=c++11 main.cpp -O2 $(CXXFLAGS) $(LDFLAGS) -ltensorflow-lite -lstdc++ -lpthread -ldl -lm -lasound -o test

clean:
	rm -f test

#サンプルコード

#include <gtkmm.h>

class MainWin: public Gtk::Window
{
	Gtk::Button m_bt;
public:
	MainWin();
private:
	void on_bt_clicked();
};
MainWin::MainWin(): m_bt("click")
{
	m_bt.signal_clicked().connect(sigc::mem_fun(* this, &MainWin::on_bt_clicked));
	add(m_bt);
	show_all_children();
}
void MainWin::on_bt_clicked()
{
	Gtk::MessageDialog diag(* this, "Hello World!");
	diag.run();
}
int main(int argc, char * argv[])
{
	Gtk::Main kit(argc, argv);
	MainWin mainwin;
	Gtk::Main::run(mainwin);
	return 0;
}

以上。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?