protected override bool OnExposeEvent(Gdk.EventExpose evnt)
{
// The Entry's GdkWindow is the top level window onto which
// the frame is drawn; the actual text entry is drawn into a
// separate window, so we can ensure that for themes that don't
// respect HasFrame, we never ever allow the base frame drawing
// to happen
if(evnt.Window == GdkWindow) {
return true;
}
bool ret = base.OnExposeEvent(evnt);
if(text_gc == null || evnt.Window != text_window) {
text_window = evnt.Window;
RefreshGC();
}
if(Text.Length > 0 || HasFocus || parent.EmptyMessage == null) {
return ret;
}
int width, height;
layout.SetMarkup(parent.EmptyMessage);
layout.GetPixelSize(out width, out height);
evnt.Window.DrawLayout(text_gc, 2, (SizeRequest().Height - height) / 2, layout);
return ret;
}