views:

30

answers:

1

Hi,

I want my notebook tab labels to be rotated by 90°.

I tried the set_angle() function of Gtk::Label but it doesn't work:

#include <gtkmm.h>

int main(int argc, char *argv[])
{
    Gtk::Main kit(argc, argv);

    Gtk::Window mainwindow;
    Gtk::Notebook sidebar;
    Gtk::Label tab;

    mainwindow.add(sidebar);

    sidebar.set_tab_pos(Gtk::POS_LEFT); 
    tab.set_angle(90);
    sidebar.append_page(tab, "text");

    sidebar.show();
    tab.show();

    Gtk::Main::run(mainwindow);

    return 0;
}
A: 

It seems you are adding the label as the child widget. You don't have a widget to be the page child in your code, but if you did and named it "child", you'd have something like this:

sidebar.set_tab_pos(Gtk::POS_LEFT); 
tab.set_angle(90);
tab.set_text("text"); 
sidebar.append_page(child, tab);
ergosys
Thank you very much, i was confused by a tutorial, which i didn't read thoroughly as it seems.
yajRs