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: o Kiselkov <address@hidden>
Subject: Re: does GORM no longer use TextView?
Date: Sun, 18 Nov 2007 18:36:44 +0100
User-agent: Thunderbird 2.0.0.6 (X11/20071022)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

It really is very simple. You can access the widget at design time by
double-clicking it and dragging connections to/from it. However, should
you have a problem connecting to the text view directly (remember, the
text view is the white thing inside, and the scroll view contains it in
itself and draws those nice scrollers around it), 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.

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. 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]