Search code examples
gtkgtkmm

gtk (or gtkmm) 3 widen scrollbar for embedded (touchscreen) use


Since I'm using gtk3 and gtkmm3 on embedded I would like to have the scrollbar of a scrolledwindow wider. I tried many ways but couldn't find a working solution. Particularly I had a partial result with the following lines of code:

Gtk::Scrollbar *p_tableScrollbar = mp_scrolledwindowTable->get_vscrollbar();
p_tableScrollbar->set_size_request(50, -1);

but while the frame of the scrollbar becomes bigger, the slider remains narrow and part of the scrollbar area.

Then I tried the CSS way with the code:

Glib::RefPtr<Gtk::CssProvider> r_cssProvider = Gtk::CssProvider::create();
r_cssProvider->load_from_data("* {\n -GtkRange-slider-width: 50;\n }\n");

but still no result. If anybody knows how to obtain the result please help.


Solution

  • It's gtk not gtkmm but here you go.

    http://www.gtkforums.com/viewtopic.php?f=3&t=988&p=195381#p195381