[Java-gnome-developer] Re: ImageMenuItem without a stockid
Brought to you by:
afcowie
From: Jeffrey M. <jef...@br...> - 2004-10-25 14:21:31
|
You are right. Please replace the getImage method with: public Image getImage() { int hndl = gtk_image_menu_item_get_image(getHandle()); if (0 == hndl) return null; GObject obj = retrieveGObject(hndl); if (null != obj) return (Image)obj; return new Image(hndl); } This method will cache the image the first time and return the cached version on subsequent calls. -Jeff On Mon, 2004-10-25 at 09:07, Laurent Martelli wrote: > >>>>> "Jeffrey" == Jeffrey Morgan <Jef...@Br...> writes: > This is going to return a new Image instance each time you call > getImage(), and it may fail since a handle can be negative, but I see > the point. Thanks. |