Hello, I''ve noticed that when I have a FXGLObject in a GLViewer it''s possible to drag it (the FXGLObject). How do I prevent the FXGLObject from being draggable? Regards Bj?rn Bergqvist
On Feb 20, 2006, at 1:57 AM, Bj?rn Bergqvist wrote:> I''ve noticed that when I have a FXGLObject in a GLViewer it''s possible > to drag it (the FXGLObject). How do I prevent the FXGLObject from > being draggable?You need to override the object''s canDrag() method, and have it return false. If you want all objects of that class to be undraggable, you''d want to subclass, e.g. class Cone < Fox::FXGLCone def canDrag false end end or if it''s just one particular object that you don''t want to be draggable: cone = FXGLCone.new(...) def cone.canDrag; false; end Hope this helps, Lyle
It did help. Thank you! On 2/20/06, Lyle Johnson <lyle at knology.net> wrote:> > On Feb 20, 2006, at 1:57 AM, Bj?rn Bergqvist wrote: > > > I''ve noticed that when I have a FXGLObject in a GLViewer it''s possible > > to drag it (the FXGLObject). How do I prevent the FXGLObject from > > being draggable? > > You need to override the object''s canDrag() method, and have it return > false. If you want all objects of that class to be undraggable, you''d > want to subclass, e.g. > > class Cone < Fox::FXGLCone > def canDrag > false > end > end > > or if it''s just one particular object that you don''t want to be > draggable: > > cone = FXGLCone.new(...) > def cone.canDrag; false; end > > Hope this helps, > > Lyle > >