• 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
Programmatic layout and creating round buttons?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Programmatic layout and creating round buttons?


  • Subject: Programmatic layout and creating round buttons?
  • From: Allan Odgaard <email@hidden>
  • Date: Sun, 21 Jul 2002 21:34:32 +0200

Hi there,

I have a rule editor similar to what can be found in iTunes 3's smart playlists, i.e. the user can add/remove rules, which result in adding/removing GUI elements to my window.

What I'm really confused about is wether I should just hardcode all positions and sizes of these added elements.

The Aqua Human Guidelines speak about not relying on hardcoded values, because things could change, but then it goes on to discuss a lot about the pixel size of the current Aqua look and how e.g. one should use 12 pixels spacing between vertical stacked buttons etc.

I've tried to use sizeToFit on my added elements to get their size, but this is only a partial solution, e.g. an NSPopUpbutton resizes to a height of 26 where an NSTextField only becomes 21 pixels heigh -- so even using this method I need some way to hardcode the baseline offset.

Also, I need to call setSelectedItem with all possible values on the NSPopUpButton, call sizeToFit, record the dimensions, and then use the largest result, since sizeToFit only takes the currently selected item into its calculations.

Secondly I need to use one of these round buttons used everywhere in Mac OS X (e.g. with a lock, question mark, lupe, plus or minus sign on it) -- but how do I create this in my own program? I can find it in IB's palette (and need to set the small attribute for it to match the height of my other UI elements), but programatically I cannot find a 'small setting'. What I currently do is create an NSButton and set ButtonType to NSMomentaryPushButton and BezelStyle to NSRoundedBezelStyle and then the frame to 33x30 or similar, but it doesn't really look correct, and it clips the label, which it doesn't in IB.
_______________________________________________
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: Programmatic layout and creating round buttons?
      • From: David Martin <email@hidden>
  • Prev by Date: Re: Opening drawer on program launch
  • Next by Date: Re: Opening a drawer on program launch?
  • Previous by thread: Re: Opening drawer on program launch
  • Next by thread: Re: Programmatic layout and creating round buttons?
  • Index(es):
    • Date
    • Thread