summaryrefslogtreecommitdiff
path: root/test/ask.cxx
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2020-05-07 17:43:04 +0200
committerAlbrecht Schlosser <albrechts.fltk@online.de>2020-05-07 17:43:04 +0200
commit46253603de6ac40df5403efe1c059b33b89ee2e2 (patch)
treee4772fec99560215a043622b4d2819e9ef96baef /test/ask.cxx
parentee7577a89708370e424d90221cecf05c4b2ec121 (diff)
Extend fl_message_position() with 'center' option
Add argument 'center' to position the message box centered over the given x/y coordinates. Add another method to supply a widget or window to center the message box over. Fix documentation and don't use INT_MIN to avoid having to include limits.h in user code.
Diffstat (limited to 'test/ask.cxx')
-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.");
+ }
}
/*