Re: Accessing children on Gtk::Notebook
- From: gig-raf <dbrandt db-cc de>
- To: gtkmm-list gnome org
- Subject: Re: Accessing children on Gtk::Notebook
- Date: Fri, 27 Jan 2012 05:02:19 -0800 (PST)
Murray Cumming-5 wrote:
>
> On Thu, 2012-01-26 at 06:24 -0800, gig-raf wrote:
>> void exampleWindow::on_button_modifyTabContent()
>> {
>> // I want to access the "elements" on the notebook.page. But how
>> do I do
>> that?
>> //Gtk::Widget* pTest =
>> m_Notebook.get_nth_page(m_Notebook.get_current_page());
>>
>> .....
>> }
>
> This should work fine. Maybe you are confused that you get a
> Gtk::Widget* back rather than the Gtk::VBox* that you added. You should
> use dynamic_cast<> to get a Gtk::VBox*. Do use an if() to check it for
> null before using it.
>>
>
> Hi Michael, thanks for helping out...
>
> Sorry for asking but could perhaps show me how this should be done. Assume
> I have Just one Gtk::Label on the notebook.page()[1]. I want to change the
> text of that label on the first page.
>
> ...
> Gtk::Widget* pWidget = m_Notebook.pages()[1].get_child();
> Gtk::Label* pLabel = dynamic_cast<Gtk::Label*> (pWidget);
>
> pLabel.set_text("fofo");
> ....
>
> Is this possible? or will I HAVE to pot all my widgets inside a VBox or
> similar container prior putting it in my notebook tab?
>
>>
> --
> Murray Cumming
> murrayc murrayc com
> www.murrayc.com
> www.openismus.com
>
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
>
>
--
View this message in context: http://old.nabble.com/Accessing-children-on-Gtk%3A%3ANotebook-tp33207725p33213898.html
Sent from the Gtkmm mailing list archive at Nabble.com.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]