bug with addSubview ??
Hi, The upper textfield appears a long way from where I expect it (off the window initially, have to resize to see it). Is this just a bug or am I doing something silly ? #import Foundation/Foundation.h #include AppKit/AppKit.h @interface MySubView : NSView { NSTextField *p0; } @end @implementation MySubView - (id) initWithFrame: (NSRect)r { self = [super initWithFrame: r]; float pad=10.0; p0=[[NSTextField alloc] initWithFrame: NSMakeRect(r.origin.x+pad,r.origin.y+pad,r.size.width-(pad*2.0),r.size.height-(pad*2.0))]; [p0 setStringValue: @test]; [self addSubview: p0]; return self; } - (void) drawRect: (NSRect)rect { float pad = 5.0; float left = rect.origin.x+pad; float right = rect.origin.x+rect.size.width-pad; float bot = rect.origin.y+pad; float top = rect.origin.y+rect.size.height-pad; NSPoint p1 = NSMakePoint(left,bot); NSPoint p2 = NSMakePoint(right,bot); NSPoint p3 = NSMakePoint(right,top); NSPoint p4 = NSMakePoint(left,top); NSBezierPath *square = [NSBezierPath bezierPath]; [square moveToPoint:p1]; [square lineToPoint:p2]; [square lineToPoint:p3]; [square lineToPoint:p4]; [square lineToPoint:p1]; [[NSColor blackColor] set]; [square stroke]; } @end @interface MyView : NSView {} @end @implementation MyView - (id) initWithFrame: (NSRect)r { [super initWithFrame: r]; float offset=r.size.height/2.0; MySubView *mySV; mySV=[[MySubView alloc] initWithFrame: NSMakeRect(r.origin.x,r.origin.y,r.size.width,offset)]; [mySV setAutoresizingMask: NSViewWidthSizable|NSViewHeightSizable|NSViewMaxYMargin]; [self addSubview: mySV]; RELEASE(mySV); mySV=[[MySubView alloc] initWithFrame: NSMakeRect(r.origin.x,r.origin.y+offset,r.size.width,offset)]; [mySV setAutoresizingMask: NSViewWidthSizable|NSViewHeightSizable|NSViewMinYMargin]; [self addSubview: mySV]; RELEASE(mySV); return self; } @end @interface AppController : NSObject { NSWindow*window; MyView *myV; } - (void)applicationWillFinishLaunching:(NSNotification *) not; - (void)applicationDidFinishLaunching:(NSNotification *) not; @end @implementation AppController - (void) applicationWillFinishLaunching: (NSNotification *) not { NSMenu *menu = [NSMenu new]; [menu addItemWithTitle: @Quit action: @selector(terminate:) keyEquivalent: @q]; [NSApp setMainMenu:menu]; RELEASE(menu); window = [[NSWindow alloc] initWithContentRect: NSMakeRect(200, 200, 100, 100) styleMask: (NSTitledWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask) backing: NSBackingStoreBuffered defer: YES]; [window setTitle: @Hello World]; myV=[[MyView alloc] initWithFrame: [[window contentView] frame]]; [myV setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable ]; [[window contentView] addSubview: myV]; } - (void) applicationDidFinishLaunching: (NSNotification *) not { [window makeKeyAndOrderFront: self]; } @end int main(int argc, const char *argv[]) { NSAutoreleasePool *pool; AppController *delegate; pool = [[NSAutoreleasePool alloc] init]; delegate = [[AppController alloc] init]; [NSApplication sharedApplication]; [NSApp setDelegate: delegate]; RELEASE(pool); return NSApplicationMain (argc, argv); } Regards, Paddy ___ Discuss-gnustep mailing list Discuss-gnustep@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnustep
Re: bug with addSubview ??
On 2/10/07, Richard Frith-Macdonald [EMAIL PROTECTED] wrote: On 10 Feb 2007, at 11:23, Paddy Smith wrote: Hi, The upper textfield appears a long way from where I expect it (off the window initially, have to resize to see it). Is this just a bug or am I doing something silly ? I think probably something silly ... bear in mind that a views coordinates are relative to the view it is placed in. I suspect that you meant the coordinates for the textfield to be pad,pad rather than r.origin.x+pad,r.origin.y+pad D'oh! I really thought I'd checked that the origins coming in there were 0,0. I just figured I'd want them if I moved to another frame of reference (like if I ditch views). So the NSRect that is passed in is the frame in terms of the containing coordinates (which makes sense I suppose, otherwise you could just send a size :-)) and what it buys you is precisely what I'm trying to do(!), the ability to draw directly in the view, which is done in terms of *that* coordinate system. And the view having its own frame of reference is more or less just sugar that makes it a handy weapon to point at your feet ;-) My consistency hobgoblin is now hopping from foot to foot :-))) Thank you, thank you very much! That was something I wasn't going to see even though it was staring me in the face! :-) Regards, Paddy ___ Discuss-gnustep mailing list Discuss-gnustep@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnustep
Re: bug with addSubview ??
On 2/10/07, Paddy Smith [EMAIL PROTECTED] wrote: D'oh! I really thought I'd checked that the origins coming in there were 0,0. I just figured I'd want them if I moved to another frame of reference (like if I ditch views). So the NSRect that is passed in is the frame in terms of the containing coordinates (which makes sense I suppose, otherwise you could just send a size :-)) and what it buys you is precisely what I'm trying to do(!), the ability to draw directly in the view, which is done in terms of *that* coordinate system. And the view having its own frame of reference is more or less just sugar that makes it a handy weapon to point at your feet ;-) sorry, feeling a bit slow today. the rect in drawRect is origin 0,0 for a view (ie in terms of that view's frame of reference). apologies for blathering on :-) but thanks once again, my code works beautifully now :-) Regards, Paddy ___ Discuss-gnustep mailing list Discuss-gnustep@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnustep
Re: How do I make sounds ?
On 1/14/07, Fred Kiefer [EMAIL PROTECTED] wrote: Paddy Smith schrieb: is gsnd current? I don't seem to have one in my debian packages, and I couldn't get the source (from that package) to compile. when I try to use NSSound I get told about gsnd. I looked at cynthiune, and that will make sounds, but it knows about the whole menagerie of sound systems. I only need to do application sound effects, not specialist audio. I am not sure, I did understand your problem. GNUstep gui uses a tool called gnustep_sndd to produce audio. This program is located in the Tools section of GNUstep gui. When you compile GNUstep, and the necessary libraries are available, this tool should be compiled as well. okay, this is what I needed to know, thank you. The combination of the three data points I gave lead me to wonder whether I was missing something, and perhaps I still am, but having that single point to navigate by: that gnustep_sndd is the way, and should work, gives me plenty to work with. Indeed, I realise now that I was searching on the string 'gsnd' for a debian package, which was silly because I'd seen 'gnustep_sndd' written, but when I couldn't immediately find it in the binaries I went back to the source and went from the gsnd name there without looking too closely (cos it looked similar enough I imagined that it built to gnustep_gsndd) When I search for 'sndd' I turn up only a hit in debian stable, not the current testing, so I guess I'm loooking at a bug in the testing packages. What I don't know is, how this tool gets packaged up in debian packages. Will the tool come along with the rest of gui or be in a separate package? I would expect that it is included in the gnustep-gui-runtime package. Do I understand your mail correctly, that you are complaining there isn't one in there? yes, it is fairly easy to track which binary packages come from a given source package, and there are excellent facilities for searching the whole archive for files and so on. It was the combination of tripping over the name, the long spans of time, and the cynthiune thing that caused me to really wonder. Once again, many thanks. I'm chasing so many different little bits of info at once that it's a life-saver to be able to get a reality check like this, instead of scratching my head for a long time. Regards, Paddy ___ Discuss-gnustep mailing list Discuss-gnustep@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnustep
How do I make sounds ?
Hi, is gsnd current? I don't seem to have one in my debian packages, and I couldn't get the source (from that package) to compile. when I try to use NSSound I get told about gsnd. I looked at cynthiune, and that will make sounds, but it knows about the whole menagerie of sound systems. I only need to do application sound effects, not specialist audio. TIA, Paddy ___ Discuss-gnustep mailing list Discuss-gnustep@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnustep
bug? (‘NSMutableString’ may not respond to ‘-isEqualTo:’, but on macosx you can get away with it)
Although I haven't checked yet, I expect its a warning on macosx as well. Cocoafibs compiles on macosx with a large number of warnings, so I may have a few of these. The question is whether you want me to file this kind of stuff in the bug tracker? Regards, Paddy ___ Discuss-gnustep mailing list Discuss-gnustep@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnustep
NSTextView, NSTextField and resizing
Hi, when I throw together a test app in gorm, the NSTextView does not behave as I would expect, although it works okay from code. instead it grows when resized horizontally but will not shrink back. I have a gorm file where the text simply does not resize at all, like bug #15988. I may have created it in gorm, but I suspect it is a conversion from a cocoa nib, so there may be a interoperability thing there. an NSTextField with setAutoresizingMask: NSViewWidthSizable seems to show some interesting behaviour when resized. I would have expected the insert point to be at the right hand side when there was too much text to display, and the start of the text at the left when there was enough room. moving the focus on and off the textfield seems to correct this. I understand there is a shared widget for such cells, so this makes sense. I have seen it in a state where the widget is not covering all the cell and/or (depending how you look at it) the text in the cell is in the wrong place, so that the same text is repeated twice. I did try to use a textview instead of a textfield (I only have one!), but I've yet to figure out how to make it behave like a textfield (controlling the number of lines of characters height in particular). I would actually prefer to have the option of multiple lines of input for this box, so it would be nice to figure out a bit better how to do this. I've seen code that will do setstring:@a very long string, sizetofit,setstring:@, but how to handle mulitple lines ? Anyway, I'm starting to waffle ... practically instant bugfixes are, as always, gratefully received :-) as are corrections, tips, and any reflections, explanations, etc on textview vs textfield Regards, Paddy ___ Discuss-gnustep mailing list Discuss-gnustep@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnustep
Re: NSTextView, NSTextField and resizing
Superb! thanks! starter is https://savannah.gnu.org/bugs/index.php?18649 behaviour is the same if I create a gorm file instead. I'll see whether the old bug/gorm problem will survive trimming down to example size, if not I'll post you the whole thing. the textfield is https://savannah.gnu.org/bugs/index.php?18651 I'll try taking a look at NSTextField ... but from past experience I know that kind of code can get pretty tricky, so don't expect too much! :-) I neglected to mention that I'm using the base_1_13_0 bugfix branch of foundation now, but I'm fairly sure I saw all this earlier in the day when I'd forgotten to install my build from last night and had stock etch packages instead. Regards, Paddy ___ Discuss-gnustep mailing list Discuss-gnustep@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnustep
Re: NSTextView, NSTextField and resizing
I'll see whether the old bug/gorm problem will survive trimming down to example size, if not I'll post you the whole thing. it did. https://savannah.gnu.org/bugs/index.php?18654 Regards, Paddy ___ Discuss-gnustep mailing list Discuss-gnustep@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnustep
Re: Test base library stable branch please
On 12/28/06, Hubert Chan [EMAIL PROTECTED] wrote: On Sat, 23 Dec 2006 15:38:16 +, Richard Frith-Macdonald [EMAIL PROTECTED] said: Could people please make an effort to check out the stable branch (http://svn.gna.org/viewcvs/gnustep/libs/base/branches/base-1_13_0/) of the base library from subversion and check that none of the backported bugfixes is faulty. I'm just shifting to this (r24274) now. so far that patch and the fix for bug #18107 work here (many thanks, once again!) and I've not noticed any new problems. Users of the Debian packages who don't want to compile it on their own can use my precompiled versions, available at: http://debian.uhoreg.ca/experimental/gnustep/gnustep-base/ You can also use the apt sources line: deb http://debian.uhoreg.ca/experimental/gnustep/ ./ It should be able to install straight on top of the regular Debian packages. Let me know if there are any problems with it. I'll try to keep the packages relatively up to date. Right now, the packages are based on an SVN checkout from last Saturday. superb! I'd be happy to send/build you ppc binaries if it helps, but I imagine you have buildds for that :-) Regards, Paddy ___ Discuss-gnustep mailing list Discuss-gnustep@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnustep
using NSKeyedArchiver ...
the following code 'seems to work' on macosx, but not on the gnustep in debian etch. Am I doing something silly ? int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; NSMutableString *foo; foo=[[NSMutableString alloc] init]; [foo setString: @wib]; NSLog(@check: %08x: %@, foo, foo); NSData *bar; bar=[NSKeyedArchiver archivedDataWithRootObject:foo]; NSMutableString *baz; baz=[NSKeyedUnarchiver unarchiveObjectWithData:bar]; NSLog(@check: %08x: %@, baz, baz); [pool release]; return 0; } Regards, Paddy ___ Discuss-gnustep mailing list Discuss-gnustep@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnustep
Re: attempted install on Debian system
Ric, I very recently installed the gnustep from sid on etch. here is what I have on that box atm: jibs:~# dpkg -l '*gnustep*' Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed |/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad) ||/ Name Version Description +++-=-=-== hn addresses-goodies-for-gnu none(no description available) hn gnustep none(no description available) hn gnustep-antlr none(no description available) hn gnustep-back none(no description available) ii gnustep-back-common 0.11.0-1 The GNUstep GUI Backend - common files pn gnustep-back-doc none(no description available) ii gnustep-back0.10 0.10.2-1 The GNUstep GUI Backend hi gnustep-back0.11 0.11.0-1 The GNUstep GUI Backend ii gnustep-base-common 1.13.0-1 GNUstep Base library - common files pn gnustep-base-doc none(no description available) pn gnustep-base-examples none(no description available) ii gnustep-base-runtime 1.13.0-1 GNUstep Base library un gnustep-base1 none(no description available) un gnustep-base1-dbg none(no description available) un gnustep-base1-dev none(no description available) ii gnustep-common1.13.0-1 Common files for the core GNUstep environment hn gnustep-core none(no description available) hn gnustep-core-develnone(no description available) pn gnustep-core-doc none(no description available) hn gnustep-devel none(no description available) hn gnustep-dl2 none(no description available) hn gnustep-examples none(no description available) hn gnustep-games none(no description available) hn gnustep-gdnone(no description available) ii gnustep-gpbs 0.11.0-1 The GNUstep PasteBoard Server ii gnustep-gui-common0.11.0-1 GNUstep GUI Library - common files ii gnustep-gui-doc 0.11.0-1 Documentation for the GNUstep GUI Library ii gnustep-gui-runtime 0.11.0-1 GNUstep GUI Library - runtime files un gnustep-gui0 none(no description available) un gnustep-gui0-dbg none(no description available) un gnustep-gui0-dev none(no description available) pn gnustep-icons none(no description available) ii gnustep-make 1.13.0-1 Basic GNUstep Makefiles pn gnustep-make-doc none(no description available) hn gnustep-make-ogo none(no description available) hn gnustep-netclassesnone(no description available) ii gnustep-ppd 1.0.0-6 GNUstep Postscript Printer Description pn gnustep-tutorial-html none(no description available) pn gnustep-tutorial-pdf none(no description available) un gnustep-xgps0 none(no description available) un libgnustep-base-dbg none(no description available) ii libgnustep-base-dev 1.13.0-1 GNUstep Base header files and development libraries hn libgnustep-base1.10 none(no description available) hn libgnustep-base1.10-dbg none(no description available) hn libgnustep-base1.10-dev none(no description available) ii libgnustep-base1.11 1.11.2-3 GNUstep Base library hn libgnustep-base1.11-dbg none(no description available) hn libgnustep-base1.11-dev none(no description available) ii libgnustep-base1.13 1.13.0-1 GNUstep Base library hn libgnustep-base1.13-dbg none(no description available) un libgnustep-gui-dbgnone(no description available) ii libgnustep-gui-dev0.11.0-1 GNUstep GUI header files and static libraries hn libgnustep-gui0.10none(no description available) hn libgnustep-gui0.10-dbgnone
Re: Re: porting cocoafibs, trouble with nibs
On 9/16/06, Fred Kiefer [EMAIL PROTECTED] wrote: Nice thing that you are doing here. Your main problem seems to be that GNUstep currently does not support NSController and its subclasses (in your case NSUserDefaultsController). With that missing your NIB file will never work, which ever way you convert it. I see two ways to proceed: Either you manage to remove the need for that class from the original NIB file or we need to add that class somewhere. I have some basic implementation for some of the controller classes lying around here, but I never committed them to GNUstep as not to bloat our code with unused classes. okay, so it sounds like I need to get a handle on 1) how far gnustep is away from having NSController support that would solve this problem for this case. and 2) how much work we would need to do to rip the NSController stuff out, and replace it. For preference I would rather work on the NSController stuff, which should be of use to others, rather than on the hand-coding replacement bits. any chance of getting my hands on your code ? ;-) Regards, Paddy ___ Discuss-gnustep mailing list Discuss-gnustep@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnustep
porting cocoafibs, trouble with nibs
Hi, we are attempting to port cocoafibs (http://sourceforge.net/projects/cocoafibs/) to gnustep at http://sourceforge.net/projects/stepfibs/ converting the nib files is giving us trouble. One of them, the Invite nib will go through nib2gmodel. the resulting gmodel will load in gorm (1.1.0 built against the gnustep in debian sid). the nib that gorm emits from that will not load in the macosx IB (xcode2.4), giving the error -[NSPlaceHolderMutableString initWithString]: nil argument which is interesting because trying to load the macosx nib directly (saved out to xml) in gorm results in the error Exception -initWithSring: given nil string. There are errors with other nibs like no class for name 'NSUserDefaultsController'. [incidentally, it would be really nice to be able to cut'n'paste these errors off the gorm gui] the original source in question can be got from the cocoafibs cvs on sourceforge, but the nibs there are in the binary format. I have posted the macosx IB output of those nibs in the xml format and the Invite nib output from gorm mentioned above on the stepfibs sourceforge under Files. So, help, suggestions, advice, encouragement, etc. all gratefully received :-) What do people suggest: should we stick with nibs, or use renaissance, or something else ? Any suggestions on how to convert nibs to renaissance? is there a program to do this ? Regards, Paddy ___ Discuss-gnustep mailing list Discuss-gnustep@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnustep