change the GTK theme

Hi,
I'm developing an app that has to run under SUSE 10.2 KDE. The issue is the
default theme for GTK2 on SUSE10.2 looks terrible. Is there an easy way to
allow the user to change the theme for a wxPython program?

···

--
John Fabiani

There is a number of ways to do this, none of which really have anything to do with wxPython. Here's an easy one if you want to just change the theme for your program and not any other ones.

Before creating your wx.App do the following

#---- Code ----#

import os
os.environ['GTK2_RC_FILES'] = '/path/to/a/themes/gtkrc_file'

#---- End Code ----#

I believe GTK2 comes installed with the following themes by default but I could be wrong:

Clearlooks Default Industrial Raleigh ThinIce
Crux Emacs Mist Redmond

They are usually installed at the following path: /usr/local/share/themes/
Themes a user may have locally installed are in: ~/.themes/
So the path to the gtkrc file would be like this in most cases: /usr/local/share/themes/Clearlooks/gtk-2.0/gtkrc

This method of course will override any custom theme setting that a user may have already set in their ~/.gtkrc-2.0.mine file.

Regards,

Cody Precord

···

On Oct 10, 2007, at 7:30 PM, johnf wrote:

Hi,
I'm developing an app that has to run under SUSE 10.2 KDE. The issue is the
default theme for GTK2 on SUSE10.2 looks terrible. Is there an easy way to
allow the user to change the theme for a wxPython program?
--
John Fabiani

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

Thanks for the detail information. It will help. But your answer brings up
additional questions. On my SUSE 10.2 wx.Python is part of packages
named "wxGTK" and " python-wxGTK". The name implies that the SUSE version of
wxPython has some relation to GTK. I'm not sure what relation GTK has
because I know that wxPython is built on wxWidget. So would you take the
time to explain the GTK relationship.

Can I change the theme of my Dabo apps by changing the GTK theme? I ask
because so far changing the GTK "style" causes my apps to seg fault. I
qouted the word style because on SUSE 10.2 KDE personal settings app uses the
word "style" to change themes.

Your answers should help me understand what I need to do to compile 2.8.6.0
wxPython and get it installed.

Again thanks.

···

On Thursday 11 October 2007 00:30, Cody Precord wrote:

There is a number of ways to do this, none of which really have
anything to do with wxPython. Here's an easy one if you want to just
change the theme for your program and not any other ones.

Before creating your wx.App do the following

#---- Code ----#

import os
os.environ['GTK2_RC_FILES'] = '/path/to/a/themes/gtkrc_file'

#---- End Code ----#

I believe GTK2 comes installed with the following themes by default
but I could be wrong:

Clearlooks Default Industrial Raleigh ThinIce
Crux Emacs Mist Redmond

They are usually installed at the following path: /usr/local/share/
themes/
Themes a user may have locally installed are in: ~/.themes/
So the path to the gtkrc file would be like this in most cases: /usr/
local/share/themes/Clearlooks/gtk-2.0/gtkrc

This method of course will override any custom theme setting that a
user may have already set in their ~/.gtkrc-2.0.mine file.

Regards,

Cody Precord

--
John Fabiani

wxPython uses Gtk on Linux. It does not use KDE, so it will appear
like any other Gtk-based app when running KDE as your window manager.
It has nothing to do with SUSE or any distro packaging method.

···

On 10/11/07, johnf <jfabiani@yolo.com> wrote:

Thanks for the detail information. It will help. But your answer brings up
additional questions. On my SUSE 10.2 wx.Python is part of packages
named "wxGTK" and " python-wxGTK". The name implies that the SUSE version of
wxPython has some relation to GTK. I'm not sure what relation GTK has
because I know that wxPython is built on wxWidget. So would you take the
time to explain the GTK relationship.

--

# p.d.

Any thoughts on why changing my GTK theme would cause wxPython apps (including
wxPython demo.py) to seg fault?

···

On Thursday 11 October 2007 07:43, Peter Decker wrote:

wxPython uses Gtk on Linux. It does not use KDE, so it will appear
like any other Gtk-based app when running KDE as your window manager.
It has nothing to do with SUSE or any distro packaging method.

--
John Fabiani

No, I don't know anything about the internals of wx.

···

On 10/11/07, johnf <jfabiani@yolo.com> wrote:

On Thursday 11 October 2007 07:43, Peter Decker wrote:
> wxPython uses Gtk on Linux. It does not use KDE, so it will appear
> like any other Gtk-based app when running KDE as your window manager.
> It has nothing to do with SUSE or any distro packaging method.
Any thoughts on why changing my GTK theme would cause wxPython apps (including
wxPython demo.py) to seg fault?

--

# p.d.

johnf wrote:

wxPython uses Gtk on Linux. It does not use KDE, so it will appear
like any other Gtk-based app when running KDE as your window manager.
It has nothing to do with SUSE or any distro packaging method.

Any thoughts on why changing my GTK theme would cause wxPython apps (including wxPython demo.py) to seg fault?

Do all themes do it?

Some themes have their own theme engine and are more than just changing colors and textures. So it could be a manifestation of a bug in the theme engine if wx is telling them to do something they haven't been tested for. Another possibility is wx is linking to a different version of some library that the theme is also using, and they are stomping on each other in memory.

BTW, my favorite theme for both KDE and GTK is QtCurve. You'll probably have to build it yourself but it looks good, is highly configurable, works well with wx, and allows your KDE apps and GTK apps to look almost the same.

http://www.kde-look.org/content/show.php?content=40492

···

On Thursday 11 October 2007 07:43, Peter Decker wrote:

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

Do all themes do it?

Some themes have their own theme engine and are more than just changing
colors and textures. So it could be a manifestation of a bug in the
theme engine if wx is telling them to do something they haven't been
tested for. Another possibility is wx is linking to a different version
of some library that the theme is also using, and they are stomping on
each other in memory.

BTW, my favorite theme for both KDE and GTK is QtCurve. You'll probably
have to build it yourself but it looks good, is highly configurable,
works well with wx, and allows your KDE apps and GTK apps to look almost
the same.

http://www.kde-look.org/content/show.php?content=40492

As a default my SUSE 10.2 installed QtCurve and QT - both work. All the other
themes cause seg faults. So I'm stuck with only two choices for now.

···

--
John Fabiani