FLTK assumes that widgets are not overlapping, except of course as children of a group. The group sends the event to the first child that contains the position of the mouse event. If that child widget handles the PUSH event (returns 1), Fl_Group will not do any more attempts to send the message. If that child does not handle FL_PUSH, Fl_Group will search for the next child that contains the mouse coordinates. If none of the children handles the event, Fl_Group returns 0 to the parent group.
--
You received this message because you are subscribed to a topic in the Google Groups "fltk.general" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/fltkgeneral/TfDQoRJ6G-Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to fltkgeneral...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/69579784-a4b3-4d72-9b96-61c097aa75c4n%40googlegroups.com.
This event is sent to the Fl::belowmouse() widget.
In order to receive FL_MOVE events, the widget must
return non-zero when handling FL_ENTER."
This means that if you override the handle() method of your group, you must look out for FL_ENTER events, and either call Fl_Group::handle or do your own handling, but make sure that you return 1. You will then receive FL_MOVE events. Only one widget receives move events. The same with FL_DRAG: you need to return 1 on FL_PUSH to receive FL_DRAG events. See event section in the docs.
Thank you for the clarification. Then in this case, is there any restriction that prevents the FL_MOVE event to be sent to a group? I want to be able to resize the group by catching the MOVE and DRAG events. However, because the group does not appear to get the MOVE event, I had to create a box that overlaps with the group.
--
You received this message because you are subscribed to a topic in the Google Groups "fltk.general" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/fltkgeneral/TfDQoRJ6G-Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to fltkgeneral...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/26073a0d-5599-4883-b2b4-0a5c798119b7n%40googlegroups.com.
#include <FL/Fl_Window.H>
#include <FL/Fl_Tile.H>
#include <FL/Fl_Box.H>
int main(int argc, char **argv) {
Fl_Window win(300, 300);
Fl_Tile tile(0, 0, 300, 300);
Fl_Group left(0, 0, 100, 300);
Fl_Box y(0, 0, 100, 100, "Y");
y.box(FL_DOWN_BOX);
Fl_Box a(0, 100, 100, 200, "A");
a.box(FL_DOWN_BOX);
left.end();
Fl_Box l(100, 0, 200, 300, "L");
l.box(FL_DOWN_BOX);
win.show(argc, argv);
return Fl::run();
}
--
You received this message because you are subscribed to a topic in the Google Groups "fltk.general" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/fltkgeneral/TfDQoRJ6G-Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to fltkgeneral...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/4fa1a43c-908a-466b-a1ff-082c8489b65fn%40googlegroups.com.
Ah, that's a nice use for overlapping widgets. I have solved this some time ago with a non-modal borderless window that contained only the text widget. If the user did anything outside of that window, I would hide and destroy it immediately and give control back to the app (a mix of non-modal, popup, and tooltip window). IIRC, it worked well, except MacOS had this thing where you could drag the app window without the popup window knowing about it, which made the text input hover randomly over the desktop ;-)
Thanks. This is really interesting stuff to know. Since popup menus seem to behave nicely in general, and we had a parallel request not too long ago for a popup list that can take keystrokes to limit the list, I should put some time into making these kind of windows work as expected.
As for event order and number of events, we try to keep this consistent across platforms, but we depend very much on the underlying drivers (WIN32, X11, Wayland, MacOS, ...), and these are not always reliable between versions either. It is possible though that we overlooked something, of course.