Giter Club home page Giter Club logo

Comments (17)

kgn avatar kgn commented on July 18, 2024

I want the title bar to be as tall as the one in the second image but have a custom background image like the one in the first image. How would do this?

You can set the height of the title bar with titleBarHeight, this is demonstrated in the sample app.

setTitleDrawingBlock: takes a block which contains the drawing code for the title bar. Here is a simple example that draws the titlebar as a solid red color.

[self.window setTitleBarDrawingBlock:^(BOOL drawsAsMainWindow, CGRect drawingRect, CGPathRef clippingPath){
    CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort]; 
    CGContextAddPath(context, clippingPath);
    CGContextClip(context);
    [[NSColor redColor] set];
    NSRectFill(drawingRect);
}];

How would I add a Navigation Bar-like control to the title bar using INAppStoreWindow like in github for mac

You can add whatever views and controls you want to to titleBarView.

from inappstorewindow.

ekdevdes avatar ekdevdes commented on July 18, 2024

@kgn thanks how would i set a window title? also how would i use a repeatable image for the background of the titleBar like in iOS with [[UIImage imageNamed:@"myimage.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0,0,10,10)] also to get a title bar with a custom title font (like in the first image i posted) i would have to add a NSLabel (or whatever the Mac SDK's equivalent is to UILabel) to the titleView then set its font using the font property,center it in titleView and add it as a subview of the titleView correct?

from inappstorewindow.

ekdevdes avatar ekdevdes commented on July 18, 2024

@kgn thanks for your help! My next question is how do i customize the bottom toolbar?

from inappstorewindow.

kgn avatar kgn commented on July 18, 2024

how would i use a repeatable image for the background of the titleBar

Just like on iOS you can use CGContextDrawTiledImage or [NSColor colorWithPatternImage:].

...and add it as a subview of the titleView correct?

Yes

My next question is how do i customize the bottom toolbar?

The bottom bar isn't a part of INAppStoreWindow. The bottom bar in the sample app is enabled in IB by setting the content boarder in the size tab.

from inappstorewindow.

ekdevdes avatar ekdevdes commented on July 18, 2024

@kgn thanks. what is the os x equivalent of uilabel? a uneditable nstextfield?

from inappstorewindow.

kgn avatar kgn commented on July 18, 2024

Yep

from inappstorewindow.

ekdevdes avatar ekdevdes commented on July 18, 2024

@kgn thanks for all your help!

from inappstorewindow.

kgn avatar kgn commented on July 18, 2024

You're welcome, can't wait to see what you build with it :)

from inappstorewindow.

ekdevdes avatar ekdevdes commented on July 18, 2024

One more question lol. How can make a Mac app store-like top bar? With the tabs? I know it has something to do with NSButton but I don't know what. I also need the text that describes each tab below the tabs icon.

On Aug 10, 2012, at 2:06 PM, David Keegan [email protected] wrote:

You're welcome, can't wait to see what you build with it :)


Reply to this email directly or view it on GitHub.

from inappstorewindow.

indragiek avatar indragiek commented on July 18, 2024

You could either subclass NSButtonCell and override -drawWithFrame:inControlView: to draw a custom button that shows the image and the text, or you could just write a basic NSView subclass that draws the same thing and accepts -mouseDown: events, etc.

from inappstorewindow.

ekdevdes avatar ekdevdes commented on July 18, 2024

Thanks.

Sent from my iPod

On Aug 10, 2012, at 2:40 PM, Indragie Karunaratne [email protected] wrote:

You could either subclass NSButtonCell and override -drawWithFrame:inControlView: to draw a custom button that shows the image and the text, or you could just write a basic NSView subclass that draws the same thing and accepts -mouseDown: events, etc.


Reply to this email directly or view it on GitHub.

from inappstorewindow.

SevenBits avatar SevenBits commented on July 18, 2024

Question: how does one center the controls that you add to the titleBarView? It seems to just place it at the left hand side of the window.

from inappstorewindow.

kgn avatar kgn commented on July 18, 2024

@SevenBits Are you setting the frames of the controls and using auto resizing masks or auto layout?

from inappstorewindow.

SevenBits avatar SevenBits commented on July 18, 2024

I created an NSView and added it to the titleBarWindow of the INAppStoreWindow.

On Mar 16, 2013, at 10:28 PM, David Keegan [email protected] wrote:

@SevenBits Are you setting the frames of the controls and using auto resizing masks or auto layout?


Reply to this email directly or view it on GitHub.

from inappstorewindow.

jwilling avatar jwilling commented on July 18, 2024

@SevenBits To follow up on that, what @kgn wanted to know was whether you have auto layout enabled for your titlebar view. By default, on new nibs it is enabled. Check in Interface Builder to see if you have AL enabled or not.

Also, this question might be better suited as a new issue.

from inappstorewindow.

SevenBits avatar SevenBits commented on July 18, 2024

Okay, sorry. I'll check on that and get back to you.

On Mar 16, 2013, at 11:51 PM, Jonathan Willing [email protected] wrote:

@SevenBits To follow up on that, what @kgn wanted to know was whether you have auto layout enabled for your titlebar view. By default on new nibs, it is enabled. Check in Interface Builder to see if you have AL enabled or not.


Reply to this email directly or view it on GitHub.

from inappstorewindow.

SevenBits avatar SevenBits commented on July 18, 2024

Okay, so the nib in question (containing the INAppStoreWindow and the title bar controls) is using auto layout. I've tried every conceivable thing to get this to work, but no avail. I'd prefer to not have to use hacks if possible.

I should note that that this does not work even in the included Sample App. The window with a colored title bar (created with the New Window Controller button) has the same problem: I resize the window, and the title bar controls stay static.

On Mar 16, 2013, at 11:51 PM, Jonathan Willing [email protected] wrote:

@SevenBits To follow up on that, what @kgn wanted to know was whether you have auto layout enabled for your titlebar view. By default on new nibs, it is enabled. Check in Interface Builder to see if you have AL enabled or not.


Reply to this email directly or view it on GitHub.

from inappstorewindow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.