Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Readin a stacktrace

Readin a stacktrace
Thread Tools
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status: Offline
Reply With Quote
Oct 16, 2001, 03:05 PM
 
Alrighty, so I made a nice Custom NSWindow in Coca-Java that I could drag around and resize. There's only one catch: after dragging it a around enough, I will eventually get it to crash. Here's my stacktrace in Project Builder's debugger:


So, does anyone see what's going on? Here's my drag code for reference:

<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>
public void mouseDragged(NSEvent theEvent)
{
NSPoint currentLocation;
NSPoint newOrigin;
NSRect screenFrame = NSScreen.mainScreen().frame();
windowFrame = this.frame();


if(!lowerRightCorner) <font color = brown>//just dragging</font>
{
<font color = brown>//grab the current global mouse location; we could just as easily get the mouse location </font>
<font color = brown>//in the same way as we do in -mouseDown:</font>
currentLocation = this.convertBaseToScreen(this.mouseLocationOutside OfEventStream());
newOrigin = new NSPoint(currentLocation.x() - initialLocation.x(), currentLocation.y() - initialLocation.y());

<font color = brown>// Don't let window get dragged up under the menu bar</font>
if( (newOrigin.y()+windowFrame.size().height()<font color = blue>+22</font>) &gt; (screenFrame.origin().y()+screenFrame.size().heigh t()) )
{
newOrigin = new NSPoint(newOrigin.x(), screenFrame.origin().y() + (screenFrame.size().height()-windowFrame.size().height()<font color = blue>-22</font>));
}

<font color = brown>//go ahead and move the window to the new location</font>
this.setFrameOrigin(newOrigin);
}
}
</font>[/code]

Thanks in advance,
F-bacher

[ 10-16-2001: Message edited by: Ghoser777 ]

[ 10-16-2001: Message edited by: Ghoser777 ]
     
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status: Offline
Reply With Quote
Oct 16, 2001, 04:53 PM
 
Hmm... that looks like a stack trace of native code, and you probably want a Java stack trace. Have you set your executable target in Project Builder to use the Jav debugger instead of gdb?
Rick Roe
icons.cx | weblog
     
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status: Offline
Reply With Quote
Oct 16, 2001, 04:57 PM
 
Originally posted by Rickster:
<STRONG>Hmm... that looks like a stack trace of native code, and you probably want a Java stack trace. Have you set your executable target in Project Builder to use the Jav debugger instead of gdb?</STRONG>
Ahhh... no I did not. That could be useful. I'll try that when I get home... in 5 hours.

Thanks,
F-bacher
     
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status: Offline
Reply With Quote
Oct 17, 2001, 12:16 AM
 
This must be a very serious problem, cause it even crashes the java debugger! And I just found out that using the QT API's likes to make my interface totally unresponsive. How can two seemingly easy issues (seeing if my NSMovie is done playing, dragging an NSWindow) be holding me up so long.

Grrr...
F-bacher
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:28 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2