Re: implementing a collapsable/expandable widget



On 9/27/06, Reed Hedges <reed mobilerobots com> wrote:
Neil Roberts wrote:
> On Tue, Sep 26, 2006 at 05:33:07PM +0200, Michael 'Mickey' Lauer wrote:
>
>> Hi, for one project I need to implement a widget container that can
>> be collapsed/expanded to show its containment.
>
> Have you looked at GtkExpander? That's what it basically does. You can
> see a demo of it in the gtk-demo program.

GtkExpander does have a little control (an arrow) associated with it that
normally the user would click to expand the expander. Not sure if you want that.

Generally speaking if you want some container to automatically apear when
selecting a list item, you can either use the expander and connect the signal
for list item selected (don't remember what it is) directly to the expander (or
to a function which calls a function on the expander to expand it), or, if
you're not using GtkExpander, accept that signal and just
show/hide/insert/create/whatever your new widget.

Reed

It seems like a job for a GtkTreeView with customized cell renderers.
The stuff that expands out is rendered using the custom renderer,
while the heading  ("Call Joy" in the mockup) is a regular text-based
renderer. The treeview built-in functionality should automatically
support expanding a particular cell when the user clicks the expansion
arrow.



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