tags:

views:

27

answers:

1

Hi Experts,

I want to use cairo to enhance gtkentry look. For this, I have connected a callback to 'expose-event'. In callback, I call gtkentry's original expose-event handler. After that, I create cairo context and draw some lines and destroy the cairo. I return 'TRUE' as return value of callback function so that expose-event does not propagate.

Now my problem is, I am drawing line from (0,0) to (100,100). But line appears only over the border areas of the gtkentry. The place where text is, it does not appear.

Please help.

Kind Regards -Durgesh O Mishra

A: 

GtkEntry uses an additional GdkWindow for the text area. It is sort-of-private, but you could access it using the following code:

GDK_WINDOW (gdk_window_peek_children (GTK_WIDGET (entry)->window)->data);

So, you can pass this window to gdk_cairo_create().

If you have problems applying this to your code, paste the code — it's hard to guess what to do without having any way to test.

doublep
Awesome !! This resolved the problem. Many Many Thanks.
Durgesh