[gtkmm] Need for Gtk::CellRendererEventBox ?



Bonjour,
I've been using custom CellRenderers with me own Gtk::CellEditable. It 
was very useful to be able to inherit from  Gtk::EventBox as well as 
from Gtk::CellEditable so that I could reuse (add()) existing widget.

I would very much like to do the same for the CellRenderer itself.
Right now, I know how to make a custom CellRenderer form scratch 
(cellrenderertoggle example) and how to make a custom cell renderer 
inheriting from CellRendererText. 
But I don't know how to make a custom CellRenderer containing widgets 
:-(
Maybe a CellRendererEventBox would be useful ? Can it be done in Gtkmm 
?
I'd be grateful for any hint !

Thank you very much in advance.

Bernard

PS: When the custom CellEditable requires cell resizing, I can resize 
before returning  the Gtk::CellEditable* from start_editing_vfunc but 
the newly displayed widget only take the previously avaible place :-(

PS2: to know the size needed for my custom CellEditable, I could only 
find this piece of code:
...
      CustomEditable* dummy= Gtk::manage(new 
CustomEditable(std::atof(oldText.c_str()), step_, ranges_.begin(), 
ranges_.end()));
      Gtk::Window tmp(Gtk::WINDOW_POPUP);
      tmp.add(*dummy);
      tmp.move(-500,-500); tmp.show_all();
      dummy->set_mode(mode_);
      GtkRequisition requisition = { 0, 0 };
      tmp.size_request(&requisition);
...

it is slow, and ugly. Is there a proper way to do it ?





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