[Java-gnome-developer] Re: ImageMenuItem without a stockid
Brought to you by:
afcowie
From: Laurent M. <la...@ao...> - 2004-10-25 14:08:06
|
>>>>> "Jeffrey" == Jeffrey Morgan <Jef...@Br...> writes: Jeffrey> This is a current limitation of the bindings. The gtk Jeffrey> library has methods to set and get an Image. Please open a Jeffrey> bug against the bindings. We will be starting our 2.9 Jeffrey> development effort in the next week or so and I can quickly Jeffrey> add this capability. If you want the feature now you can Jeffrey> just past the following code into the ImageMenuItem.java Jeffrey> file above the declaration of the native methods. public void setImage(Image image) { gtk_image_menu_item_set_image(getHandle(), image.getHandle()); } public Image getImage() { int hndl = gtk_image_menu_item_get_image(getHandle()); if (hndl > 0) return new Image(hndl); return null; } 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. -- Laurent Martelli la...@ao... Java Aspect Components http://www.aopsys.com/ http://jac.objectweb.org |