newgui: Set a window title and icon
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
parent
5eb24ee04f
commit
3c60dbdbae
|
@ -17,7 +17,7 @@ env.ParseConfig('pkg-config --cflags --libs gtkmm-2.4')
|
|||
extra_files = [
|
||||
("newgui.xml", "../lib/ocarina/newgui.xml", copy),
|
||||
# ("images/random.png", "../lib/ocarina/random.png", copy),
|
||||
# ("images/ocarina.png", "../lib/ocarina/ocarina.png", copy),
|
||||
("images/newgui.png", "../lib/ocarina/newgui.png", copy),
|
||||
# ("images/thumbs_up.png", "../lib/ocarina/thumbs_up.png", copy),
|
||||
# ("images/thumbs_down.png", "../lib/ocarina/thumbs_down.png", copy),
|
||||
# ("scripts/ocarina", "../bin/ocarina", script),
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
|
@ -27,13 +27,20 @@ string lib_file(const string &file)
|
|||
return res;
|
||||
}
|
||||
|
||||
void init(int argc, char **argv)
|
||||
Glib::RefPtr<Gtk::Builder> get_builder()
|
||||
{
|
||||
return builder;
|
||||
}
|
||||
|
||||
static void init(int argc, char **argv)
|
||||
{
|
||||
Gtk::Window *window;
|
||||
|
||||
Gtk::Main app(argc, argv);
|
||||
builder = Gtk::Builder::create_from_file(lib_file("newgui.xml"));
|
||||
builder->get_widget("Ocarina", window);
|
||||
|
||||
init_window();
|
||||
gtk_builder_connect_signals(builder->gobj(), NULL);
|
||||
|
||||
Gtk::Main::run(*window);
|
||||
|
|
|
@ -1,6 +1,14 @@
|
|||
// Copyright (c) 2013 Bryan Schumaker
|
||||
#ifndef OCARINA_H
|
||||
#define OCARINA_H
|
||||
|
||||
#include <gtkmm.h>
|
||||
|
||||
// ocarina.cpp
|
||||
string lib_file(const string &);
|
||||
Glib::RefPtr<Gtk::Builder> get_builder();
|
||||
|
||||
// window.cpp
|
||||
void init_window();
|
||||
|
||||
#endif
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright (c) 2013 Bryan Schumaker
|
||||
#include <version.h>
|
||||
#include "ocarina.h"
|
||||
|
||||
void init_window()
|
||||
{
|
||||
Gtk::Window *window;
|
||||
get_builder()->get_widget("Ocarina", window);
|
||||
|
||||
window->set_title("Ocarina " + vers_str());
|
||||
window->set_icon_from_file(lib_file("newgui.png"));
|
||||
}
|
Loading…
Reference in New Issue