FLTK logo

Re: Fltk coordinate behavior is a little peculiar

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.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Fltk coordinate behavior is a little peculiar "MacArthur, Ian (SELEX GALILEO, UK)" Jun 09, 2011  
 
> I am learning v1.3. I inherited a Fl_Widget, and put 
> fl_rectf(0, 0, w(), h()) in the virtual draw() method, but 
> the rectangle was drawn on the top left of the top level 
> window. And moving Fl_Group will not move its children. All 
> these are peculiar(compared with Qt, Gtk+, etc.), and I took 
> a day to figure this out (not a bug but a feature). Will this 
> change in Fltk3?

Historically, fltk-1 has always used window-relative rather than
parent-relative origins. This often causes confusion, but is easily
addressed (simply query the x(), y() offsets in your draw method then
add those on to your positions...)

For fltk-2 the co-ordinate frame was made parent-relative, as that
seemed the more "normal" choice.

At some point, fltk-3 will offer a choice...


SELEX Galileo Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 3EL
A company registered in England & Wales.  Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************
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'.