Skip to content
Snippets Groups Projects
Commit eaa16f74 authored by Martin Kröning's avatar Martin Kröning :crab:
Browse files

Merge branch 'gtkmm-4.0' into 'master'

Port to GTK4

See merge request !2
parents 2c259f47 44387b68
Branches master
No related tags found
1 merge request!2Port to GTK4
Showing
with 143 additions and 224 deletions
......@@ -2,7 +2,7 @@ project('pi2-view', ['cpp', 'c'],
license: 'LGPL3',
meson_version: '>=0.47.0',
version: '0.2',
default_options : ['warning_level=3', 'werror=true', 'cpp_std=c++17', 'c_std=c11']
default_options : ['warning_level=3', 'cpp_std=c++17', 'c_std=c11']
)
add_global_arguments('-Wno-unknown-pragmas', language : 'cpp')
......
......@@ -16,6 +16,9 @@
Map::Map(std::istream &is, std::string_view windowTitle)
: time(0), mapWindow(windowTitle) {
// Make sure to recognize `.` as decimal mark
is.imbue(std::locale::classic());
std::string type;
while (is >> type) {
if (type == "KREUZUNG") {
......
......@@ -20,8 +20,8 @@
<object class="GtkGrid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">5</property>
<property name="margin_right">5</property>
<property name="margin_start">5</property>
<property name="margin_end">5</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="row_spacing">5</property>
......@@ -32,29 +32,22 @@
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes" context="Label for ComboBox">Zoom Level</property>
<layout>
<property name="column">0</property>
<property name="row">0</property>
</layout>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="zoomComboBoxText">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="has_entry">True</property>
<child internal-child="entry">
<object class="GtkEntry">
<property name="can_focus">True</property>
<property name="width_chars">5</property>
<property name="input_purpose">digits</property>
</object>
</child>
<property name="has_entry">False</property>
<layout>
<property name="column">1</property>
<property name="row">0</property>
</layout>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
......@@ -62,11 +55,11 @@
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes" context="Label for digital clock">Simulation Time</property>
<layout>
<property name="column">0</property>
<property name="row">1</property>
</layout>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="timeLabel">
......@@ -77,22 +70,22 @@
<attributes>
<attribute name="font-desc" value="Monospace 10"/>
</attributes>
<layout>
<property name="column">1</property>
<property name="row">1</property>
</layout>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkSeparator">
<property name="visible">True</property>
<property name="can_focus">False</property>
<layout>
<property name="column">0</property>
<property name="row">2</property>
<property name="column-span">2</property>
</layout>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="width">2</property>
</packing>
</child>
<child>
<object class="GtkLabel">
......@@ -100,11 +93,11 @@
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes" context="Driving on $lane">Driving on</property>
<layout>
<property name="column">0</property>
<property name="row">3</property>
</layout>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="laneLabel">
......@@ -112,11 +105,11 @@
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes" context="Placeholder for lane name">Lane</property>
<layout>
<property name="column">1</property>
<property name="row">3</property>
</layout>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel">
......@@ -124,11 +117,11 @@
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes" context="Label for percentage">Completion of Lane</property>
<layout>
<property name="column">0</property>
<property name="row">4</property>
</layout>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lanePositionPercentageLabel">
......@@ -139,11 +132,11 @@
<attributes>
<attribute name="font-desc" value="Monospace 10"/>
</attributes>
<layout>
<property name="column">1</property>
<property name="row">4</property>
</layout>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel">
......@@ -151,11 +144,11 @@
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes" context="Label for speed in km/h">Speed</property>
<layout>
<property name="column">0</property>
<property name="row">5</property>
</layout>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="speedLabel">
......@@ -166,11 +159,11 @@
<attributes>
<attribute name="font-desc" value="Monospace 10"/>
</attributes>
<layout>
<property name="column">1</property>
<property name="row">5</property>
</layout>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel">
......@@ -178,11 +171,11 @@
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes" context="Label for fuel in l">Remaining Fuel</property>
<layout>
<property name="column">0</property>
<property name="row">6</property>
</layout>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="remainingFuelLabel">
......@@ -193,44 +186,38 @@
<attributes>
<attribute name="font-desc" value="Monospace 10"/>
</attributes>
<layout>
<property name="column">1</property>
<property name="row">6</property>
</layout>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">6</property>
</packing>
</child>
<property name="halign">GTK_ALIGN_FILL</property>
<property name="valign">GTK_ALIGN_FILL</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkListBox" id="listBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">GTK_ALIGN_FILL</property>
<property name="valign">GTK_ALIGN_FILL</property>
<property name="vexpand">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<property name="halign">GTK_ALIGN_FILL</property>
<property name="valign">GTK_ALIGN_FILL</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolledWindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="shadow_type">in</property>
<property name="propagate_natural_width">True</property>
<property name="propagate_natural_height">True</property>
<property name="halign">GTK_ALIGN_FILL</property>
<property name="valign">GTK_ALIGN_FILL</property>
<property name="hexpand">True</property>
<child>
<object class="GtkViewport" id="viewport">
<property name="visible">True</property>
......@@ -241,11 +228,6 @@
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
......
#pragma once
#include <algorithm>
#include <cairomm/context.h>
#include <cairomm/refptr.h>
#include <functional>
#include <iterator>
#include <type_traits>
namespace Cairo {
class Context;
template <typename T_CastFrom> class RefPtr;
} // namespace Cairo
enum class DrawableTrait {
X,
......
#pragma once
#include "Drawable.hpp"
namespace Cairo {
class Context;
template <typename T_CastFrom> class RefPtr;
} // namespace Cairo
#include <cairomm/context.h>
#include <cairomm/refptr.h>
class DrawableJunction : public Drawable {
public:
......
#pragma once
#include "Drawable.hpp"
#include <cairomm/context.h>
#include <cairomm/refptr.h>
#include <string>
#include <string_view>
#include <valarray>
#include <vector>
namespace Cairo {
class Context;
template <typename T_CastFrom> class RefPtr;
} // namespace Cairo
class DrawableRoad : public Drawable {
public:
......
#pragma once
#include "Drawable.hpp"
#include <cairomm/context.h>
#include <cairomm/refptr.h>
#include <string>
class DrawableRoad;
namespace Cairo {
class Context;
template <typename T_CastFrom> class RefPtr;
} // namespace Cairo
class DrawableVehicle : public Drawable {
public:
......
#pragma once
#include <glibmm/refptr.h>
#include <gtkmm/application.h>
#include <gtkmm/window.h>
#include <thread>
namespace Glib {
template <class T_CppObject> class RefPtr;
}
namespace Gtk {
class Application;
class Window;
} // namespace Gtk
class MapApplication {
public:
......
#pragma once
#include <cairomm/context.h>
#include <cairomm/refptr.h>
#include <gtkmm/drawingarea.h>
#include <map>
#include <string>
......@@ -7,10 +9,6 @@
class DrawableJunction;
class DrawableRoad;
class DrawableVehicle;
namespace Cairo {
class Context;
template <typename T_CastFrom> class RefPtr;
} // namespace Cairo
class MapArea : public Gtk::DrawingArea {
public:
......@@ -19,13 +17,11 @@ public:
std::map<std::string, DrawableVehicle> &nameVehicleMap);
void adaptSizeRequest();
void queue_draw_area(int x, int y, int width, int height);
void setScale(double scale);
protected:
bool on_draw(const Cairo::RefPtr<Cairo::Context> &cr) override;
private:
void on_draw(const Cairo::RefPtr<Cairo::Context> &cr, int width, int height);
const static int padding;
double scale;
......
......@@ -5,22 +5,18 @@
#include "DrawableVehicle.hpp"
#include "MapArea.hpp"
#include <chrono>
#include <glibmm/refptr.h>
#include <gtkmm/application.h>
#include <gtkmm/comboboxtext.h>
#include <gtkmm/label.h>
#include <gtkmm/listbox.h>
#include <gtkmm/listboxrow.h>
#include <gtkmm/window.h>
#include <map>
#include <string>
#include <thread>
#include <valarray>
#include <vector>
namespace Glib {
template <class T_CppObject> class RefPtr;
}
namespace Gtk {
class Application;
class ComboBoxText;
class Label;
class ListBox;
class ListBoxRow;
} // namespace Gtk
class MapWindow : public Gtk::Window {
public:
......@@ -45,12 +41,9 @@ private:
const std::string &laneName, double positionOnLane,
double speed, double remainingFuel, double red,
double green, double blue);
void onZoomEntryActivate();
void onZoomSelectionChanged();
void onVehicleRowSelected(Gtk::ListBoxRow *row);
void refreshVehicleLabels(const DrawableVehicle &vehicle);
void refreshArea(int x, int y, int width, int height);
void resizeWindow();
MapArea mapArea;
Gtk::ListBox *listBox;
Gtk::Label *timeLabel;
......
......@@ -16,7 +16,7 @@ ui_resources = gnome.compile_resources(
source_dir: 'data'
)
pkg = import('pkgconfig')
gtkmm_dep = dependency('gtkmm-3.0', version : '>=3.24.0')
gtkmm_dep = dependency('gtkmm-4.0')
thread_dep = dependency('threads')
pi2_view_lib = library('pi2-view', [pi2_view_src, ui_resources],
dependencies : [gtkmm_dep, thread_dep, microsoft_gsl_dep],
......
#include "DrawableJunction.hpp"
#include <cairomm/context.h>
#include <cairomm/enums.h>
#include <cairomm/refptr.h>
#include <cmath>
#include <vector>
......@@ -26,7 +24,7 @@ void DrawableJunction::draw(const Cairo::RefPtr<Cairo::Context> &cr) const {
length - 2 * lineWidth);
cr->set_source_rgb(1, 1, 1);
cr->set_dash(std::vector<double>({2, 9, 4, 9, 2, 0}), 0);
cr->set_line_cap(Cairo::LINE_CAP_SQUARE);
cr->set_line_cap(Cairo::Context::LineCap::SQUARE);
cr->stroke();
cr->restore();
......
#include "DrawableRoad.hpp"
#include <algorithm>
#include <cairomm/context.h>
#include <cairomm/enums.h>
#include <cairomm/refptr.h>
#include <cmath>
#include <ext/alloc_traits.h>
#include <limits>
......@@ -33,7 +31,7 @@ void DrawableRoad::draw(const Cairo::RefPtr<Cairo::Context> &cr) const {
cr->line_to(coordinatePair[0], coordinatePair[1]);
});
cr->set_line_join(Cairo::LINE_JOIN_ROUND);
cr->set_line_join(Cairo::Context::LineJoin::ROUND);
cr->set_line_width(30);
cr->stroke_preserve();
cr->set_line_width(2.56);
......
#include "DrawableVehicle.hpp"
#include "DrawableRoad.hpp"
#include <cairomm/context.h>
#include <cairomm/refptr.h>
#include <cmath>
#include <utility>
......
#include "MapApplication.hpp"
#include <chrono>
#include <glibmm/i18n.h>
#include <glibmm/refptr.h>
#include <gtkmm/application.h>
#include <gtkmm/window.h>
#include <vector>
void MapApplication::initGettext() {
......@@ -26,7 +24,25 @@ void MapApplication::addWindow(Gtk::Window &window) {
if (application->get_windows().empty()) {
thread = std::thread([&window]() {
application = Gtk::Application::create("de.rwth_aachen.git.pi2.view");
application->run(window);
application->signal_activate().connect([&window]() {
application->add_window(window);
window.show();
// TODO: Remove this horrible hack
std::thread([&window]() {
window.set_default_size(-1, -1);
std::this_thread::sleep_for(std::chrono::milliseconds(10));
window.set_default_size(-1, -1);
std::this_thread::sleep_for(std::chrono::milliseconds(20));
window.set_default_size(-1, -1);
std::this_thread::sleep_for(std::chrono::milliseconds(50));
window.set_default_size(-1, -1);
std::this_thread::sleep_for(std::chrono::milliseconds(100));
window.set_default_size(-1, -1);
std::this_thread::sleep_for(std::chrono::milliseconds(200));
window.set_default_size(-1, -1);
}).detach();
});
application->run();
});
} else {
application->add_window(window);
......
......@@ -4,8 +4,6 @@
#include "DrawableRoad.hpp"
#include "DrawableVehicle.hpp"
#include <algorithm>
#include <cairomm/context.h>
#include <cairomm/refptr.h>
#include <cmath>
#include <gtkmm/widget.h>
......@@ -15,7 +13,9 @@ MapArea::MapArea(std::vector<DrawableJunction> &junctions,
std::vector<DrawableRoad> &roads,
std::map<std::string, DrawableVehicle> &nameVehicleMap)
: scale(1), junctions(junctions), roads(roads),
nameVehicleMap(nameVehicleMap) {}
nameVehicleMap(nameVehicleMap) {
set_draw_func(sigc::mem_fun(*this, &MapArea::on_draw));
}
void MapArea::adaptSizeRequest() {
int xJunctions, yJunctions, widthJunctions, heightJunctions;
......@@ -40,14 +40,11 @@ void MapArea::setScale(const double scale) {
queue_draw();
}
void MapArea::queue_draw_area(const int x, const int y, const int width,
const int height) {
Gtk::Widget::queue_draw_area(std::floor(scale * x), std::floor(scale * y),
std::ceil(scale * width),
std::ceil(scale * height));
}
bool MapArea::on_draw(const Cairo::RefPtr<Cairo::Context> &cr) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
void MapArea::on_draw(const Cairo::RefPtr<Cairo::Context> &cr, int width,
int height) {
#pragma GCC diagnostic pop
cr->scale(scale, scale);
for (auto &&road : roads) {
......@@ -61,6 +58,4 @@ bool MapArea::on_draw(const Cairo::RefPtr<Cairo::Context> &cr) {
for (auto &&[name, vehicle] : nameVehicleMap) {
vehicle.draw(cr);
}
return true;
}
......@@ -3,7 +3,6 @@
#include <cmath>
#include <glibmm/main.h>
#include <glibmm/priorities.h>
#include <glibmm/refptr.h>
#include <glibmm/signalproxy.h>
#include <glibmm/ustring.h>
#include <gtkmm/box.h>
......@@ -22,10 +21,6 @@
#include <sigc++/functors/mem_fun.h>
#include <utility>
// Use Glib::PRIORITY_HIGH_IDLE + 10 for resizing operations
// and Glib::PRIORITY_HIGH_IDLE + 20 for redrawing operations
// https://developer.gnome.org/glibmm/2.55/namespaceGlib.html#a0c450f82b9e34689e2dda2038ba7834faf2d20696a8afab425c00268d981e9897
const std::vector<std::string> MapWindow::zoomLevels = {
"50%", "70%", "85%", "100%", "125%",
"150%", "175%", "200%", "300%", "400%"};
......@@ -40,53 +35,35 @@ MapWindow::MapWindow(std::string windowTitle)
auto builder = Gtk::Builder::create();
builder->set_translation_domain("pi2-view");
builder->add_from_resource("/pi2-view/pi2-view.glade", "box");
Gtk::Box *box;
builder->get_widget("box", box);
auto box = builder->get_widget<Gtk::Box>("box");
Gtk::Viewport *viewport;
builder->get_widget("viewport", viewport);
auto viewport = builder->get_widget<Gtk::Viewport>("viewport");
builder->get_widget("listBox", listBox);
listBox = builder->get_widget<Gtk::ListBox>("listBox");
builder->get_widget("timeLabel", timeLabel);
builder->get_widget("laneLabel", laneLabel);
builder->get_widget("lanePositionPercentageLabel",
lanePositionPercentageLabel);
builder->get_widget("speedLabel", speedLabel);
builder->get_widget("remainingFuelLabel", remainingFuelLabel);
timeLabel = builder->get_widget<Gtk::Label>("timeLabel");
laneLabel = builder->get_widget<Gtk::Label>("laneLabel");
lanePositionPercentageLabel =
builder->get_widget<Gtk::Label>("lanePositionPercentageLabel");
speedLabel = builder->get_widget<Gtk::Label>("speedLabel");
remainingFuelLabel = builder->get_widget<Gtk::Label>("remainingFuelLabel");
builder->get_widget("zoomComboBoxText", zoomComboBoxText);
zoomComboBoxText = builder->get_widget<Gtk::ComboBoxText>("zoomComboBoxText");
for (auto &&zoomLevel : zoomLevels) {
zoomComboBoxText->append(zoomLevel);
}
zoomComboBoxText->set_active_text("100%");
zoomComboBoxText->signal_changed().connect(
sigc::mem_fun(*this, &MapWindow::onZoomSelectionChanged));
zoomComboBoxText->get_entry()->signal_activate().connect(
sigc::mem_fun(*this, &MapWindow::onZoomEntryActivate));
listBox->signal_row_selected().connect(
sigc::mem_fun(*this, &MapWindow::onVehicleRowSelected));
add(*box);
viewport->add(mapArea);
set_child(*box);
viewport->set_child(mapArea);
mapArea.show();
}
void MapWindow::onZoomEntryActivate() {
std::string input = zoomComboBoxText->get_active_text();
double zoom;
std::istringstream zoomBuffer(input);
zoomBuffer >> zoom;
mapArea.setScale(zoom / 100);
Glib::signal_idle().connect_once([this]() { mapArea.adaptSizeRequest(); },
Glib::PRIORITY_HIGH_IDLE + 10);
std::ostringstream formatBuffer;
formatBuffer << zoom << '%';
zoomComboBoxText->get_entry()->set_text(formatBuffer.str());
}
void MapWindow::onZoomSelectionChanged() {
std::string selection = zoomComboBoxText->get_active_text();
auto levelResult = std::find(zoomLevels.begin(), zoomLevels.end(), selection);
......@@ -101,10 +78,6 @@ void MapWindow::onZoomSelectionChanged() {
}
}
void MapWindow::refreshArea(int x, int y, int width, int height) {
mapArea.queue_draw_area(x, y, width, height);
}
MapWindow::~MapWindow() = default;
void MapWindow::onVehicleRowSelected(Gtk::ListBoxRow *row) {
......@@ -149,16 +122,12 @@ void MapWindow::addJunction(const double x, const double y) {
Glib::signal_idle().connect_once(
[this]() {
mapArea.adaptSizeRequest();
resizeWindow();
set_default_size(-1, -1);
},
Glib::PRIORITY_HIGH_IDLE + 10);
int xRegion, yRegion, widthRegion, heightRegion;
junction.getRegion(xRegion, yRegion, widthRegion, heightRegion);
Glib::signal_idle().connect_once(
[this, xRegion, yRegion, widthRegion, heightRegion]() {
mapArea.queue_draw_area(xRegion, yRegion, widthRegion, heightRegion);
},
Glib::PRIORITY_HIGH_IDLE + 20);
mapArea.queue_draw();
}
void MapWindow::addRoad(std::string laneThereName, std::string laneBackName,
......@@ -167,16 +136,12 @@ void MapWindow::addRoad(std::string laneThereName, std::string laneBackName,
Glib::signal_idle().connect_once(
[this]() {
mapArea.adaptSizeRequest();
resizeWindow();
set_default_size(-1, -1);
},
Glib::PRIORITY_HIGH_IDLE + 10);
int xRegion, yRegion, widthRegion, heightRegion;
road.getRegion(xRegion, yRegion, widthRegion, heightRegion);
Glib::signal_idle().connect_once(
[this, xRegion, yRegion, widthRegion, heightRegion]() {
mapArea.queue_draw_area(xRegion, yRegion, widthRegion, heightRegion);
},
Glib::PRIORITY_HIGH_IDLE + 20);
mapArea.queue_draw();
}
void MapWindow::addOrReplaceBicycle(const std::string &vehicleName,
......@@ -208,7 +173,7 @@ void MapWindow::addOrReplaceVehicle(const std::string &vehicleName,
if (selectedRow != nullptr) {
auto selectedVehicleName =
dynamic_cast<Gtk::Label &>(*selectedRow->get_child()).get_text();
if (selectedVehicleName == vehicleName) {
if (selectedVehicleName.raw() == vehicleName) {
red = green = blue = 1;
}
}
......@@ -231,18 +196,12 @@ void MapWindow::addOrReplaceVehicle(const std::string &vehicleName,
int newX, newY, newWidth, newHeight;
insertedVehicle.getRegion(newX, newY, newWidth, newHeight);
Glib::signal_idle().connect_once(
[this, newX, newY, newWidth, newHeight, oldX, oldY, oldWidth,
oldHeight]() {
mapArea.queue_draw_area(newX, newY, newWidth, newHeight);
mapArea.queue_draw_area(oldX, oldY, oldWidth, oldHeight);
},
Glib::PRIORITY_HIGH_IDLE + 20);
mapArea.queue_draw();
if (selectedRow != nullptr) {
auto selectedVehicleName =
dynamic_cast<Gtk::Label &>(*selectedRow->get_child()).get_text();
if (selectedVehicleName == vehicleName) {
if (selectedVehicleName.raw() == vehicleName) {
Glib::signal_idle().connect_once(
[this, &insertedVehicle]() { refreshVehicleLabels(insertedVehicle); },
Glib::PRIORITY_HIGH_IDLE + 20);
......@@ -253,16 +212,9 @@ void MapWindow::addOrReplaceVehicle(const std::string &vehicleName,
auto *label = Gtk::make_managed<Gtk::Label>();
label->set_text(vehicleName);
auto *listBoxRow = Gtk::make_managed<Gtk::ListBoxRow>();
listBoxRow->add(*label);
listBoxRow->set_child(*label);
listBox->append(*listBoxRow);
listBox->show_all_children();
listBoxRow->show();
listBox->select_row(*listBoxRow);
}
}
void MapWindow::resizeWindow() {
Gtk::Requisition minimumSize, naturalSize;
get_preferred_size(minimumSize, naturalSize);
resize(static_cast<int>(naturalSize.width),
static_cast<int>(naturalSize.height));
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment