Re: [Java-gnome-developer] Assertion failure while drawing on DrawingArea
Brought to you by:
afcowie
From: Jaime <re...@sa...> - 2004-12-12 15:10:50
|
On Sun, 2004-12-12 at 09:53 -0500, Jeff Morgan wrote: > What version of java-gnome are you using? Are you using > cvs HEAD? > > Sorry Jeff, I should have mentioned in my original email that I'm using the latest stable releases available from ftp.gnome.org i.e. libgtk-java: 2.4.6 libgnome-java: 2.8.2 libglade-java: 2.8.2 libgconf-java: 2.8.2 Do you know whether this is something that's been "fixed" in cvs (if so, I'll download cvs and try to compile it) Thanks, Jaime > On Sun, 12 Dec 2004 14:08:57 +0000, Jaime <re...@sa...> wrote: > > Hi folks. > > > > I've tried to write a simple little program to draw on a DrawingArea, > > but without success. I get the following assertion failure at runtime: > > > > (java-gnome:2393): Gdk-CRITICAL **: file gdkdraw.c: line 338 > > (gdk_draw_point): assertion `GDK_IS_DRAWABLE (drawable)' failed > > > > Could anyone please tell me where I'm going wrong? In fact, a pointer to > > any example code which successfully draws onto a DrawingArea would be > > just as good! Thank you, > > > > Jaime :-) > > > > <snip> > > package drawingAreaTest; > > > > import org.gnu.gtk.DrawingArea; > > import org.gnu.gtk.Gtk; > > import org.gnu.gtk.Window; > > import org.gnu.gtk.WindowType; > > import org.gnu.gtk.event.ExposeEvent; > > import org.gnu.gtk.event.ExposeListener; > > import org.gnu.gtk.event.LifeCycleEvent; > > import org.gnu.gtk.event.LifeCycleListener; > > > > public class Test { > > > > DrawingArea area = null; > > > > Window window; > > > > Test() { > > window = new Window(WindowType.TOPLEVEL); > > window.setTitle("Drawing Area Example"); > > window.addListener(new LifeCycleListener() { > > public void lifeCycleEvent(LifeCycleEvent event) { > > } > > public boolean lifeCycleQuery(LifeCycleEvent event) { > > if (event.isOfType(LifeCycleEvent.Type.DESTROY) > > || event.isOfType(LifeCycleEvent.Type.DELETE)) { > > Gtk.mainQuit(); > > } > > return true; > > } > > }); > > area=new DrawingArea(); > > window.add(area); > > area.addListener(new ExposeListener() { > > public boolean exposeEvent(ExposeEvent event) { > > System.out.println("Expose event: "+window.getWindow()); > > window.getWindow().drawPoint(20, 20); > > return false; > > } > > }); > > window.showAll(); > > System.out.println("Should be printed before expose event"); > > } > > > > public static void main(String[] args) { > > Gtk.init(args); > > new Test(); > > Gtk.main(); > > } > > > > } > > </snip> > > > > ------------------------------------------------------- > > 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 > > > > |