summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2020-05-07 17:46:23 +0200
committerAlbrecht Schlosser <albrechts.fltk@online.de>2020-05-07 17:46:23 +0200
commit4ab49d30d3f67510a0abc01fdd6a3a0fcee797eb (patch)
treee4772fec99560215a043622b4d2819e9ef96baef /test
parentf386bd2cb78fc9a5bffdf0451870720aafacca37 (diff)
parent46253603de6ac40df5403efe1c059b33b89ee2e2 (diff)
Merge branch 'pr-30_fl_message_position'
Merge PR #30 with extensions to position the message box centered over given coordinates or a widget or window.
Diffstat (limited to 'test')
-rw-r--r--test/ask.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/ask.cxx b/test/ask.cxx
index 522f4ca1c..72d88ed2a 100644
--- a/test/ask.cxx
+++ b/test/ask.cxx
@@ -49,7 +49,7 @@ void rename_me_pwd(Fl_Widget*o) {
update_input_text(o, input);
}
-void window_callback(Fl_Widget*, void*) {
+void window_callback(Fl_Widget *win, void*) {
int hotspot = fl_message_hotspot();
fl_message_hotspot(0);
fl_message_title("note: no hotspot set for this dialog");
@@ -58,8 +58,11 @@ void window_callback(Fl_Widget*, void*) {
fl_message_hotspot(hotspot);
if (rep==1)
exit(0);
- else if (rep==2)
+ else if (rep==2) { // (Dunno)
+ fl_message_position(win);
+ fl_message_title("This dialog must be centered over the main window");
fl_message("Well, maybe you should know before we quit.");
+ }
}
/*