Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7709909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:58:48+00:00 2026-06-01T00:58:48+00:00

In Interface Builder components I have Gradient Button I would like to create this

  • 0

In Interface Builder components I have Gradient Button

Gradient Button

I would like to create this button programmatically. But I can’t find combination of button type, bezel style and gradient type to reproduce it. My local goal is to create plus (add) and minus (remove) buttons like this

Add and remove items, gradient button

May be you can also know how to implement part at right of minus? It looks like disabled gradient button.

Update (2012-02-01, 14:52)

I put gradient button on empty xib, open xib with text editor and find my button. This is a part of code.

<array class="NSMutableArray" key="NSSubviews">
  <object class="NSButton" id="155381693">
    <reference key="NSNextResponder" ref="1005"/>
    <int key="NSvFlags">268</int>
    <string key="NSFrame">{{20, 303}, {106, 23}}</string>
    <reference key="NSSuperview" ref="1005"/>
    <reference key="NSWindow"/>
    <string key="NSReuseIdentifierKey">_NS:2466</string>
    <bool key="NSEnabled">YES</bool>
    <object class="NSButtonCell" key="NSCell" id="976550657">
      <int key="NSCellFlags">-2080244224</int>
      <int key="NSCellFlags2">134217728</int>
      <string key="NSContents">Gradient Button</string>
      <object class="NSFont" key="NSSupport">
        <string key="NSName">LucidaGrande</string>
        <double key="NSSize">13</double>
        <int key="NSfFlags">1044</int>
      </object>
      <string key="NSCellIdentifier">_NS:2466</string>
      <reference key="NSControlView" ref="155381693"/>
      <int key="NSButtonFlags">-2033434369</int>
      <int key="NSButtonFlags2">162</int>
      <string key="NSAlternateContents"/>
      <string key="NSKeyEquivalent"/>
      <int key="NSPeriodicDelay">400</int>
      <int key="NSPeriodicInterval">75</int>
    </object>
  </object>
</array>

I will try to reproduce button using this information.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T00:58:50+00:00Added an answer on June 1, 2026 at 12:58 am

    OMG, I was blind. Just set bezel style to NSSmallSquareBezelStyle and button
    type to NSMomentaryPushInButton.

    I don’t need images. I don’t need custom draw with CoreGraphics (I did my own class for that). I don’t need to parse xib. I don’t need to dump runtime structures (I did it to find nessesuary values of fields in outlet to gradient button created with xib). I had to try all values of bezel style from documentation. But if you read description for NSSmallSquareBezelStyle in documentation you understand my confusion: it’s very far from “Gradient” value in IB wizard.

    enter image description here

    Correct code:

    NSButton *gradientButton = [[NSButton alloc] initWithFrame:NSMakeRect(40, 40, 80, 32)];
    [gradientButton setButtonType:NSMomentaryPushInButton];
    [gradientButton setBezelStyle:NSSmallSquareBezelStyle];
    [gradientButton setTitle:@"Title"];
    [self.window.contentView addSubview:gradientButton];
    

    Result:

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Interface Builder can be used for basic dependency injection in a Cocoa app, but
In Interface Builder I have this hierarchy: View 1.1 Image View //it's my background
I have registered a component like this in my Global.asax.cs: ContainerBuilder builder = new
i have added a pickerview from interface builder.i am using this method to show
How do I connect a button added in Interface Builder to an action? This
the app I want to create will have an interface very like Keynote, with
Through Interface Builder I have the ability to change the Identifier of a UIBarButtonItem
I used the Interface Builder to create a table view, to which I added
In Interface Builder, I have set the dataCell of one of the columns of
I want to create a web based interface/GUI builder that used a specific set

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.