[Lazarus] How to draw text in a edit (GTK2)

silvioprog silvioprog at gmail.com
Wed Oct 5 00:16:04 CEST 2011


2011/10/4 zeljko <zeljko at holobit.net>:
>
> Yes, because widgetsets draws it's native controls, and some doesn't support
> painting outside of paint event (carbon, qt).
>
> But even with that you can do such things. There's example on my wiki page
> how to paint whatever over TEdit control with qt widgetset (bottom of page).
>
> http://wiki.lazarus.freepascal.org/User:Zeljan
>
> zeljko

I saw the Qt code, but don't know how to do this in GTK.

My intention was to create a placeholder without working in methods
RealGetText/RealSetText. In Windows I can easily do with:

(...)
const
  ECM_FIRST = $1500;
  EM_SETCUEBANNER = ECM_FIRST + 1;
begin
  Edit1.Perform(EM_SETCUEBANNER, 0, LParam(PWideChar(WideString('Test'))));
end;
(...)

I gave up trying to do in GTK, with canvas. x(

Thanks to all.

-- 
Silvio Clécio
===============================================
Blog - <silvioprog.com.br>
Twitter - <twitter.com/silvioprog>
Facebook - <facebook.com/silvioprog>
LazSolutions - <code.google.com/p/lazsolutions>
LazWebSolutions - <code.google.com/p/lazwebsolutions>
Lazarus-BR - <groups.google.com.br/group/lazarus-br?hl=pt-BR>
===============================================
   * Conheça nosso canal IRC sobre Lazarus: #lazarus-br *
===============================================




More information about the Lazarus mailing list