From 46253603de6ac40df5403efe1c059b33b89ee2e2 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Thu, 7 May 2020 17:43:04 +0200 Subject: 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. --- test/ask.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'test') 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."); + } } /* -- cgit v1.2.3