Re: [gtkmm] Widget* get_nth_page (int page_number) doesn't work here



On 09 Oct 2002 16:21:56 +0200
Bart Hakvoort <bart hakvoort castel nl> wrote:

> This seems only to work with Gtk::Widget, as im my example i like to get
> a pointer to a Gtk::Button, but then i get the following compile-error
> 
> Type 'Gtk::Button' is not an base type for type 'Gtk::Widget'
>

Gtk::Button *b = (Gtk::Button *)(days->get_nth_page(0));

or maybe a little more correct?

Gtk::Button *b = static_cast<Gtk::Button*>(days->get_nth_page(0));

Don't know if static_cast is the appropriate *_cast to use...

/Daniel
 
> Does anyone know how to solve this?
> 
> bart
> 
> 
> On Tue, 2002-10-08 at 21:51, Daniel wrote:
> > On 08 Oct 2002 21:15:52 +0200
> > Bart Hakvoort <bart hakvoort castel nl> wrote:
> > 
> > > it's a compile-error, i obviously so something wrong, but i don't know
> > > what.
> > > 
> > > I've a notebook "days" with a few pages in it, and each page contains
> > > only one Widget, a Button ( this is only a testsituation ), now i'll try
> > > to get a pointer to the button contained by the first page. See the
> > > statement below:
> > > 
> > > Gtk::Button *btn = days->pages().get_nth_page( 0 );
> > > 
> > 
> > I think you should use days->get_nth_page(0);
> > 
> > pages() is a PageList, days is the notebook which contains the method get_nth_page().
> > 
> > /Daniel
> > 
> > > And then i get my compile-error...
> > > 
> > > I'll hope this illustrates the problem
> > > 
> > > bart
> > > 
> > > On Tue, 2002-10-08 at 18:54, Daniel wrote:
> > > > On 08 Oct 2002 15:13:38 +0200
> > > > Bart Hakvoort <bart hakvoort castel nl> wrote:
> > > > 
> > > > > Hi, 
> > > > > Problem is clear i think, i've tried it with both al plain integer ( 0 )
> > > > > and with  get_current(), but it still won't work.
> > > > > 
> > > > What does not work? Compile-time or runtime errors?
> > > > 
> > > > > if someone needs some sample-code, just say it :)
> > > > > 
> > > > Yes, please give us some sample code illustrating the problem.
> > > > 
> > > > /Daniel
> > > > 
> > > > > bart
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > _______________________________________________
> > > > > gtkmm-list mailing list
> > > > > gtkmm-list gnome org
> > > > > http://mail.gnome.org/mailman/listinfo/gtkmm-list
> > > > > 
> > > > _______________________________________________
> > > > gtkmm-list mailing list
> > > > gtkmm-list gnome org
> > > > http://mail.gnome.org/mailman/listinfo/gtkmm-list
> > > 
> > > 
> > > 
> > _______________________________________________
> > gtkmm-list mailing list
> > gtkmm-list gnome org
> > http://mail.gnome.org/mailman/listinfo/gtkmm-list
> 
> 
> _______________________________________________
> 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]