Re: [gtk-list] Re: GtkCTree.... again



On Thu, Oct 07, 1999 at 10:36:18AM +0000, Andy Connor wrote:

> Getting there, slowly... but a few more questions.
> 
> Firstly, the return of the function gtk_ctree_new() is GtkWidget* rather
> than GtkCTree* - so do I have to get around this with typecasting?

Yes. As a general rule all official Gtk+ widgets return GtkWidget pointers,
so it pays to have all your intial declarations like that. Otherwise, you
must type cast.

> Secondly, If I want to display the Ctree in a scrolled window, I would
> try to use the function gtk_scrolled_window_add_with_viewport() but
> again run into problems with type. Is this the right function to use? 

No. GtkCTree, (like CtkCList and GtkText) is a widget with it's own
scrolling capabilities, so you only need to use gtk_container_add() to add
the widget to a GtkScrolledWindow. The _with_viewport() part is only for
non-scrollable widgets.

> PS When I've struggled my way through this then I will make the
> resulting code available to anyone else having problems.

You may also want to suggest the questions you've made to the authors of the
FAQ or gtk+ tutorial.

Regards,

-- 
Lee.
http://atlas.cs.york.ac.uk/~lrpm100/



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