[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Tabbed views in applications
From: |
Ivan Vučica |
Subject: |
Re: Tabbed views in applications |
Date: |
Sat, 31 Aug 2013 22:00:58 +0200 |
This example might be helpful:
http://svn.gna.org/svn/gnustep/tests/examples/trunk/gui/Old/nstabview.m
It's not a tutorial as such, but it could help in further exploration.
An NSTabView is a subclass of NSView. It contains NSTabViewItem instances.
These instances describe individual NSViews that you can select using tab view
buttons.
As for how to structure the app -- if you want to do a tabbed FTP client or
Terminal or such a type of apps, you may want to design a controller class
(TerminalSessionController), a view class (TerminalSessionView) and assign a
controller instance to each individual NSView. Then, separately keep the
NSArray of controllers. While each controller does keep track of its view (and
probably vice versa), views are primarily kept inside the view hierarchy. That
means, each view is kept in its NSTabViewItem instance, which is then kept in
its NSTabView instance.
You'll especially be interested in -addTab: method in the linked example.
On 31. 8. 2013., at 21:53, James Carthew <jcarthew@gmail.com> wrote:
> Is there a tutorial somewhere for howto create a tabbed view in a GNUstep
> application with both adding and removing tabbed views, as well as spawning a
> default tab? I've been wanting this for ages as I wanted to create a tabbed
> FTP client, Terminal, etc. Does a good tutorial for this exist? Or could
> someone please make one?
> _______________________________________________
> Discuss-gnustep mailing list
> Discuss-gnustep@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnustep
--
Ivan Vučica
ivan@vucica.net - http://ivan.vucica.net/