FromGTK Developers LIst: Row height sizes in GTK wigits with font changes

Owen Taylor (by way of richard terry ) (by way of richard terry ) wrote:

Can someone on the list who is technical decipher this. I posted to the GTK
developers list regarding the fonts/borders.

Richard

1)Anomaly in space taken by rows in list boxes with different font sizes.
in GTK as the font size decreases, the row size seems not to proportionally
decrease, leading to loss of valuable screen real estate. This is best
illustrated in the accompanying png file (font_creep_wxPtyhonLists.png)
where I have set roughly the same font in a listbox on wxPython(on the
left) and on QT designer (on the right). As you will see one can fit more
items in the qt list box compared to the GTK one, and quite a lot of line
space is left blank above the text in GTK.

From your screenshots, it looks like you are using GtkCList and the
obsolete X font backend to GTK+. It's really pretty hard for us to
give an answer for those circumstances - my best guess is that
for some reason GTK+ is using a fontset where some of the fonts aren't
available in small bitmap sizes.

They are saying that it looks like old technology GTK, which if you are using wxPythonGTK it is. That version uses gtk+-1.2.x. If you use wxPythonGTK2 then it is gtk+-2.2.x and uses all new tech for rendering the fonts and such. wxGTK2 is still not as rock solid as wxGTK but it should be close.

2)The second ongoing problem is that it seems not possible, despite the
flags present, to have borderless controls (not 3D) controls. Whilst this
may seem petty having a 3d border round the text boxes and sometimes other
controls can interfere in some cases with design, and again means
ultimately (I know this seems petty) less room on the screen, when space is
at a premium

You are going to have to be more specific here. As far as we know,
it's quite possible to have a GTK+ theme with 1 pixel or even 0
pixel borders, and for the theme to draw the borders however it likes.

As I said, it is normally up to the theme how the widget decorations are drawn.

And there is a specific call to make GtkEntry borderless without
any resort to the theming system.

GtkEntry is the wdiget that is used in wxGTK2 for single line wxTextCtrl. (A different "old tech" widget is used in wxGTK.) A quick look at the source shows that something is being done with the wxNO_BORDER flag in this case, but I havn't tried yet to see if it is the Right Thing.

···

On Fri, 2003-08-15 at 03:26, richard terry wrote:

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

I note the comments about gtk2. I downloaded the rpm I found (17July03) and it
has a dependency of libGlcore.so.1. Looking for this on rpmfind points to
nvidia stuff (and for for pldlinux and asplinux) so I'm not sure how to
progress.

Could anyone give me a pointer on how to install this on Mandrake 9.1 + Debian
(I have two separate boxes).

Thanks

Richard

···

On Sun, 17 Aug 2003 03:10 am, Robin Dunn wrote:

Owen Taylor (by way of richard terry ) (by way of richard terry ) wrote:
> Can someone on the list who is technical decipher this. I posted to the
> GTK developers list regarding the fonts/borders.
>
> Richard
>
> On Fri, 2003-08-15 at 03:26, richard terry wrote:
>>1)Anomaly in space taken by rows in list boxes with different font sizes.
>>in GTK as the font size decreases, the row size seems not to
>> proportionally decrease, leading to loss of valuable screen real estate.
>> This is best illustrated in the accompanying png file
>> (font_creep_wxPtyhonLists.png) where I have set roughly the same font in
>> a listbox on wxPython(on the left) and on QT designer (on the right). As
>> you will see one can fit more items in the qt list box compared to the
>> GTK one, and quite a lot of line space is left blank above the text in
>> GTK.
>
> From your screenshots, it looks like you are using GtkCList and the
> obsolete X font backend to GTK+. It's really pretty hard for us to
> give an answer for those circumstances - my best guess is that
> for some reason GTK+ is using a fontset where some of the fonts aren't
> available in small bitmap sizes.

They are saying that it looks like old technology GTK, which if you are
using wxPythonGTK it is. That version uses gtk+-1.2.x. If you use
wxPythonGTK2 then it is gtk+-2.2.x and uses all new tech for rendering
the fonts and such. wxGTK2 is still not as rock solid as wxGTK but it
should be close.

