RE: NSScrollView example? (SOLVED)
RE: NSScrollView example? (SOLVED)
- Subject: RE: NSScrollView example? (SOLVED)
- From: "Peter Karlsson" <email@hidden>
- Date: Mon, 02 Aug 2004 09:29:11 +0000
Everything is OK now, thanks J O A R for your help.
The white background problem was solved with this line:
[scrollview setDrawsBackground:NO];
My background is now the silver texture.
Best regards Peter
From: "Peter Karlsson" <email@hidden>
To: email@hidden, email@hidden
Subject: RE: NSScrollView example?
Date: Mon, 02 Aug 2004 06:29:17 +0000
After some experimenting I come up with the following code:
// add tabview
tabView = [[NSTabView alloc] initWithFrame: NSMakeRect(-7, -2, 712, 220)];
[tabView setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
[tabView setTabViewType:NSBottomTabsBezelBorder];
[tabView setControlSize:NSMiniControlSize];
[tabView setFont:[NSFont fontWithName:@"Lucida Grande" size:9]];
[editorDrawer_EditorNsviewOutlet addSubview: tabView];
// add tabviewitem
tabViewItem = [[NSTabViewItem alloc] initWithIdentifier: @"My label"];
[tabViewItem setLabel: @"My label"];
[tabView addTabViewItem: tabViewItem];
// add scrollview
NSScrollView *scrollview = [[NSScrollView alloc] initWithFrame: [tabView
frame]];
[scrollview setBorderType:NSNoBorder];
[scrollview setHasVerticalScroller:NO];
[scrollview setHasHorizontalScroller:YES];
// add view
myView = [[NSView alloc] initWithFrame: NSMakeRect(0, 0, 1000,
100)];
[scrollview setDocumentView: myView];
[tabViewItem setView: scrollview];
// add slider
NSSlider *mySlider = [[NSSlider alloc] initWithFrame: NSMakeRect(50, 10,
133, 21)]; [myView addSubview: mySlider];
First I added a tabview to my drawer, on the tabview I added tabviewitems,
on each tabviewitem I added a scrollview, on the scrollview I added a view,
and on the view I added a slider. Is this the correct way of doing it?
The problem I have now is that my view where the slider is located is
colored white instead of the silver texture. Everything else seems to work
even if it still needs some adjusting. Can someone please tell me what I'm
doing wrong?
Best regards Peter
From: "Peter Karlsson" <email@hidden>
To: email@hidden
Subject: NSScrollView example?
Date: Sun, 01 Aug 2004 15:17:07 +0000
Dear list!
I wonder if there is some good examples on how to programatically create a
NSScrollView? I have a NSView, and with a popup I programatically add
different objects, when I add more objects then the view can handle
(outside my view) I want a vertical scroller on my view. But I can't
figure out how it works.
Can someone please point me in the right direction?
Best regards Peter
_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail
_______________________________________________
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.
_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail
_______________________________________________
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.
_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail
_______________________________________________
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.