creating a custom button in GTK--



Hi,

A newbie question here: I'd like to create a custom button in GTK--. I subclassed Gtk::Bin, which would contain the only child, shown inside the button. I can draw the border of my button in the overrideen on_expose_event() function. But what I can't do is to influence where the child widget is drawn when calling Bin::on_expose_event() from within the overriden on_expose_event().

I tried to override on_size_allocate, calculate the space available for the child widget there (which is the size of my button, minus the size of the borders which display it as a button). and then call get_child()->size_allocate() with the calculated size - but this does not have the desired effect.


Akos



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