Re: [Java-gnome-developer] Assertion failure while drawing on DrawingArea
Brought to you by:
afcowie
From: Jeff M. <ku...@gm...> - 2005-01-06 01:21:28
|
I do have some good news for you. There have been many bugs fixed in the latest cvs. I just ran your example and it works without the crash. In fact, it is now in our cvs. If you are runing the HEAD you should be able to create your DrawingArea now. If you are using anonymous cvs you may have to wait until tomorrow for all of the fixes to appear. On Sun, 12 Dec 2004 19:40:24 +0000, Jaime <re...@sa...> wrote: > On Sun, 2004-12-12 at 16:55 +0000, Mark Howard wrote: > > Hi, > > > > I'm not familiar with the drawing widgets, so this is completely off the top of > > my head: > > > > You've created a window and filled it with a DrawingArea. > > You try to draw on the window, but this fails. I'm guessing that this fails > > since there is already something else on the window -- the DrawingArea. > > > > Try changing your code to DrawPoint on the drawingarea instead. Please write > > back saying if it works or not. > > > Hi Mark. > > Unfortunately, neither the "top level window" (of type > org.gnu.gtk.Window) nor the DrawingArea embedded inside it (of type > org.gnu.gtk.DrawingArea) possess a drawPoint() method - the only class > which does (according to the javadocs) is an > "org.gnu.gdk.Window" (notice the change from gtk.Window to gdk.Window!) > > This itself, is fine, as it seems to agree with the following > documentation: > > a) The javadocs for org.gnu.gtk.Widget.getWindow() ("Return the widget's > gdk window. This is the window to draw upon when writing custom widgets. > It's available after the widget has been mapped. Thus if you listen to > LifeCycleEvents, you can fetch the Window instance using this method > after an LifeCycleEvent of type MAP has occured. Returns: the widget's > gdk window, or null if a) it hasn't been mapped yet or b) it is of a > type that doesn't have a gdk window. > > b) http://www.pygtk.org/pygtk2tutorial/sec-DrawingMethods.html > The example code "drawingarea.py" is what I'm actually trying to port to > java - line 41, for example, refers to: > self.area.window.draw_point(self.gc, x+30, y+30) > ("area" is the drawing area, the "window" attribute is its embedded > gdkWindow, which gets drawn upon using the "draw_point" method) > > c) http://developer.gnome.org/doc/API/2.0/gtk/GtkDrawingArea.html > and http://www.gtk.org/tutorial/sec-thedrawingareawidget.html > > Incidently, I've tried using both the gdk.Window returned by both > area.getWindow() _and_ window.getWindow(), but they both return the same > error. > > Hope some of this makes sense, > > Jaime :-) > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://productguide.itmanagersjournal.com/ > _______________________________________________ > java-gnome-developer mailing list > jav...@li... > https://lists.sourceforge.net/lists/listinfo/java-gnome-developer > -- Jeffrey Morgan "The highest reward for a man's toil is not what he gets for it, but what he becomes by it" - Jon Ruskin |