[Vala] Gtk Notebook get tab label text



Hi all,
I've been working on my new tabbed text editor and I've got a Gtk.Notebook
with cusmom tabs, i.e. my tabs have a HBox with a Label and a close Button.
I'd like to be able to get the current selected tab Label text. I'm aware of
Notebook.get_tab_label and Notebook.get_tab_label_text but I'm not having
much success using those. I've tried "notebook.get_tab_label
(notebook.get_nth_page (notebook.get_current_page()));"

My tabs are created using this code wich is working, I just need the
currently selected tab label text:

        private Widget create_notebook_tab (string text)
        {
            this.h_box_notebook_tab_body = new HBox (false, 3);
            this.button_notebook_close = new Button ();
            this.button_notebook_close.set_relief (Gtk.ReliefStyle.NONE);
            this.image_button_notebook_close = new Image.from_stock
(Gtk.STOCK_CLOSE, Gtk.IconSize.MENU);
            this.button_notebook_close.add (image_button_notebook_close);
            this.button_notebook_close.set_size_request (22, 22);
            this.label_notebook = new Label (text);
            this.h_box_notebook_tab_body.pack_start (this.label_notebook,
true, true, 0);
            this.h_box_notebook_tab_body.pack_end
(this.button_notebook_close, true, true, 0);
            this.h_box_notebook_tab_body.show_all ();
            this.button_notebook_close.clicked.connect
(on_button_notebook_close_clicked);

            return h_box_notebook_tab_body;
        }


Best regards,
António Godinho


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