discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Geometry problem


From: S.B., Vaitheeswaran
Subject: RE: Geometry problem
Date: Tue, 24 Jun 2003 10:14:22 -0700

Having a pointer to each object in the other, would that solve ur
problem. Normally. this is what is done, when you want to have
views/subviews and when u want to notify changes in one view to others.
This could mean that u may have to retain each other which causes a
retain cycle and needs to be carefully handled.

Vaithee.

-----Original Message-----
From: Kazunobu Kuriyama [mailto:kazunobu.kuriyama@nifty.com]
Sent: Monday, June 23, 2003 8:18 PM
To: discuss-gnustep@gnu.org
Subject: Geometry problem


Hi, all.

I have a question about the GNUstep's geometry.
The question is as follows:


        X
    |-------|    Object A
 -- +---------------------------------------------------
  | |(0,0)
Y | |
  | |            Object B
 -- |       +----------------------------------------
    |       |(X,Y)
    |       |
    |       |
    |       |


Here, you have two GUI objects Object A and Object B.  Object A
is the main window of an GNUstep application, and Object B is an
instance of either the NSView class or its subclass.  The coordinates
system is taken as shown above.  Ignore the border width for now
because it's a matter of arithmetic.  Then, you need to know the
coordinates values (X, Y) to implement a method declared in the
interface of Object B.  Write a piece of code to calculate X and Y.
The code should be independent of the underlying window system.

If Object A is a parent or ancestor of Object B (in a sense of
window hierarchy), the answer may be easy.  I have no idea,
however, if Object A is an instance of NSApplication.

Could you help me so that I won't devise GSTranslateCoordinates,
a ridiculous wrapper of XTranslateCoordinates() that ruins
the GNUstep's OO structure?

Thank you.




_______________________________________________
Discuss-gnustep mailing list
Discuss-gnustep@gnu.org
http://mail.gnu.org/mailman/listinfo/discuss-gnustep




reply via email to

[Prev in Thread] Current Thread [Next in Thread]