• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
InterfaceBuilder and control coordonates....
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

InterfaceBuilder and control coordonates....


  • Subject: InterfaceBuilder and control coordonates....
  • From: Jérome Foucher <email@hidden>
  • Date: Thu, 24 Jul 2003 10:24:19 +0200

Hello,

I'm trying to build dialogs on-the-fly from XML files.
The XML file describe each control : position, size, label, embedded controls, plus some private information about the control.
Don't ask me why I didn't simply use NIB files. I need extra information about each control, which cannot be put in NIBs.....

I've designed some dialogs in Interface Builder, took each control's coordonates, and wrote them in my XML files.

The result is quite interesting : my dialogs looked very ugly : the controls were not at all positonned/sized as they were in IB.
For instance, when you create a simple button in IB, the size is locked and says 20 pixels.
Now if you try in your code to manually create a NSButton with a height of 20 pixels, it will get truncated !

So I didn't give up. I hard-coded some values to apply to each type of control so that all looked as in IB

But now it appears that each time I embed a control in a NSBox I still have to move this control 4 pixels left and 4 pixels down.
Some here comes my question : is there a way to change the origin (0,0) of a NSBox's content to (-a, -b), so that if I embed a NSButton at (10, 10), it will be drawn at (10-a, 10-b) ?
If some people are familiar with QuickDraw, I'm looking for something similar to SetOrigin

Thanks
Jerome
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: InterfaceBuilder and control coordonates....
      • From: Ronald Jaramillo <email@hidden>
  • Prev by Date: Re: time-based beta termination system
  • Next by Date: Re: InterfaceBuilder and control coordonates....
  • Previous by thread: Re: accessing view in a nib
  • Next by thread: Re: InterfaceBuilder and control coordonates....
  • Index(es):
    • Date
    • Thread