[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Geometry problem
From: |
Kazunobu Kuriyama |
Subject: |
Geometry problem |
Date: |
Tue, 24 Jun 2003 12:17:47 +0900 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; ja-JP; rv:1.0.0) Gecko/20020614 |
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.
- Geometry problem,
Kazunobu Kuriyama <=