>>2)The second ongoing problem is that it seems not possible, despite the
>>flags present, to have borderless controls (not 3D) controls. Whilst this
>>may seem petty having a 3d border round the text boxes and sometimes
>> other controls can interfere in some cases with design, and again means
>> ultimately (I know this seems petty) less room on the screen, when space
>> is at a premium
>
> You are going to have to be more specific here. As far as we know,
> it's quite possible to have a GTK+ theme with 1 pixel or even 0
> pixel borders, and for the theme to draw the borders however it likes.

As I said, it is normally up to the theme how the widget decorations are
drawn.

> And there is a specific call to make GtkEntry borderless without
> any resort to the theming system.

GtkEntry is the wdiget that is used in wxGTK2 for single line
wxTextCtrl. (A different "old tech" widget is used in wxGTK.) A quick
look at the source shows that something is being done with the
wxNO_BORDER flag in this case, but I havn't tried yet to see if it is
the Right Thing.

AFAIK, libGlcore is simply one of the OpenGL libraries and is delivered
with XFree86. nVidia provides their own that is optimized for their
hardware. You should already have one on your system (provided OpenGL
works on your system). If you can run the 3D (OpenGL) screensavers then
you should be good to go.

Regards,

···

On Sun, 2003-08-17 at 00:19, richard terry wrote:

I note the comments about gtk2. I downloaded the rpm I found (17July03) and it
has a dependency of libGlcore.so.1. Looking for this on rpmfind points to
nvidia stuff (and for for pldlinux and asplinux) so I'm not sure how to
progress.

--
Cliff Wells, Software Engineer
Logiplex Corporation (www.logiplex.net)
(503) 978-6726 (800) 735-0555

As a follow on from the thread below I've a couple of questions.

1) Is wxGTK2 going to be used for wxPython at any time in the near future?
2) I've tried installing it and don't know where to go:

   - I compiled gtk+-2.2.2.tar.gz and it seemed to install ok
   - I installed wxGTK2.5-2.5.0-0.cvs20030319.6mdk.i586.rpm
   - if I install wxPythonGTK2-py2.2-2.4.1.2-1.i586.rpm I get failed
dependencies on libGlcore.so.1. The only source of this file I could find on
rpmfind was for distributions other than mandrake, and I already have an
nvidia card on my system with nvidia drivers installed.
   - If I try and compile the source rpm I get a message where it cant find
something called -1GLU

3) Assuming someone is able to help get me up and running with this, will the
wxPython demo then automatically use the gtk2?

Thanks

Richard Terry
gnuMed Project

···

On Sun, 17 Aug 2003 03:10 am, Robin Dunn wrote:

Owen Taylor (by way of richard terry ) (by way of richard terry ) wrote:
> Can someone on the list who is technical decipher this. I posted to the
> GTK developers list regarding the fonts/borders.
>
> Richard
>
> On Fri, 2003-08-15 at 03:26, richard terry wrote:
>>1)Anomaly in space taken by rows in list boxes with different font sizes.
>>in GTK as the font size decreases, the row size seems not to
>> proportionally decrease, leading to loss of valuable screen real estate.
>> This is best illustrated in the accompanying png file
>> (font_creep_wxPtyhonLists.png) where I have set roughly the same font in
>> a listbox on wxPython(on the left) and on QT designer (on the right). As
>> you will see one can fit more items in the qt list box compared to the
>> GTK one, and quite a lot of line space is left blank above the text in
>> GTK.
>
> From your screenshots, it looks like you are using GtkCList and the
> obsolete X font backend to GTK+. It's really pretty hard for us to
> give an answer for those circumstances - my best guess is that
> for some reason GTK+ is using a fontset where some of the fonts aren't
> available in small bitmap sizes.

They are saying that it looks like old technology GTK, which if you are
using wxPythonGTK it is. That version uses gtk+-1.2.x. If you use
wxPythonGTK2 then it is gtk+-2.2.x and uses all new tech for rendering
the fonts and such. wxGTK2 is still not as rock solid as wxGTK but it
should be close.

>>2)The second ongoing problem is that it seems not possible, despite the
>>flags present, to have borderless controls (not 3D) controls. Whilst this
>>may seem petty having a 3d border round the text boxes and sometimes
>> other controls can interfere in some cases with design, and again means
>> ultimately (I know this seems petty) less room on the screen, when space
>> is at a premium
>
> You are going to have to be more specific here. As far as we know,
> it's quite possible to have a GTK+ theme with 1 pixel or even 0
> pixel borders, and for the theme to draw the borders however it likes.

