Posts Tagged ‘creating’

Creating NSOutlineView programmatically

Posted in Apple on March 9th, 2010 by Saba – 2 Comments

Hi Everyone,

I am trying to create an NSOutlineView programmatically inside of an NSDrawer. I am using the example datasource from /Developer/Examples/ AppKit/OutlineView the “FileSystemItem”. My issue is that although the root item is displayed in the OutlineView, it is not expandable and does not show any of the children. The datasource is identical to the one in the Apple example so I’m guessing my issue is the way I am creating the NSOutlineView in code rather than in IB. The result is that I see an outlineview with one item (the root item) with one table column header and no expand icons. If anyone can see something I’m doing wrong I would very much appreciate the help My code is attached.

Thank you ahead of time! Zack

NSView *contentView = [win contentView]; [contentView setAutoresizesSubviews:YES];

outlineView = [[NSOutlineView alloc] initWithFrame: [contentView frame]];

//DataSource. code is attached below ZBFSDataSource *ds = [[ZBFSDataSource alloc] init]; [outlineView setDataSource: ds];

NSTableColumn *c = [[NSTableColumn alloc] initWithIdentifier: @”NAME”]; [c setEditable: NO]; [c setMinWidth: 150.0]; [outlineView addTableColumn: c]; [c release];

[outlineView reloadData];

scrollView = [[NSScrollView alloc] initWithFrame: [outlineView frame]]; [scrollView setDocumentView: outlineView]; [scrollView setAutoresizesSubviews: YES];

NSDrawer *drawer = [[NSDrawer alloc] initWithContentSize:NSMakeSize(200.0, 400.0) preferredEdge:NSMinXEdge]; [drawer setParentWindow: win]; [drawer setContentView: scrollView]; [drawer open];

DataSource:

- (NSInteger)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item { return (item == nil) ? 1 : [item numberOfChildren]; }

- (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable: (id)item { return (item == nil) ? YES : ([item numberOfChildren] != -1); }

- (id)outlineView:(NSOutlineView *)outlineView child:(NSInteger)index ofItem:(id)item { return (item == nil) ? [FileSystemItem rootItem] : [(FileSystemItem *)item childAtIndex:index]; }

- (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item { return (item == nil) ? @”/” : (id)[item relativePath]; }

Creating layered TIFF files

Posted in Apple on March 3rd, 2010 by Saba – 1 Comment

I’m looking for hints, code or anything at all that will let me write a layered TIFF file from Cocoa. There are a few mentions in the archives but nothing concrete. Can Cocoa be made to support this, or do I need to use an external TIFF library?

Need help after Creating satelite assembly

Posted in Dot Net on February 26th, 2010 by Saba – Be the first to comment

Dear Folks,

*I Created a Satellite assembly as follows*

1. Created a resource(a.resx) file (values as String1 = Good Bye World) 2.Converted to a1.resources using resgen 3.created a strong name (snk_us.snk) 4. created a dll using Al /Embed:a1.resources /out:cls.dll /c:en-US /keyfile: snk_us.snk 5. after that installed in Gacutil using gacutil-i (now this cls.dll is global assembly) 6. i wrote a code to access the String1 value as this after adding the reference of cls.dll

ResourceManager rm = new ResourceManager(“a1″, Assembly.GetExecutingAssembly());

Response.Write(rm.GetString( “String1″)); Webconfig:

**

Error:

*Could not find any resources appropriate for the specified culture or the neutral culture. Make sure “res_US.resources” was correctly embedded or linked into assembly “App_Web_yv-xjx00″ at compile time, or that all the satellite assemblies required are loadable and fully signed. * Can any one suggest me where i went wrong Please!!!!

regards and thanks in advance, Sarvesh

Need GUID for Creating Firefox Extension

Posted in Firefox on February 24th, 2010 by Saba – 1 Comment

Hi all, I am creating a little extension, I need a GUID for the same. Where can i get a GUID for Firefox Extension creation?

Saravanan Sundaramoorthy Red Hat Certified Engineer +91 99404 32545

Creating dynamic fields and saveing it using asp.net

Posted in Dot Net on February 21st, 2010 by Saba – Be the first to comment

code or pagedesign or some clue?

On Fri, Feb 19, 2010 at 7:46 AM, Jamie Fraser wrote:

Creating dynamic fields and saveing it using asp.net

Posted in Dot Net on February 19th, 2010 by Saba – Be the first to comment

Code?

On Thu, Feb 18, 2010 at 12:05 PM, aditya chavan wrote:

Help with creating CustomViews

Posted in Apple on February 19th, 2010 by Saba – 3 Comments

Hi all,

I’m a newcomer when it comes to Cocoa development. I have some good books and they discuss the possibility of CustomViews but the views they create aren’t the type that I’m interested. I’ve scoured the web and haven’t found exactly the help I need and I’ve tried the trial-and-error method and it hasn’t worked.

What I’m trying to do is the following: -I have a number of model objects, different instances of the same class. -I want to create a CustomView that would enable the display of these objects. -The CustomView is defined in its own NIB file. It consists of a bunch of NSTextField objects laid out in NSBox. -I then want to use that CustomView all over the place. :) But for starters, I’m trying to create a window with 10 instances of my CustomView. -I want to drop the CustomView in other NIB files and set up the actions/outlets/etc.

The path that I took that seemed to give the best promise was: I created a CustomViewController (subclassing NSViewController) In MyDocument.init, I init the CustomViewController with my CustomView NIB file. In MyDocument.windowControllerDidLoadNib, I call viewController.view setFrame: and then windowController.window.contentView addSubView.

That manages to get my CustomView to show up in the document’s window. But that was done programatically and not in IB.

Then I looked at the DragAround sample code on the Apple site. This seemed to be exactly give tips for exactly what I wanted, except that the DragAroundView draws itself, there is no NIB file for the view.

If someone can point me to some sample code, that would be great. In the meantime, I’ll keep trying.

Jean Duteau

Creating dynamic fields and saveing it using asp.net

Posted in Dot Net on February 18th, 2010 by Saba – 1 Comment

Hello,

I want to generate the dynamic label and text fields in asp.net using C#, On the text changed event of the other text field and then retrive its value and to save that into the database. for example: one text filed ask for the number to generate the fields and then save that to the database. I used table controls to create the fields but not able to save the data to the data base.

Please Help on this issue as soon as possible.

Aditya Chavan

Creating an Application Support folder

Posted in Apple on February 12th, 2010 by Saba – 7 Comments

I’m trying to find a best way to create the Application Support folder. I’m rather new at Cocoa so it’s taking me a while to do even this simple thing. I’m also interested in ensuring my application can be localized easily.

I have a function “- (NSString *)applicationSupportFolder” that returns the desired folder name, properly localized. I call this function and then use NSFileManager to check for the existence of the folder. Because there can be a file (NOT a folder) already bearing the folder name, I need to handle that possibility. Everything I’ve found on the internet just ignores this case.

Can anyone recommend what I should do?

creating an NSSearchField subclass like Safari

Posted in Apple on February 5th, 2010 by Saba – 2 Comments

I’m looking to create an NSSearchField that behaves like the one in safari. Primarily I want the following:

- search menu includes search matches (Suggestions) as well as recent searches – search menu opens when the user enters text that has possible matches (rather than just when the button is clicked) – search menu will update the matches while the user continues to type – can change focus from the text view to the menu and back with the arrow keys

Honestly, it looks scary to me (but then, I’m easily scared), and my searches for something that already does some/all of this have turned up nothing. Does anybody know of an existing implementation that does at least some of what I want?

Thanks,

Neil