Custom Widget Problem



Hi all,
I'm trying to write a custom widget, and i'm facing the following problem.

In the custom widget, on_expose_event virtual function, i'm drawing the widget.
Where i've to paint shadow.
So i've used this
=========
Gdk::Color c ;
c.set_rgb_p (1.0, 0.75, 0.75) ;
modify_bg (Gtk::STATE_NORMAL, c) ;

int x =  get_allocation().get_x() ;
int y =  get_allocation().get_y() ;
int w = get_allocation().get_width() ;
int h =  get_allocation().get_height() ;
get_style()->paint_shadow (m_refGdkWindow, get_state(), Gtk::SHADOW_IN, get_allocation(), *this, "temp", x, y, w, h) ;
=========
Please see the attached image gtkmm1.png
I expect the colored portion will be filled up by the shadow. But not

then i changed the function call to some thing like this.
get_style()->paint_shadow(m_refGdkWindow, get_state(), Gtk::SHADOW_IN, get_allocation(), *this, "temp", 0, 0, w, h) ;
Even then i did not get what i expected (gtkmm2.png).

what am i doing wrong here.
Ideally i want the colored portion should be filled up by shadow. what is the best way to do.

Thx in advance,
Surya
Surya Kiran Gullapalli
Sr. Development Engineer
Fluent India Pvt. Ltd.,
Pune

Attachment: gtkmm1.png
Description: Binary data

Attachment: gtkmm2.png
Description: Binary data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]