mirror of
https://github.com/celisej567/abaddon.git
synced 2026-09-13 20:18:50 +03:00
add confirmation dialog to leave guild
This commit is contained in:
30
dialogs/confirm.cpp
Normal file
30
dialogs/confirm.cpp
Normal file
@@ -0,0 +1,30 @@
|
||||
#include "confirm.hpp"
|
||||
|
||||
ConfirmDialog::ConfirmDialog(Gtk::Window &parent)
|
||||
: Gtk::Dialog("Confirm", parent, true)
|
||||
, m_layout(Gtk::ORIENTATION_VERTICAL)
|
||||
, m_bbox(Gtk::ORIENTATION_HORIZONTAL)
|
||||
, m_ok("OK")
|
||||
, m_cancel("Cancel") {
|
||||
set_default_size(300, 50);
|
||||
|
||||
m_label.set_text("Are you sure?");
|
||||
|
||||
m_ok.signal_clicked().connect([&]() {
|
||||
response(Gtk::RESPONSE_OK);
|
||||
});
|
||||
|
||||
m_cancel.signal_clicked().connect([&]() {
|
||||
response(Gtk::RESPONSE_CANCEL);
|
||||
});
|
||||
|
||||
m_bbox.pack_start(m_ok, Gtk::PACK_SHRINK);
|
||||
m_bbox.pack_start(m_cancel, Gtk::PACK_SHRINK);
|
||||
m_bbox.set_layout(Gtk::BUTTONBOX_END);
|
||||
|
||||
m_layout.add(m_label);
|
||||
m_layout.add(m_bbox);
|
||||
get_content_area()->add(m_layout);
|
||||
|
||||
show_all_children();
|
||||
}
|
||||
Reference in New Issue
Block a user