Problem with CellRendererSpin and/or mapping Gtk::Adjustments



Hi,

I wanted to use CellRendererSpins in my TreeView, but it wasn't properly functioning. I'm using gtkmm 2.24.

The code was roughly:

Gtk::Adjustment parameterAdjustment(0, std::numeric_limits<float>::min(), std::numeric_limits<float>::max(), 1e-10, 1e-5);
Gtk::CellRendererSpin parameterRenderer;
Gtk::TreeViewColumn parameterColumn;

parameterColumn.set_title("Parameters");
parameterColumn.pack_start(parameterRenderer);

parameterRenderer.property_adjustment() = &parameterAdjustment;
parameterRenderer.property_editable() = true;
parameterRenderer.property_digits() = 18;

Using the above code, I could edit positive numbers without problems.
However, every negative number, when edited, was reset to 0.

I tried to fix this problem by creating a column for separate Gtk::Adjustments in my TreeModel, but simply adding a Gtk::TreeModelColumn<Gtk::Adjustment> doesn't compile.

I know that the simple answer for my last problem would be to just use gtkmm 3.0, but this isn't possible for me.

If you could help me setup the Adjustments right, I would be very grateful.

-- 
Best regards,
Rafał Hirsz


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