setCaption in AlertDialog

0 views
Skip to first unread message

djpeinado

unread,
Jun 15, 2007, 7:01:06 AM6/15/07
to GWT Tk
Hello,
I am developing a gwt widget, and I use gwttk. Everything is fine, but
I have a little problem with the caption of an AlertDialog. I would
like to use an HorizontalPanel created by me as a caption, so I use
setCaption( Widget w ), but I'll probably do something wrong, because
the caption seems to be empty. I have inspected the DOM and my
HorizontalPanel is not there. There is only the original empty
caption. Could you help me?

I need to put an HorizontalPanel as caption because I'd like to use a
customizable by CSS image for the icon. I use the background-image
property, but I cannot use the Image widget without using a
transparent image as source. As I use the Label widget, I cannot use
the setIcon method.

As a provisional solution, I use the setCaptionText method, using
toString() method to obtain the HTML code. It works, but I cannot put
the icon on the left side of the caption as it would be if I used the
setIcon method.

Thank you very much.

Alberto

Mat Gessel

unread,
Jun 15, 2007, 10:56:36 PM6/15/07
to gwt...@googlegroups.com
Hi Alberto,

Out of curiosity, why do you need a CSS background image? For dynamic
theme changes?

AlertDialog wasn't really designed with customization in mind.
setCaption() is not supported and should probably throw an
UnsupportedOperationException. buildCaption() is protected, so you can
subclass and override it to return a custom caption.

I've logged a RFE for a customizable dialog with some of AlertDialog's
features:
http://code.google.com/p/gwt-tk/issues/detail?id=6

Best regards,

-= Mat

Reply all
Reply to author
Forward
0 new messages