As I said, it is normally up to the theme how the widget decorations are
drawn.

> And there is a specific call to make GtkEntry borderless without
> any resort to the theming system.

GtkEntry is the wdiget that is used in wxGTK2 for single line
wxTextCtrl. (A different "old tech" widget is used in wxGTK.) A quick
look at the source shows that something is being done with the
wxNO_BORDER flag in this case, but I havn't tried yet to see if it is
the Right Thing.

richard terry wrote:

   - if I install wxPythonGTK2-py2.2-2.4.1.2-1.i586.rpm I get failed
dependencies on libGlcore.so.1. The only source of this file I could find on
rpmfind was for distributions other than mandrake, and I already have an
nvidia card on my system with nvidia drivers installed.

hmm. That's odd. I have libGLcore , and it came with the
NVIDIA_GLX-1.0-1541 rpm. HAve you searched your system for it? (check
/usr/lib/ )

with a quick web search, I found this:

http://lists.uugrn.org/uugrn/02/12/7971.html

which has a link to libGLCore rpm. Not reading German, I can't tell you
anything about the source!

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer
                                        
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

Yes, your right, it is on my system in /usr/lib!

Very frustrating this stuff. Wonder why it is not found.

Regards

Richard

···

On Tue, 19 Aug 2003 09:18 am, Chris Barker wrote:

richard terry wrote:
> - if I install wxPythonGTK2-py2.2-2.4.1.2-1.i586.rpm I get failed
> dependencies on libGlcore.so.1. The only source of this file I could find
> on rpmfind was for distributions other than mandrake, and I already have
> an nvidia card on my system with nvidia drivers installed.

hmm. That's odd. I have libGLcore , and it came with the
NVIDIA_GLX-1.0-1541 rpm. HAve you searched your system for it? (check
/usr/lib/ )

with a quick web search, I found this:

http://lists.uugrn.org/uugrn/02/12/7971.html

which has a link to libGLCore rpm. Not reading German, I can't tell you
anything about the source!

-Chris

I find myself doing 'slocate -u' fairly often and using 'slocate filename' as it seems the most reliable
way to get an answer but even it misses files at times for reasons I fail
to understand! :frowning:

HTH

MarkL

···

On Tue, 19 Aug 2003 10:31:24 +1000 richard terry <rterry@gnumed.net> wrote:

Yes, your right, it is on my system in /usr/lib!

Very frustrating this stuff. Wonder why it is not found.

As a follow on from the thread below I've a couple of questions.

1) Is wxGTK2 going to be used for wxPython at any time in the near future?

Yes, see below.

2) I've tried installing it and don't know where to go:

   - I compiled gtk+-2.2.2.tar.gz and it seemed to install ok

Why didn't you install this via rpm as well? You'll be prone to getting
failed dependencies as rpm won't know that it's installed.

   - I installed wxGTK2.5-2.5.0-0.cvs20030319.6mdk.i586.rpm
   - if I install wxPythonGTK2-py2.2-2.4.1.2-1.i586.rpm I get failed
dependencies on libGlcore.so.1. The only source of this file I could find on
rpmfind was for distributions other than mandrake, and I already have an
nvidia card on my system with nvidia drivers installed.
   - If I try and compile the source rpm I get a message where it cant find
something called -1GLU

You probably need the *-devel rpms as well (gtk2-devel, wxGTK-devel,
etc).

3) Assuming someone is able to help get me up and running with this, will the
wxPython demo then automatically use the gtk2?

You have to compile wxPython from source with the --with-gtk2 (IIRC)
flag to configure.

Cliff

···

On Mon, 2003-08-18 at 16:04, richard terry wrote:

--
I have seen too much, wipe away my eyes
                              -Bauhaus

Thanks Cliff

I used the tar.gz file because it was probably what I got off the gtk web
site. I'll try getting the wxPython source as you suggested and compile with
the --with-gtk2 flag and report back over the next day or two.

Thanks

Richard

···

On Tue, 19 Aug 2003 11:43 am, Cliff Wells wrote:

On Mon, 2003-08-18 at 16:04, richard terry wrote:
> As a follow on from the thread below I've a couple of questions.
>
> 1) Is wxGTK2 going to be used for wxPython at any time in the near
> future?

