RE: [gtk-list] Scrolled windows and viewports



> Hi,

Hello,

> 
> Should a GtkCList be added to a GtkScrolledWindow using
> gtk_container_add() or gtk_scrolled_window_add_with_viewport()?

Use gtk_container_add(). Otherwise the CList title bar will scroll with list (something you do not want ;-).

> I think the answer is gtk_container_add() because gtk_clist_moveto()
> doesn't seem to work otherwise. The tutorial says to use
> gtk_scrolled_window_add_with_viewport() although the example is not
> using a compound list.
> 
> If I'm correct, what dictates how a child is added to a 
> scrolled window?

Normally you add a widget to a scrolled window with gtk_scrolled_window_add_with_viewport(). The CList however has a viewport of its own (don't blame me if I'm wrong, but that's what I thought it was). Anyway, using a viewport will let all the contents scroll while, in case of a CList, you do not want that.



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