[Gtk-sharp-list] Interface concept
Wed, 22 Oct 2003 02:35:23 -0400
On Wed, 2003-10-22 at 01:29, Leo Spalteholz wrote:
> Well I'm certainly not an expert but I would do it like this:
> Put an HBox in the main window.
> Pack a VBox into the Hbox
> Put all your buttons into this vbox..
> Pack another vbox into your Hbox. This vbox will be where you put your
> scrolledwindow and such.
> In your Clicked eventhandler for a button on the left, remove the right
> vbox from your hbox, (hbox.Remove(widgetToRemove)) and populate a new vbox
> with the widgets you want on the new screen. Then add this new vbox back
> to the hbox.
> So when you click the button it will change the contents on the right side.
> Which brings me to a minor point. If you remove a container like a vbox
> from another one, does the vbox and all child widgets get destroyed?
> My application switches between screens with many buttons quite often in
> this manner and I've noticed that memory usage of mono increases every
I am not an expert either but this is what I have found so far.
I figured out a way to split the application into to separate areas. I
used the concept of Panes. There are widgets available for both a
horizontal panes and vertical panes. I created a horizontal plane and
then used the left portion for my column of buttons and the right
portion for my scrolled window. However, I have not been able to figure
out how to dynamically display "services" in the scrolled portion.
On your point of deleting a vertical packing box and if the deleting
trickles down to all the child widgets the answer is yes. The packing
box is a container just like a window so any widgets within the
container are destroyed upon destruction of the container. What you
could possibly do instead of deleting and recreating a new vertical
packing box each time....maybe hide each of the widgets within the
packing box and then show them accordingly. Now I figure there has to
be a much easier way then this. I had thought of trying to do what you
are doing...but personally you are a better man than I because I would
not want to deal with the deletion and recreation. Maybe there is to
layer the "services" on the scrolled window or in your case packing box
like a stack where the "service" on the top of the stack is displayed.
Accordingly you can push and pop the stack of "services" based on the
actions of the user. Like I said I am no expert these are just
suggestions. Ill keep you informed if a find a way dynamically change
the window. If Evolution can do then it can be done.