FLTK logo

Re: How to enable Drag n Drop on OpenGL window ?

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.opengl  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: How to enable Drag n Drop on OpenGL window ? Albrecht Schlosser Feb 22, 2013  
 
On 18.02.2013 12:17, Furqan wrote:

> ... File only accepted when drop over the Fl_Double_Window.
>
> Here is my code..
>
> MainWindow->begin(); // Fl_Double_Window
>
> DnDReceiver b(0,0,WINDOW_SIZE_W, WINDOW_SIZE_H); // Drag n Drop Box
>
> glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH | GLUT_ACCUM | GLUT_ALPHA | GLUT_STENCIL | GLUT_MULTISAMPLE);
> GLUT_MAIN_WINDOW = glutCreateWindow(RACS_VERSION);
> MainWindow->end();
> MainWindow->show(argc, argv);
>
> I tried to put DnDReceiver box before, after, middle, everywhere, inside of begin and end of Fl_Double_Window but no success.
>
> Please guide me Where to put "DnDReceiver" box in the code.

To receive events first, you must put the invisible receiver
box last, but within begin()/end() of the main window. You can
imagine that this box is the top-most widget in the widget
layer(s) of your window, so it gets the events first. If it
returns zero on an event, then the event "falls through" to
the lower layers.

BTW: in contrast, drawing is done first to last widget within
each group/window, which is essentially the same principle:
bottom layer drawn first, top layer drawn last.

Albrecht
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.