Yes, see below.

> 2) I've tried installing it and don't know where to go:
>
> - I compiled gtk+-2.2.2.tar.gz and it seemed to install ok

Why didn't you install this via rpm as well? You'll be prone to getting
failed dependencies as rpm won't know that it's installed.

> - I installed wxGTK2.5-2.5.0-0.cvs20030319.6mdk.i586.rpm
> - if I install wxPythonGTK2-py2.2-2.4.1.2-1.i586.rpm I get failed
> dependencies on libGlcore.so.1. The only source of this file I could find
> on rpmfind was for distributions other than mandrake, and I already have
> an nvidia card on my system with nvidia drivers installed.
> - If I try and compile the source rpm I get a message where it cant
> find something called -1GLU

You probably need the *-devel rpms as well (gtk2-devel, wxGTK-devel,
etc).

> 3) Assuming someone is able to help get me up and running with this, will
> the wxPython demo then automatically use the gtk2?

You have to compile wxPython from source with the --with-gtk2 (IIRC)
flag to configure.

Cliff

The exact instructions are in the README that comes with the source. I
built from (then) current CVS. Some of the instructions seem a little
off, but perseverence will pay off.

Good luck,

Cliff

···

On Mon, 2003-08-18 at 19:03, richard terry wrote:

Thanks Cliff

I used the tar.gz file because it was probably what I got off the gtk web
site. I'll try getting the wxPython source as you suggested and compile with
the --with-gtk2 flag and report back over the next day or two.

--
Pay your respects to the vultures, for they are your future
                                                     -Coil

richard terry wrote:

I note the comments about gtk2. I downloaded the rpm I found (17July03) and it has a dependency of libGlcore.so.1. Looking for this on rpmfind points to nvidia stuff (and for for pldlinux and asplinux) so I'm not sure how to progress.

Could anyone give me a pointer on how to install this on Mandrake 9.1 + Debian (I have two separate boxes).

The system I built the wxPythonGTK2 RPM on has the nvidia drivers installed and so RPM detected that dependency automatically. (Anybody know off the top of their head how to ignore an auto dependency when building the RPM?)

You may be able to install that RPM on the Mandrake system with --nodeps flag, otherwise you can get the .src.rpm and build your own binary RPM with "rpmbuild --rebuild wxPythonGTK2-*-src.rpm". Make sure you have the libgtk+2.0_0-devel installed to get the headers and such for gtk2. For Debian you'll have to get the wxPythonSrc tarball and build from scratch.

···

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

richard terry wrote:

As a follow on from the thread below I've a couple of questions.

1) Is wxGTK2 going to be used for wxPython at any time in the near future?
2) I've tried installing it and don't know where to go:

   - I compiled gtk+-2.2.2.tar.gz and it seemed to install ok

This should already be on your Mandrake 9.1 system, you just need to install the extra libgtk+2-devel RPM (or something like that.)

   - I installed wxGTK2.5-2.5.0-0.cvs20030319.6mdk.i586.rpm

This is not needed for building wxPythonGTK2 since the wxGTK sources are inlcuded. (And it would be the wrong version of wxGTK anyway since you are working with wxPython 2.4.1.2.)

   - if I install wxPythonGTK2-py2.2-2.4.1.2-1.i586.rpm I get failed dependencies on libGlcore.so.1. The only source of this file I could find on rpmfind was for distributions other than mandrake, and I already have an nvidia card on my system with nvidia drivers installed.

Probably because the NVidia files were not installed via an RPM, so the libGLcore is not known by RPM to be installed. Try installing the wxPythonGTK2 rpm with the --nodeps flag.

   - If I try and compile the source rpm I get a message where it cant find something called -1GLU

Do you have libMesaGLU1-devel and libMesaGLU1 packages installed? If so then there was a bug in wxWindows' configure that assumed that the GL and GLU libs are in the same place, but if you have the NVidia glx drivers installed then that is not true but I thought that had been fixed before the 2.4.1.2 version. If not then a simple workaround is to just make symlinks in /usr/lib to all the /usr/X11R6/lib/libGLU* files.

3) Assuming someone is able to help get me up and running with this, will the wxPython demo then automatically use the gtk2?

Yes.

···

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