GTK screen real-estate with trees, lists, etc.

The other day Richard Terry mentioned Lists on GTK waste a lot of
space. Trees also exhibit this problem -- trees are nice and compact
on windows, but the borders around the text items on GTK is huge,
regardless of how small you make the font.

Any ideas on how to reduce this wasted space on GTK?

I couldn't find a way to change this through the wx interface, so as a
last resort I did some poking around with the GTK theme engine. Blah!
What a nightmare. The included .gtkrc-2.0 makes an attempt to adjust
some parameters, and about the only success I did have was adjusting
the border around toolbar images using

  GtkWidget ::focus_padding = 0
  GtkWidget ::focus_width = 0
  GtkWidget ::focus_line_width = 0
  GtkWidget ::spacing = 0

I found some gtkrc docs here:

http://svn.gnome.org/viewcvs/gtk%2B/trunk/docs/widget_geometry.txt?rev=10683&view=markup

that show the following ascii art for trees (hopefully you're using a
fixed width font to see this):

.gtkrc-2.0 (4.43 KB)

···

+-------------------------------------------+

                   A |
+---------------------------------------+ |
>##################E####################| |
>#+-----------------------------------+#| |
>#| F |#| |
>#| +---------+---------------------+ |#| |
>#| | C | | |#| |
>#| | +-----+ | | |#| |
A>E>F>C> BxB |C| label_widget |F|E|A|
>#| | +-----+ | | |#| |
>#| | C | | |#| |
>#| +---------+---------------------+ |#| |
>#| F |#| |
>#+-----------------------------------+#| |
>##################E####################| |
+---------------------------------------+ |
                   A |

+-------------------------------------------+

A: GtkContainer::border_width
B: GtkExpander::expander_size
C: GtkExpander::expander_spacing
E: GtkWidget::focus_line_width
F: GtkWidget::focus_padding

But, I couldn't figure out how to get the .gtkrc-2.0 to change the
focus_padding which seems to be the culprit. Any ideas?

Rob

Hi Rob,

The other day Richard Terry mentioned Lists on GTK waste a lot of
space. Trees also exhibit this problem -- trees are nice and compact
on windows, but the borders around the text items on GTK is huge,
regardless of how small you make the font.

Any ideas on how to reduce this wasted space on GTK?

Knowing nothing about GTK, the only suggestion I can give is: use
CustomTreeCtrl and hack it as much as you like until it has the
shape/spacing/fonts/colours you want.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.virgilio.it/infinity77/

Rob McMullen wrote:

The other day Richard Terry mentioned Lists on GTK waste a lot of
space. Trees also exhibit this problem -- trees are nice and compact
on windows, but the borders around the text items on GTK is huge,
regardless of how small you make the font.

Any ideas on how to reduce this wasted space on GTK?

I couldn't find a way to change this through the wx interface, so as a
last resort I did some poking around with the GTK theme engine. Blah!
What a nightmare. The included .gtkrc-2.0 makes an attempt to adjust
some parameters, and about the only success I did have was adjusting
the border around toolbar images using

Currently the wxTreeCtrl used on wxGTK is not the native tree widget, so messing with the gtk settings will have no effect on it other than things like the default font chosen, or the default colors.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Same with the mvc tree.

However I got into the code of the TreeLayout class and reduced one of the
multiplication factors from 2 to 1.5 and now my lines sit really nicely
together!!!

richard

···

On Wednesday 31 January 2007 23:28, Andrea Gavana wrote:

Hi Rob,

> The other day Richard Terry mentioned Lists on GTK waste a lot of
> space. Trees also exhibit this problem -- trees are nice and compact
> on windows, but the borders around the text items on GTK is huge,
> regardless of how small you make the font.
>
> Any ideas on how to reduce this wasted space on GTK?

Knowing nothing about GTK, the only suggestion I can give is: use
CustomTreeCtrl and hack it as much as you like until it has the
shape/spacing/fonts/colours you want.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.virgilio.it/infinity77/

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Ah. Well, that would explain the lack of results fiddling with the
gtkrc. Good, I didn't want to devote any space in my brain for gtk
theming anyway. :slight_smile: Seriously though, I was totally fooled -- it looks
just like the wxGTK version, so props to the wxwidgets person who
coded it up.

Andrea, thanks for the pointer to the CustomTreeCtrl. Nice work. It
definitely results in a much more compact display on linux.

Thanks,

Rob

···

On 1/31/07, Robin Dunn <robin@alldunn.com> wrote:

Currently the wxTreeCtrl used on wxGTK is not the native tree widget, so
messing with the gtk settings will have no effect on it other than
things like the default font chosen, or the default colors.