Re: Collapse-able Console (solution#1)
| From: | Paul Zirkle | Date: | Sun, 07 Sep 2003 05:50:39 +0000 |
| Subject: | Re: Collapse-able Console (solution#1) | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-3820@lists.php.net to get a copy of this message | ||
I figured it out.. (for posterity sake, I shall record my findings though
you all probably already know this simple stuff)
The key is when adding the main_window and console_area boxes to their
parent Hbox.
You should use HBox->pack_start() instead of ->add() so that you can
specify whether the objects should resize.
By setting main_window to pack_start($main_window, true, true) and
console_area as pack_start($console_area, false, true),
I specify that the main window will resize in the console's absence, but
that the console will have a fixed width when visible.
I tried using add($console_area) but apparently this wasnt even showing up
at all, because main_window was being added as pack_start($main_window).
Lesson learned: add all children with EITHER add() OR pack_*() ... dont mix
them.
-Paul Zirkle AKA Keless
----- Original Message -----
From: "Paul Zirkle" <keless@skyesurfer.net>
To: <php-gtk-general@lists.php.net>
Sent: Saturday, September 06, 2003 8:38 PM
Subject: [PHP-GTK] Collapse-able Console
> Hello all,
>
> Im new to the mailing list. (and possibly to mailing lists in general, so
> please excuse any NewB mistakes)
> Here is my first question:
>
> I am creating a PHP-Gtk GameEngine. I am setting up code that will be easy
> to reuse for different games of the same type (RPG) simply by changing
> external dialog/map/item/image data.
>
> Anyhow, currently I am trying to set up the main window. I want a logging
> console (im using GtkText) to appear on the right side when toggled on,
and
> to dissapear when not toggled. This is how I have my window set up right
> now:
>
> VBox ->
> HBox-> (toolbar stuff)
> GtkToggleButton (toggle console visibility)
> HBox-> (all non-toolbar stuff)
> HBox-> (main window area)
> GtkLayout (game screen)
> VBox-> (console_area)
> GtkText (console output)
>
>
> When you click the toggle button, the console_area (the VBox) toggles
> between visible and not visible.
> The problem is that its sharing space with the main_window area such that
> both take up 50% of the width of the window whether the console_area is
'on'
> or not. What I _want_ is for the main_window area to take up the full
width
> of the window when the console_area is hidden.
>
> Any suggestions?
>
> -Paul Zirkle AKA Keless
>
> --
> PHP-GTK General Mailing List (http://gtk.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>