Re: [gtkmm] pb when checking notebook pages ...



Hi!


thanks for your new response, but the booleans are not sufficient and i d like to avoid using a list... the ideal would be a way to access the text of the notebook's tab label!

here is my NoteBookLabel class



----------------------------------------------------


class NoteBookLabel : public Gtk::HBox

{

Gtk::Label label; //contains the text of the tab label

Gtk::Button b; //the button to click on for closing the notebook page

Gtk::Image *image; //the little cross which is in the above button


Formularies *form_ptr; //the widget that is the "body" of the notebook page

//Formularies is one of my classes and is a Gtk::VBox


void NoteBookLabel::on_close_clicked( ); //close the notebook page when one clicks one the button b


}


----------------------------------------------------


when i append a page into my notebook, i do:


notebook.append(a_formulary, a_notebooklabel);


----------------------------------------------------


so my goal is to access to "label". i used get_tab_label and others things by i never successed :-[

if there are no way to do it i ll resign to use a list of open pages :'( or i let it like that :x



best regards,

cedric


PS : I saw you come from Belgium , so , DO YOU SPEAK FRENCH ? ;o)



B.Hakvoort a écrit :

hmmz, after rereading your mail i think i misunderstood you.
Sorry for that ;-)

Bart

On Mon, 2004-08-23 at 17:42, B.Hakvoort wrote:
Hi Cedric,

Why don't you use signal_switch_page()? this way your callback is only
called when someone switched to another page.

Maybe this is what you're looking for?

Bart

On Mon, 2004-08-23 at 17:37, cedric wrote:
Hello!

I ve a question about Gtk::NotebookS :
i have created a Notebook in which the tabs (the things to click on to go to a given page of the Notebook) are instances of my NoteBookLabel class (it s a HBox): i ve made this to have a little cross in the tab to close the corresponding notebook page. it works fine. now i would like to check the open pages before opening a new one, to avoid to open several times the same page. in my opinion, the only way available to know it is to check the notebook's labels and look if they have the same one that the page that we want to open (maybe there are others way of comparison?). if the page is already open, i would like this page to be the current one. i would like to avoid managing a list of all the open pages because it would be a bit VERY fastidious... so i ve tried to use the get_tab_label and get_tab_label_text methods without any success, since i didn t managed to access to the Gtk::Label of my NoteBookLabel class (i guess it s normal). The Notebbok's method return *Gtk::Widget that i don t manage to turn in my classe's type (NoteBookLabel). So for now i really don t know how to do to verify if a page is already open or not! Maybe (and surely) i m not using the good way but i don t see any other :-[

thanks for your help!
best regards,
cedric

_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list




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