more tycho stuff

png-branch
an 2019-03-01 04:25:31 -05:00
parent 87bfe2869a
commit 789e3de93f
8 changed files with 290 additions and 154 deletions

2
.gitignore vendored
View File

@ -1,6 +1,6 @@
/target /target
/out /out
data/*.res *.res
**/*.rs.bk **/*.rs.bk
Cargo.lock Cargo.lock
perf.data* perf.data*

View File

@ -21,7 +21,7 @@ gio-sys = "0.8"
glib = "0.7" glib = "0.7"
glib-sys = "0.8" glib-sys = "0.8"
gobject-sys = "0.8" gobject-sys = "0.8"
gtk = "0.6" gtk = {version = "0.6", features = ["v3_16"]}
gtk-sys = "0.8" gtk-sys = "0.8"
pango = "0.6" pango = "0.6"
pango-sys = "0.8" pango-sys = "0.8"

48
src/tycho/buttons.rs Normal file
View File

@ -0,0 +1,48 @@
fn mk_btn_new(b: &gtk::Builder)
{
let btn: gtk::MenuItem = get_obj(b, "btn-new");
let tools: gtk::Window = get_obj(b, "win-map-tools");
let view: gtk::Window = get_obj(b, "win-map-view");
btn.connect_activate(move |_| {
// TODO: actually make a new document
tools.show_all();
view.show_all();
});
}
fn mk_btn_quit(b: &gtk::Builder, app: gtk::Application)
{
let btn: gtk::MenuItem = get_obj(b, "btn-quit");
btn.connect_activate(move |_| app.quit());
}
fn mk_btn_about(b: &gtk::Builder)
{
let btn: gtk::MenuItem = get_obj(b, "btn-about");
let win: gtk::AboutDialog = get_obj(b, "win-about");
btn.connect_activate(move |_| {
win.run();
win.hide();
});
}
fn mk_btn_show_map_view(b: &gtk::Builder)
{
let btn: gtk::MenuItem = get_obj(b, "btn-show-map-view");
let win: gtk::Window = get_obj(b, "win-map-view");
btn.connect_activate(move |_| win.show_all());
}
fn mk_btn_show_map_tools(b: &gtk::Builder)
{
let btn: gtk::MenuItem = get_obj(b, "btn-show-map-tools");
let win: gtk::Window = get_obj(b, "win-map-tools");
btn.connect_activate(move |_| win.show_all());
}
// EOF

Binary file not shown.

View File

@ -27,33 +27,75 @@ Author: Alison Sanderson
--> -->
<interface> <interface>
<requires lib="gtk+" version="3.10"/> <requires lib="gtk+" version="3.16"/>
<!-- interface-license-type mit --> <!-- interface-license-type mit -->
<!-- interface-name Maraiah Tycho --> <!-- interface-name Maraiah Tycho -->
<!-- interface-description Tycho map editor for Maraiah. --> <!-- interface-description Tycho map editor for Maraiah. -->
<!-- interface-copyright 2018-2019 Alison Sanderson --> <!-- interface-copyright 2018-2019 Alison Sanderson -->
<!-- interface-authors Alison Sanderson --> <!-- interface-authors Alison Sanderson -->
<object class="GtkImage" id="im_lines"> <object class="GtkAdjustment" id="adj-map-horz">
<property name="upper">100</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adj-map-vert">
<property name="upper">100</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkWindow" id="win-map-view">
<property name="can_focus">False</property>
<property name="title" translatable="yes">Map View</property>
<property name="default_width">600</property>
<property name="default_height">400</property>
<child type="titlebar">
<placeholder/>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">always</property>
<property name="vscrollbar_policy">always</property>
<property name="window_placement">top-right</property>
<property name="overlay_scrolling">False</property>
<child>
<object class="GtkViewport">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hadjustment">adj-map-horz</property>
<property name="vadjustment">adj-map-vert</property>
<child>
<object class="GtkDrawingArea" id="draw-area">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
<object class="GtkImage" id="img-lines">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="resource">/net/greyserv/maraiah/tycho/lines</property> <property name="resource">/net/greyserv/maraiah/tycho/lines</property>
</object> </object>
<object class="GtkImage" id="im_points"> <object class="GtkImage" id="img-points">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="resource">/net/greyserv/maraiah/tycho/points</property> <property name="resource">/net/greyserv/maraiah/tycho/points</property>
</object> </object>
<object class="GtkImage" id="im_polys"> <object class="GtkImage" id="img-polys">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="resource">/net/greyserv/maraiah/tycho/polys</property> <property name="resource">/net/greyserv/maraiah/tycho/polys</property>
</object> </object>
<object class="GtkWindow" id="win_tools"> <object class="GtkWindow" id="win-map-tools">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="title" translatable="yes">Tool Palette</property> <property name="title" translatable="yes">Tool Palette</property>
<property name="default_height">250</property> <property name="default_height">250</property>
<property name="skip_taskbar_hint">True</property> <property name="skip_taskbar_hint">True</property>
<property name="has_resize_grip">True</property>
<child> <child>
<placeholder/> <placeholder/>
</child> </child>
@ -68,14 +110,14 @@ Author: Alison Sanderson
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label" translatable="yes">Geometry</property> <property name="label" translatable="yes">Geometry</property>
<child> <child>
<object class="GtkToolButton" id="btn_point"> <object class="GtkToolButton" id="btn-point">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label" translatable="yes">Points</property> <property name="label" translatable="yes">Points</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="icon_widget">im_points</property> <property name="icon_widget">img-points</property>
<child internal-child="accessible"> <child internal-child="accessible">
<object class="AtkObject" id="btn_point-atkobject"> <object class="AtkObject" id="btn-point-atkobject">
<property name="AtkObject::accessible-name" translatable="yes">Points Tool</property> <property name="AtkObject::accessible-name" translatable="yes">Points Tool</property>
<property name="AtkObject::accessible-description" translatable="yes">The tool that modifies points in the map.</property> <property name="AtkObject::accessible-description" translatable="yes">The tool that modifies points in the map.</property>
<property name="AtkObject::accessible-role" translatable="yes">push-button</property> <property name="AtkObject::accessible-role" translatable="yes">push-button</property>
@ -87,14 +129,14 @@ Author: Alison Sanderson
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkToolButton" id="btn_lines"> <object class="GtkToolButton" id="btn-lines">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label" translatable="yes">Lines</property> <property name="label" translatable="yes">Lines</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="icon_widget">im_lines</property> <property name="icon_widget">img-lines</property>
<child internal-child="accessible"> <child internal-child="accessible">
<object class="AtkObject" id="btn_lines-atkobject"> <object class="AtkObject" id="btn-lines-atkobject">
<property name="AtkObject::accessible-name" translatable="yes">Lines Tool</property> <property name="AtkObject::accessible-name" translatable="yes">Lines Tool</property>
<property name="AtkObject::accessible-description" translatable="yes">The tool which modifies line segments on the map.</property> <property name="AtkObject::accessible-description" translatable="yes">The tool which modifies line segments on the map.</property>
<property name="AtkObject::accessible-role" translatable="yes">push-button</property> <property name="AtkObject::accessible-role" translatable="yes">push-button</property>
@ -107,14 +149,14 @@ Author: Alison Sanderson
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkToolButton" id="btn_polys"> <object class="GtkToolButton" id="btn-polys">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label" translatable="yes">Polygons</property> <property name="label" translatable="yes">Polygons</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="icon_widget">im_polys</property> <property name="icon_widget">img-polys</property>
<child internal-child="accessible"> <child internal-child="accessible">
<object class="AtkObject" id="btn_polys-atkobject"> <object class="AtkObject" id="btn-polys-atkobject">
<property name="AtkObject::accessible-name" translatable="yes">Polygon Tool</property> <property name="AtkObject::accessible-name" translatable="yes">Polygon Tool</property>
<property name="AtkObject::accessible-description" translatable="yes">The tool which modifies polygon shapes on the map.</property> <property name="AtkObject::accessible-description" translatable="yes">The tool which modifies polygon shapes on the map.</property>
<property name="AtkObject::accessible-role" translatable="yes">push-button</property> <property name="AtkObject::accessible-role" translatable="yes">push-button</property>
@ -141,17 +183,16 @@ Author: Alison Sanderson
</object> </object>
</child> </child>
<child internal-child="accessible"> <child internal-child="accessible">
<object class="AtkObject" id="win_tools-atkobject"> <object class="AtkObject" id="win-map-tools-atkobject">
<property name="AtkObject::accessible-name" translatable="yes">Tycho Tool Palette</property> <property name="AtkObject::accessible-name" translatable="yes">Tycho Tool Palette</property>
<property name="AtkObject::accessible-description" translatable="yes">Tycho's tool palette window.</property> <property name="AtkObject::accessible-description" translatable="yes">Tycho's tool palette window.</property>
<property name="AtkObject::accessible-role" translatable="yes">window</property> <property name="AtkObject::accessible-role" translatable="yes">window</property>
</object> </object>
</child> </child>
</object> </object>
<object class="GtkAboutDialog" id="win_about"> <object class="GtkAboutDialog" id="win-about">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="modal">True</property> <property name="modal">True</property>
<property name="destroy_with_parent">True</property>
<property name="type_hint">dialog</property> <property name="type_hint">dialog</property>
<property name="program_name">Tycho Map Editor</property> <property name="program_name">Tycho Map Editor</property>
<property name="copyright" translatable="yes">Copyright © 2018-2019 Alison Sanderson</property> <property name="copyright" translatable="yes">Copyright © 2018-2019 Alison Sanderson</property>
@ -184,18 +225,19 @@ Author: Alison Sanderson
</object> </object>
</child> </child>
<child internal-child="accessible"> <child internal-child="accessible">
<object class="AtkObject" id="win_about-atkobject"> <object class="AtkObject" id="win-about-atkobject">
<property name="AtkObject::accessible-name" translatable="yes">About Screen</property> <property name="AtkObject::accessible-name" translatable="yes">About Screen</property>
<property name="AtkObject::accessible-description" translatable="yes">The about screen for Tycho.</property> <property name="AtkObject::accessible-description" translatable="yes">The about screen for Tycho.</property>
<property name="AtkObject::accessible-role" translatable="yes">dialog</property> <property name="AtkObject::accessible-role" translatable="yes">dialog</property>
</object> </object>
</child> </child>
</object> </object>
<object class="GtkWindow" id="win_menus"> <object class="GtkWindow" id="win-main">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="title" translatable="yes">Tycho</property> <property name="title" translatable="yes">Tycho</property>
<property name="resizable">False</property>
<property name="default_width">120</property>
<property name="default_height">250</property> <property name="default_height">250</property>
<property name="has_resize_grip">True</property>
<child> <child>
<placeholder/> <placeholder/>
</child> </child>
@ -215,39 +257,30 @@ Author: Alison Sanderson
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<child> <child>
<object class="GtkImageMenuItem"> <object class="GtkMenuItem" id="btn-new">
<property name="label">gtk-new</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Create a new project.</property>
<property name="label" translatable="yes">_New Project</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="use_stock">True</property>
</object> </object>
</child> </child>
<child> <child>
<object class="GtkImageMenuItem"> <object class="GtkMenuItem" id="btn-open">
<property name="label">gtk-open</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Opens any type of project file.</property>
<property name="label" translatable="yes">_Open</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="use_stock">True</property>
</object> </object>
</child> </child>
<child> <child>
<object class="GtkImageMenuItem"> <object class="GtkMenuItem" id="btn-save">
<property name="label">gtk-save</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Saves the currently open project.</property>
<property name="label" translatable="yes">_Save</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem">
<property name="label">gtk-save-as</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object> </object>
</child> </child>
<child> <child>
@ -257,62 +290,12 @@ Author: Alison Sanderson
</object> </object>
</child> </child>
<child> <child>
<object class="GtkImageMenuItem"> <object class="GtkMenuItem" id="btn-quit">
<property name="label">gtk-quit</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Quit the application.</property>
<property name="label" translatable="yes">_Quit</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkMenuItem">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_Edit</property>
<property name="use_underline">True</property>
<child type="submenu">
<object class="GtkMenu">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkImageMenuItem">
<property name="label">gtk-cut</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem">
<property name="label">gtk-copy</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem">
<property name="label">gtk-paste</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem">
<property name="label">gtk-delete</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object> </object>
</child> </child>
</object> </object>
@ -325,6 +308,30 @@ Author: Alison Sanderson
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label" translatable="yes">_View</property> <property name="label" translatable="yes">_View</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<child type="submenu">
<object class="GtkMenu">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkMenuItem" id="btn-show-map-view">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Opens the map view window.</property>
<property name="label" translatable="yes">Show _Map View</property>
<property name="use_underline">True</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="btn-show-map-tools">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Opens the map toolbox window.</property>
<property name="label" translatable="yes">Show Map _Tools</property>
<property name="use_underline">True</property>
</object>
</child>
</object>
</child>
</object> </object>
</child> </child>
<child> <child>
@ -345,12 +352,12 @@ Author: Alison Sanderson
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<child> <child>
<object class="GtkImageMenuItem" id="btn_about"> <object class="GtkMenuItem" id="btn-about">
<property name="label">gtk-about</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Opens a window with information about this program.</property>
<property name="label" translatable="yes">_About</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="use_stock">True</property>
</object> </object>
</child> </child>
</object> </object>

View File

@ -1,53 +1,38 @@
use gtk::prelude::*; use gdk::prelude::*;
use gio::prelude::*; use gio::prelude::*;
use gtk::prelude::*;
use maraiah::durandal::err::*; use maraiah::durandal::err::*;
fn run_app(app: &gtk::Application) -> ResultS<()> include!("windows.rs");
include!("buttons.rs");
include!("map_draw.rs");
fn run_app(app: &gtk::Application)
{ {
fn load_img(path: &'static str) -> ResultS<gdk_pixbuf::Pixbuf> // one fallible call, which should never fail anyhow
{
Ok(gdk_pixbuf::Pixbuf::new_from_resource(path)?)
}
fn get_obj<T>(b: &gtk::Builder, name: &str) -> ResultS<T>
where T: glib::object::IsA<glib::object::Object>
{
match b.get_object(name) {
Some(w) => Ok(w),
None => Err(err_msg("no object")),
}
}
let b = gtk::Builder::new_from_resource("/net/greyserv/maraiah/tycho/ui"); let b = gtk::Builder::new_from_resource("/net/greyserv/maraiah/tycho/ui");
let win_menus: gtk::Window = get_obj(&b, "win_menus")?; mk_btn_new(&b);
let win_tools: gtk::Window = get_obj(&b, "win_tools")?; mk_btn_quit(&b, app.clone());
let win_about: gtk::AboutDialog = get_obj(&b, "win_about")?; mk_btn_about(&b);
let btn_about: gtk::MenuItem = get_obj(&b, "btn_about")?; mk_btn_show_map_view(&b);
//t draw_area: gtk::DrawingArea = get_obj(&b, "draw_area")?; mk_btn_show_map_tools(&b);
//t btn_point: gtk::ToolButton = get_obj(&b, "btn_point")?; mk_draw_area(&b);
//t btn_lines: gtk::ToolButton = get_obj(&b, "btn_lines")?; mk_win_map_tools(&b);
//t btn_polys: gtk::ToolButton = get_obj(&b, "btn_polys")?; mk_win_map_view(&b);
mk_win_about(&b);
mk_win_main(&b, app);
}
let authors: Vec<_> = env!("CARGO_PKG_AUTHORS").split(';').collect(); fn load_img(path: &'static str) -> gdk_pixbuf::Pixbuf
{
gdk_pixbuf::Pixbuf::new_from_resource(path).unwrap()
}
win_about.set_authors(&authors); fn get_obj<T>(b: &gtk::Builder, name: &str) -> T
win_about.set_version(env!("CARGO_PKG_VERSION")); where T: glib::object::IsA<glib::object::Object>
win_about.set_website(env!("CARGO_PKG_HOMEPAGE")); {
win_about.set_logo(&load_img("/net/greyserv/maraiah/tycho/tycho2")?); b.get_object(name).unwrap()
btn_about.connect_activate(move |_| {
win_about.run();
win_about.hide();
});
win_tools.set_deletable(false);
win_tools.show_all();
win_menus.set_application(app);
win_menus.show_all();
Ok(())
} }
fn main() -> ResultS<()> fn main() -> ResultS<()>
@ -69,21 +54,7 @@ fn main() -> ResultS<()>
let app = gtk::Application::new("net.greyserv.maraiah.tycho", let app = gtk::Application::new("net.greyserv.maraiah.tycho",
gio::ApplicationFlags::empty())?; gio::ApplicationFlags::empty())?;
app.connect_activate(|app| { app.connect_activate(run_app);
match run_app(app) {
Ok(()) => (),
Err(e) => {
// print out an error if init failed somehow, otherwise the main
// loop will proceed as normal (this is just to prevent panics in
// weird circumstances such as breaking the builder while devving)
gtk::MessageDialog::new(None::<&gtk::Window>,
gtk::DialogFlags::empty(),
gtk::MessageType::Error,
gtk::ButtonsType::Ok,
&format!("{:?}", e)).run();
}
}
});
let ret = if app.run(&[]) == 0 { let ret = if app.run(&[]) == 0 {
Ok(()) Ok(())

71
src/tycho/map_draw.rs Normal file
View File

@ -0,0 +1,71 @@
fn draw_clear(cr: &cairo::Context, w: f64, h: f64)
{
use cairo::{FontSlant, FontWeight};
// set up for text
cr.select_font_face("Sans", FontSlant::Normal, FontWeight::Normal);
cr.set_font_size(14.0);
// clear view
cr.set_source_rgb(0.0, 0.0, 0.0);
cr.rectangle(0.0, 0.0, w, h);
cr.fill();
}
fn draw_map_none(cr: &cairo::Context, im: &gdk_pixbuf::Pixbuf, w: f64, h: f64)
{
let im_w = f64::from(im.get_width());
let im_h = f64::from(im.get_height());
// draw middle image
cr.set_source_pixbuf(im, w / 2.0 - im_w / 2.0, h / 2.0 - im_h / 2.0);
cr.paint();
// draw top border (these are separate so the bottom draws over the top)
cr.set_source_rgb(0.28, 0.0, 0.0);
cr.rectangle(0.0, 0.0, w, 18.0);
cr.fill();
// draw top text
cr.set_source_rgb(1.0, 0.0, 0.0);
cr.move_to(4.0, 14.0);
cr.show_text("Map Required To Proceed");
// draw bottom border
cr.set_source_rgb(0.28, 0.0, 0.0);
cr.rectangle(0.0, h - 18.0, w, h);
cr.fill();
// draw bottom text
cr.set_source_rgb(1.0, 0.0, 0.0);
cr.move_to(4.0, h - 4.0);
cr.show_text("CAS.qterm//CyberAcme Systems Inc.");
}
fn mk_draw_area(b: &gtk::Builder)
{
let area: gtk::DrawingArea = get_obj(b, "draw-area");
let ax: gtk::Adjustment = get_obj(b, "adj-map-horz");
let ay: gtk::Adjustment = get_obj(b, "adj-map-vert");
let im = load_img("/net/greyserv/maraiah/tycho/tycho1");
area.connect_draw(move |area, cr| {
let w = f64::from(area.get_allocated_width());
let h = f64::from(area.get_allocated_height());
ax.set_lower(0.0);
ax.set_upper(w);
ay.set_lower(0.0);
ay.set_upper(h);
draw_clear(&cr, w, h);
draw_map_none(&cr, &im, w, h);
Inhibit(true)
});
}
// EOF

39
src/tycho/windows.rs Normal file
View File

@ -0,0 +1,39 @@
fn hide_on_delete(win: &gtk::Window, _: &gdk::Event) -> Inhibit
{
win.hide();
Inhibit(true)
}
fn mk_win_map_tools(b: &gtk::Builder)
{
let win: gtk::Window = get_obj(b, "win-map-tools");
win.connect_delete_event(hide_on_delete);
}
fn mk_win_map_view(b: &gtk::Builder)
{
let win: gtk::Window = get_obj(b, "win-map-view");
win.connect_delete_event(hide_on_delete);
}
fn mk_win_about(b: &gtk::Builder)
{
let win: gtk::AboutDialog = get_obj(b, "win-about");
win.set_authors(&env!("CARGO_PKG_AUTHORS").split(';').collect::<Vec<_>>());
win.set_version(env!("CARGO_PKG_VERSION"));
win.set_website(env!("CARGO_PKG_HOMEPAGE"));
win.set_logo(&load_img("/net/greyserv/maraiah/tycho/tycho2"));
}
fn mk_win_main(b: &gtk::Builder, app: &gtk::Application)
{
let win: gtk::Window = get_obj(b, "win-main");
win.set_application(app);
win.show_all();
}
// EOF