nstabview

Cocoa NSTabView coding style question

。_饼干妹妹 提交于 2020-01-01 19:39:32
问题 I have a coding style question which probably should be asked of a senior mac programmer at work - but since I'm the only mac programmer, well, SO it is. I have a pop-up GUI for my software (3D models, data visualization) and the pop-up is Mainly a Tabbed control with a ton of stuff in each tab (sliders, radio buttons, checkboxes, etc.) With something like 20 controls per tab, and maybe half a dozen tabs... using a single controller for all the views is going to get unwieldly very quickly. Is

Nativescript/Js. How can I change the appearance of TabViewItem?

好久不见. 提交于 2019-12-24 06:52:22
问题 How do I change the appearance of TabViewItem ()? I'm trying to set the radius of the border and the width of the border, as in the picture: but it does not work: var tabViewModule = require("ui/tab-view"); var tabEntry0 = new tabViewModule.TabViewItem(); tabEntry0.borderRadius="30%"; tabEntry0.borderWidth="30%"; Who know, how it doing.? 来源: https://stackoverflow.com/questions/45369470/nativescript-js-how-can-i-change-the-appearance-of-tabviewitem

How to change the color of the tab button and the view itself in NSTabView?

你说的曾经没有我的故事 提交于 2019-12-21 06:39:59
问题 I am working on OS X app, and I am using NSTabView. I would like to change the background color of the tab (button). Currently the background is blue, (Attribute Inspector -> Appearance = Inherited (Aqua). Same is true with the background color of the view itself. I subclass the NSTabView, and I add inside this code: CGContextRef context = (CGContextRef) [[NSGraphicsContext currentContext] graphicsPort]; CGContextSetRGBFillColor(context, 241.0/255.0, 252.0/255.0, 255.0/255.0, 1.0);

Cocoa: Tab view with toolbar icons for switching tabs

此生再无相见时 提交于 2019-12-18 13:47:32
问题 Various Preferences dialogs (Safari, Mail, Xcode4, and any that uses NSPreferences) and Xcode4's Organizer use something reminiscent of a tab view -- except that is uses toolbar buttons for switching between tabs. These buttons are "pressed". What is the best way to implement such a tab view? Is there a documented public API for implementing them? 回答1: Since Mac OS X 10.10 (Yosemite), the easiest way to do this is to lay out your preferences dialog window in a storyboard using an

Adding a copy of an NSTabViewItem from an NSTabView into the same NSTabView

有些话、适合烂在心里 提交于 2019-12-10 22:07:33
问题 I'm creating a simple web browser and would like to implement tabs. For this purpose, I'm using an NSTabView . I basically want each tab to have a WebView that will show the website loaded. I'm starting with only one tab and want to add an exact copy of the first one when I create a new tab. I tried something like tabView.addTabViewItem(tabView.tabViewItemAtIndex(0).copy() as NSTableViewItem) but I'm getting an unrecognised selector sent to instance error. I've check the documentation for

Control a NSTabViewController from parent View

a 夏天 提交于 2019-12-10 18:35:20
问题 (I'm using storyboards and swift.) I currently have a NSWindowController which has a NSTabViewController as contentViewController. I am now trying to change the Tabs from the NSWindowController via code using let tabController = self.contentViewController as! NSTabViewController tabController.tabView.selectTabViewItemAtIndex(1) but the TabView doesn't change the view. Am I using the API wrong? 回答1: I found an forum post about this topic. There seems to be a bug when setting the tabView index

How to draw your own NSTabView tabs?

微笑、不失礼 提交于 2019-12-09 06:50:02
问题 I want to draw my own tabs for NSTabViewItem s. My Tabs should look different and start in the top left corner and not centered. How can I do this? 回答1: it is possible to set the NSTabView's style to Tabless and then control it with a NSSegmentedControl that subclasses NSSegmentedCell to override style and behavior. For an idea how to do this, check out this project that emulates Xcode 4 style tabs: https://github.com/aaroncrespo/WILLTabView/. 回答2: NSTabView isn't the most customizable class

Add a close button to NSTabviewitem

廉价感情. 提交于 2019-12-06 08:38:53
问题 I have a application with a tab view when the user clicks in the menu for example "client data" I generate a tab programmaticaly. Now I want to subclass the tab view to add a close button for each NSTabviewitem. If you don't have an answer you could help with documentation or sample code 回答1: I know this question is ancient, but... I spent some time trying to add buttons to NSTabViewItems with a custom subclass, and as far as I can tell it's not really possible. NSTabViewItem simply isn't

How to change the color of the tab button and the view itself in NSTabView?

♀尐吖头ヾ 提交于 2019-12-03 23:06:28
I am working on OS X app, and I am using NSTabView. I would like to change the background color of the tab (button). Currently the background is blue, (Attribute Inspector -> Appearance = Inherited (Aqua). Same is true with the background color of the view itself. I subclass the NSTabView, and I add inside this code: CGContextRef context = (CGContextRef) [[NSGraphicsContext currentContext] graphicsPort]; CGContextSetRGBFillColor(context, 241.0/255.0, 252.0/255.0, 255.0/255.0, 1.0); CGContextFillRect(context, NSRectToCGRect(dirtyRect)); which does change the background color, but also cover the

How to draw your own NSTabView tabs?

情到浓时终转凉″ 提交于 2019-12-03 07:34:15
I want to draw my own tabs for NSTabViewItem s. My Tabs should look different and start in the top left corner and not centered. How can I do this? it is possible to set the NSTabView's style to Tabless and then control it with a NSSegmentedControl that subclasses NSSegmentedCell to override style and behavior. For an idea how to do this, check out this project that emulates Xcode 4 style tabs: https://github.com/aaroncrespo/WILLTabView/ . NSTabView isn't the most customizable class in Cocoa, but it is possible to subclass it and do your own drawing. You won't use much functionality from the