discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: does GORM no longer use TextView?


From: Mark Grice
Subject: Re: does GORM no longer use TextView?
Date: Sun, 18 Nov 2007 14:16:27 -0500

>you can instead create
> a connection to the surrounding scroll view and at runtime access it
> using its -documentView method (which will return to you the text view
> contained inside). As was mentioned in earlier posts however, this is a
> dirty hack and should be avoided if possible.
>

OK, I do think I understand what you mean now, thanks.

> I think your problem stems from the fact that while creating your
> connection, due to a Gorm bug, it is created to the surrounding scroll
> view, so that later when you load your file, during initialization in
> - -awakeFromNib if don't realize that what you're dealing with is an
> NSScrollView and send it messages understood only by an NSTextView, this
> throws an exception and loading of the Nib fails.

Yes, there is no question that is what is happening. I worked around
it last night by cutting and pasting manually out of the .gorm file
you supplied with the tutorial... that's how I figured out what the
problem was.

While I am on the subject... I don't know if you are close to the PM
development... but there was another issue I had to work around.
(Aside from the fact that the GUI has changed, but there is no help
for that...)

When I first created my project and selected the Document application
type, I got an error that said something like "Could not copy from
source directory to target directory" or something like that. I looked
around and found the directory:
/usr/lib/GNUstep/System/Applications/ProjectManager.app/Resources/ApplicationProjectType.projtype/Resources

And there I saw folder: DocumentBased.template

I guessed that this was what was being used by ProjectManager, and I
simply copied those files to my project dirctory manually. Then
everywhere I found the tag $PROJECT_NAME$ I simply replaced it with my
project's name "textEditor". There were two files I had to change the
name of, and then inside the file textEditor.pmproj, I had to also
find and replace the same tag.

When I was all done with that, it seems like everything was running
fine, and I was able to follow along with the demo with no problem.
But I'm guessing that ProjectManager thinks it is being launched from
some directory other than the one from which I launched it (or
something) because it wasn't finding its source files.

FWIW. (In case anyone else wants to run through the same demo...)

Thanks!


 I've had these
> problems a few times myself. Try adding to -awakeFromNib something like
> "NSLog (@"this is my view: %@", myView);" where "myView" is the outlet
> to your text view. If, at runtime, it shows that its a NSScrollView,
> then you know you have to do a "myView = [myView documentView];" first,
> before invoking NSTextView methods on it.
>
> - --
> Saso
>
>
> Mark Grice wrote:
> >> You should still be able to access text view during program
> >> run time through the NSScrollView outlet using [scrollView documentView].
> >>
> >
> > I'm not sure if I understand this... you mention that I can "access
> > TextView during program runtime..." But I am creating the outlet and
> > subclassing the textView class at design time.
> >
> > If I understand you correctly... (Which I may not!) I don't think this
> > works. The problem isn't when I am running the app. I cannot get to
> > the point where I even see a document window at runtime, as the error
> > I mentioned keeps me from loading the window... does accessing what
> > you said here still apply? (And if so, coudl you give me more detail?)
> >
> > Double-clicking the widget works at design time, so I am good... I
> > just want to make sure I understand the inner workings of GORM.
> >
> >
> >> - --
> >> Saso
> >>
> >>
> >> Mark Grice wrote:
> >>> I am not sure if I am asking this question in the right place... (If
> >>> not, please tell me where I go for these kinds of questions...)
> >>>
> >>> I am trying to follow an old tutorial I found here:
> >>>
> >>> http://student.fiit.stuba.sk/~kiselkov04/docu-demo/demo.html
> >>>
> >>> It is a simple Document handler. The problem is that when he selects
> >>> the widget on the Data Palette (See PNGS 1 and 2 attached) it is a
> >>> NSTextView.
> >>>
> >>> However, while I am following along, and  I select the *same* widget
> >>> and pull it onto the document window, it is an NSScrollView type. And
> >>> the trouble is from there the demo falls apart, since he invokes a
> >>> method which is supported by TextView, but not NSScrollView.
> >>>
> >>> Is this right? Gorm changed the widget type? Is there some way to
> >>> over-ride that?
> >>>
> >>>
> >>> ------------------------------------------------------------------------
> >>>
> >>>
> >>> ------------------------------------------------------------------------
> >>>
> >>>
> >>> ------------------------------------------------------------------------
> >>>
> >>>
> >>> ------------------------------------------------------------------------
> >>>
> >>> _______________________________________________
> >>> Discuss-gnustep mailing list
> >>> Discuss-gnustep@gnu.org
> >>> http://lists.gnu.org/mailman/listinfo/discuss-gnustep
> >> -----BEGIN PGP SIGNATURE-----
> >> Version: GnuPG v1.4.6 (GNU/Linux)
> >> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> >>
> >> iD8DBQFHP/gvakxhuWWzY78RA+chAJ90+V6ZJBHd7e3Co4A6UFut/Thm7wCePvrs
> >> UQK9I8uudcSWLz3zADPSNXI=
> >> =Nb4z
> >> -----END PGP SIGNATURE-----
> >>
> >
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFHQHgsakxhuWWzY78RA7qtAJ4pqYwccxAgqzcMqdhHs4t4Myql1QCeJvJm
> dhkewYdhSUH+bVNyLRH/eT8=
> =7znP
> -----END PGP SIGNATURE-----
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]