Re: [Java-gnome-developer] Question: Gtk+ images drawing using Cairo ? - Button.onClicked ?
Brought to you by:
afcowie
From: Andrew C. <an...@op...> - 2009-01-10 02:45:46
|
On Sat, 2009-01-10 at 00:45 +0100, Goundy wrote: > requires refreshing the game area each time a [something > happens] ...I do drawing in the ExposeEvent of an Image > just like the example So those would probably have better been DrawingArea instead of Image; I've recently been doing some work with Poppler and did up the basics of DrawingArea while I was at it (it was pretty preliminary). Ping me next time we're online together I can tell you how to cherry pick it from the branch it's on. [it's revno 594 on my 'poppler' branch] http://research.operationaldynamics.com/bzr/java-gnome/hackers/andrew/poppler/ > but I really don't see how should > I do to be able to draw at a given moment ! I think what you want is Widget's getWindow() http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gtk/Widget.html#getWindow() then Window's invalidate() http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gdk/Window.html#invalidate(org.gnome.gdk.Rectangle,%20boolean) Let us know if it works! ++ As for your other problem, you'll only get Button.Clicked if the thing you are drawing on (over) is a Button. You may want Widget.ButtonPressEvent http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gtk/Widget.ButtonPressEvent.html AfC Sydney -- Andrew Frederick Cowie Operational Dynamics is an operations and engineering consultancy focusing on IT strategy, organizational architecture, systems review, and effective procedures for change management: enabling successful deployment of mission critical information technology in enterprises, worldwide. http://www.operationaldynamics.com/ Sydney New York Toronto London |