Widget Background Color & Appearance (Minor Questions)

Running wxGTK2 here with wxPython. Is it possible to change the background
color of the widgets (frames, notebook pages, dialog boxes) from the default
grey?

   Also, where can I look for an explanation why the widgets have a 2D look
on one host and a 3D look on a different host when they're running the same
distribution versions?

Rich

···

--
Richard B. Shepard, Ph.D. | The Environmental Permitting
Applied Ecosystem Services, Inc. | Accelerator(TM)
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863

Rich Shepard wrote:

  Running wxGTK2 here with wxPython. Is it possible to change the background
color of the widgets (frames, notebook pages, dialog boxes) from the default
grey?

Yes, as long the current theme allows you to do so. Some don't, or some may allow some kinds of widgets to be changed, but not others.

  Also, where can I look for an explanation why the widgets have a 2D look
on one host and a 3D look on a different host when they're running the same
distribution versions?

They are probably set to use different GTK themes.

BTW, I've mentioned it before but I'll bring it up again here since it is on topic. I use the QtCurve theme for both GTK and KDE and have had quite good results with it. Very few theme-related oddities in wx apps, it looks very nice, is highly configurable, and allows KDE and GTK apps to look very similar.

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

···

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

Yes, as long the current theme allows you to do so. Some don't, or some may allow some kinds of widgets to be changed, but not others.

Robin,

   I've never paid attention to GTK themes except for jpilot. I'll go look up
how identify what's currently playing and how to change them.

BTW, I've mentioned it before but I'll bring it up again here since it is
on topic. I use the QtCurve theme for both GTK and KDE and have had quite
good results with it. Very few theme-related oddities in wx apps, it
looks very nice, is highly configurable, and allows KDE and GTK apps to
look very similar.

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

   Works for me. Thank you very much.

Rich

···

On Tue, 6 Feb 2007, Robin Dunn wrote:

--
Richard B. Shepard, Ph.D. | The Environmental Permitting
Applied Ecosystem Services, Inc. | Accelerator(TM)
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863

Just a very uninformed question: what is the purpose of using wxGTK with wxPython? I’ve only now just heard about GTK from this thread, read about it online a bit, but am not sure what it provides, basically how you use it, etc.

My interest would be having options for changing the default gray also. I’m using wxPython on winXP. Thanks.

···

On 2/6/07, Rich Shepard < rshepard@appl-ecosys.com> wrote:

On Tue, 6 Feb 2007, Robin Dunn wrote:

Yes, as long the current theme allows you to do so. Some don’t, or some may
allow some kinds of widgets to be changed, but not others.

Robin,

I’ve never paid attention to GTK themes except for jpilot. I’ll go look up

how identify what’s currently playing and how to change them.

BTW, I’ve mentioned it before but I’ll bring it up again here since it is
on topic. I use the QtCurve theme for both GTK and KDE and have had quite

good results with it. Very few theme-related oddities in wx apps, it
looks very nice, is highly configurable, and allows KDE and GTK apps to
look very similar.


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

Works for me. Thank you very much.

Rich


Richard B. Shepard, Ph.D. | The Environmental Permitting
Applied Ecosystem Services, Inc. | Accelerator™

<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863


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

C M wrote:

Just a very uninformed question: what is the purpose of using wxGTK with wxPython? I've only now just heard about GTK from this thread, read about it online a bit, but am not sure what it provides, basically how you use it, etc.

My interest would be having options for changing the default gray also. I'm using wxPython on winXP. Thanks.

wxGTK is primarily used for X11 (*nix) systems. In theory, you could use it on Windows, either by running an X-server in cygwin or something, or by using the windows version of GTK.

However, the point of wx is to use the native widgets on each platform -- GTK is native to *nix, but not to Windows.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (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

I'm trying to track down a memory leak. I put a debugging routine in
Python's gc
module and built python. This part seems to work fine, but when I try
to import wx
I get:

Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File
"c:\Programs\Python24b\lib\site-packages\wx-2.6-msw-unicode\wx\__init__.
py", line 42, in ?
    from wx._core import *
  File
"c:\Programs\Python24b\lib\site-packages\wx-2.6-msw-unicode\wx\_core.py"
, line 4, in ?
    import _core_
ImportError: No module named _core_

There's something about this build that won't seem to import .pyd files.
Not just
wx's _core_.pyd but any .pyd!

I built on Windows (XP) using the cygwin make and gcc.

Thanks,
Jeff Norton,
ActiveGrid

C M wrote:

Just a very uninformed question: what is the purpose of using wxGTK with wxPython? I've only now just heard about GTK from this thread, read about it online a bit, but am not sure what it provides, basically how you use it, etc.

wxGTK is just the short name for the "GTK port of wxWidgets" where GTK is one of the popular widget libraries for X-Windows based systems like Linux and the various other unix-like systems. On Windows the short name that is sometimes used for wxWidgets is wxMSW, and OS X is wxMac.

···

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

Jeff Norton wrote:

I'm trying to track down a memory leak. I put a debugging routine in
Python's gc
module and built python. This part seems to work fine, but when I try
to import wx
I get:

Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File
"c:\Programs\Python24b\lib\site-packages\wx-2.6-msw-unicode\wx\__init__.
py", line 42, in ?
    from wx._core import *
  File
"c:\Programs\Python24b\lib\site-packages\wx-2.6-msw-unicode\wx\_core.py"
, line 4, in ?
    import _core_
ImportError: No module named _core_

There's something about this build that won't seem to import .pyd files.
Not just
wx's _core_.pyd but any .pyd!

I built on Windows (XP) using the cygwin make and gcc.

I don't know if the cygwin build has this same "feature" but the typical debug version of Python on windows makes a python_d.exe and requires that all extension modules loaded also be debug builds (because of which C runtime DLLs are linked to) and so looks for them to have a *_d.pyd style name too.

···

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

Thanks for that idea.

I didn't actually do a debug build (and no python_d.exe was produced,
just
a python2.4.exe). But I tried copying the .pyd so it ended in _d.pyd
but
that didn't effect the results any. The reason I did the build was that
I added a method to the gc module to return the ob_refcnt for an object
as I suspected the ref count was off and I wanted to be able to check
it.

Is there a way to check this from pdb?

Doing a debug build and then debugging from C++ would be another
approach I guess.

The root of the problem however is that there is a memory leak. I
suspect
wxPython is involved. I do know that there are no references from any
Python objects (e.g. gc.get_referrers() returns an empty list).

Are there any ways that wxPython can hold onto python objects without
having a reference from a python object?

Thanks for any ideas.

···

-----Original Message-----
From: Robin Dunn [mailto:robin@alldunn.com]
Sent: Wednesday, February 07, 2007 6:03 PM
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] ImportError: No module named _core_

Jeff Norton wrote:
> I'm trying to track down a memory leak. I put a debugging
routine in
> Python's gc module and built python. This part seems to work fine,
> but when I try to import wx I get:
>
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> File
>
"c:\Programs\Python24b\lib\site-packages\wx-2.6-msw-unicode\wx
\__init__.
> py", line 42, in ?
> from wx._core import *
> File
>
"c:\Programs\Python24b\lib\site-packages\wx-2.6-msw-unicode\wx
\_core.py"
> , line 4, in ?
> import _core_
> ImportError: No module named _core_
>
> There's something about this build that won't seem to
import .pyd files.
> Not just
> wx's _core_.pyd but any .pyd!
>
> I built on Windows (XP) using the cygwin make and gcc.

I don't know if the cygwin build has this same "feature" but
the typical debug version of Python on windows makes a
python_d.exe and requires that all extension modules loaded
also be debug builds (because of which C runtime DLLs are
linked to) and so looks for them to have a *_d.pyd style name too.

Hi Jeff,

I'm trying to track down a memory leak. I put a debugging routine in
Python's gc
module and built python. This part seems to work fine, but when I try
to import wx
I get:

Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File
"c:\Programs\Python24b\lib\site-packages\wx-2.6-msw-unicode\wx\__init__.
py", line 42, in ?
    from wx._core import *
  File
"c:\Programs\Python24b\lib\site-packages\wx-2.6-msw-unicode\wx\_core.py"
, line 4, in ?
    import _core_
ImportError: No module named _core_

There's something about this build that won't seem to import .pyd files.
Not just
wx's _core_.pyd but any .pyd!

I built on Windows (XP) using the cygwin make and gcc.

Just for clarification, did you build both Python and wxPython using gcc?

Regards,

Kevin

···

On Feb 7, 2007, at 8:52 AM, Jeff Norton wrote:

Thanks,
Jeff Norton,
ActiveGrid

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

Hi Kevin,

I just built Python and then copied in all the libraries in
site-packages
in my old Python 2.4 installation into the new one. Do I need to build
wxPython as well?

Thanks,
Jeff.

···

-----Original Message-----
From: Kevin Ollivier [mailto:kevino@theolliviers.com]
Sent: Wednesday, February 07, 2007 10:33 PM
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] ImportError: No module named _core_

Hi Jeff,

On Feb 7, 2007, at 8:52 AM, Jeff Norton wrote:

> I'm trying to track down a memory leak. I put a debugging
routine in
> Python's gc module and built python. This part seems to work fine,
> but when I try to import wx I get:
>
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> File
> "c:\Programs\Python24b\lib\site-packages\wx-2.6-msw-unicode\wx
> \__init__.
> py", line 42, in ?
> from wx._core import *
> File
> "c:\Programs\Python24b\lib\site-packages\wx-2.6-msw-unicode\wx
> \_core.py"
> , line 4, in ?
> import _core_
> ImportError: No module named _core_
>
> There's something about this build that won't seem to import .pyd
> files.
> Not just
> wx's _core_.pyd but any .pyd!
>
> I built on Windows (XP) using the cygwin make and gcc.

Just for clarification, did you build both Python and
wxPython using gcc?

From what I understand of Python and its internals, you can really only
get satisfactory results if you compile Python, wxPython, etc., all
using the same compiler. I am quite certain that attempting to mix
cygwin gcc (your compilation) with VC (the precompiled wxPython) *will
not work*.

I don't know if there exists a proper cygwin backend for wx, but what
has worked for others in the past is the free (but difficult to find)
Visual Studio 2003 platform SDK (what the original Python 2.4 was
compiled with). If you switch to Python 2.5, you can use the visual
studio 2005 SDK, also freely available and much easier to find.

- Josiah

···

"Jeff Norton" <jnorton@activegrid.com> wrote:

> -----Original Message-----
> From: Kevin Ollivier [mailto:kevino@theolliviers.com]
> Sent: Wednesday, February 07, 2007 10:33 PM
> To: wxPython-users@lists.wxwidgets.org
> Subject: Re: [wxPython-users] ImportError: No module named _core_
>
> Hi Jeff,
>
> On Feb 7, 2007, at 8:52 AM, Jeff Norton wrote:
>
> > I'm trying to track down a memory leak. I put a debugging
> routine in
> > Python's gc module and built python. This part seems to work fine,
> > but when I try to import wx I get:
> >
> > Traceback (most recent call last):
> > File "<stdin>", line 1, in ?
> > File
> > "c:\Programs\Python24b\lib\site-packages\wx-2.6-msw-unicode\wx
> > \__init__.
> > py", line 42, in ?
> > from wx._core import *
> > File
> > "c:\Programs\Python24b\lib\site-packages\wx-2.6-msw-unicode\wx
> > \_core.py"
> > , line 4, in ?
> > import _core_
> > ImportError: No module named _core_
> >
> > There's something about this build that won't seem to import .pyd
> > files.
> > Not just
> > wx's _core_.pyd but any .pyd!
> >
> > I built on Windows (XP) using the cygwin make and gcc.
>
> Just for clarification, did you build both Python and
> wxPython using gcc?

Hi Kevin,

I just built Python and then copied in all the libraries in
site-packages
in my old Python 2.4 installation into the new one. Do I need to build
wxPython as well?

Josiah Carlson wrote:

I am quite certain that attempting to mix
cygwin gcc (your compilation) with VC (the precompiled wxPython) *will
not work*.

However, Mingw does work, though it takes some tweaking.

-Chris

If you switch to Python 2.5, you can use the visual
studio 2005 SDK, also freely available and much easier to find.

Ah! great news. For some reason I thought 2.5 also used the 2003 version.

thanks,
-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (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

Hi Jeff,

From: Kevin Ollivier [mailto:kevino@theolliviers.com]
Sent: Wednesday, February 07, 2007 10:33 PM
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] ImportError: No module named _core_

Hi Jeff,

I'm trying to track down a memory leak. I put a debugging

routine in

Python's gc module and built python. This part seems to work fine,
but when I try to import wx I get:

Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File
"c:\Programs\Python24b\lib\site-packages\wx-2.6-msw-unicode\wx
\__init__.
py", line 42, in ?
    from wx._core import *
  File
"c:\Programs\Python24b\lib\site-packages\wx-2.6-msw-unicode\wx
\_core.py"
, line 4, in ?
    import _core_
ImportError: No module named _core_

There's something about this build that won't seem to import .pyd
files.
Not just
wx's _core_.pyd but any .pyd!

I built on Windows (XP) using the cygwin make and gcc.

Just for clarification, did you build both Python and
wxPython using gcc?

Hi Kevin,

I just built Python and then copied in all the libraries in
site-packages
in my old Python 2.4 installation into the new one. Do I need to build
wxPython as well?

If you built Python using gcc, I think so, as a "stock" Windows Python 2.4 is built using Microsoft Visual Studio. In my Cygwin Python2.4, for example, I don't see any ".pyd" files, only ".dll" files - even though they are in fact Python extensions. (e.g. "_tkinter.pyd" shows up as "_tkinter.dll" in my Cygwin Python) Or, you might want to try renaming the files first and see if that works...

Regards,

Kevin

···

On Feb 8, 2007, at 6:45 AM, Jeff Norton wrote:

-----Original Message-----
On Feb 7, 2007, at 8:52 AM, Jeff Norton wrote:

Thanks,
Jeff.

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

Thanks,
Jeff.

From: Kevin Ollivier [mailto:kevino@theolliviers.com]
Sent: Thursday, February 08, 2007 11:18 AM
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] ImportError: No module named _core_

Hi Jeff,

>> From: Kevin Ollivier [mailto:kevino@theolliviers.com]
>> Sent: Wednesday, February 07, 2007 10:33 PM
>> To: wxPython-users@lists.wxwidgets.org
>> Subject: Re: [wxPython-users] ImportError: No module named _core_
>>
>> Hi Jeff,
>>
>>
>>> I'm trying to track down a memory leak. I put a debugging
>> routine in
>>> Python's gc module and built python. This part seems to
work fine,
>>> but when I try to import wx I get:
>>>
>>> Traceback (most recent call last):
>>> File "<stdin>", line 1, in ?
>>> File
>>> "c:\Programs\Python24b\lib\site-packages\wx-2.6-msw-unicode\wx
>>> \__init__.
>>> py", line 42, in ?
>>> from wx._core import *
>>> File
>>> "c:\Programs\Python24b\lib\site-packages\wx-2.6-msw-unicode\wx
>>> \_core.py"
>>> , line 4, in ?
>>> import _core_
>>> ImportError: No module named _core_
>>>
>>> There's something about this build that won't seem to import .pyd
>>> files.
>>> Not just
>>> wx's _core_.pyd but any .pyd!
>>>
>>> I built on Windows (XP) using the cygwin make and gcc.
>>
>> Just for clarification, did you build both Python and
wxPython using
>> gcc?
>
> Hi Kevin,
>
> I just built Python and then copied in all the libraries in
> site-packages in my old Python 2.4 installation into the
new one. Do
> I need to build wxPython as well?

If you built Python using gcc, I think so, as a "stock"
Windows Python 2.4 is built using Microsoft Visual Studio. In
my Cygwin Python2.4, for example, I don't see any ".pyd"
files, only ".dll"
files - even though they are in fact Python extensions. (e.g.
"_tkinter.pyd" shows up as "_tkinter.dll" in my Cygwin
Python) Or, you might want to try renaming the files first
and see if that works...

Regards,

Kevin

That was it! I tried renaming the .pyd to .dll and it now gets found.
Doesn't quite work as it then complains of a version mis-match, but now
I understand what is going on. I guess I can either build wx with gcc
or build Python with VC. I'll probably do the later as it seems closer
to what the mainstream is doing.

Thanks everyone (Kevin, Josiah, and Robin) with the help.

Now it's on to the real problem -- the blasted memory leak!

···

-----Original Message-----
On Feb 8, 2007, at 6:45 AM, Jeff Norton wrote:
>> -----Original Message-----
>> On Feb 7, 2007, at 8:52 AM, Jeff Norton wrote:

Jeff Norton wrote:

The reason I did the build was that
I added a method to the gc module to return the ob_refcnt for an object
as I suspected the ref count was off and I wanted to be able to check
it.

Is there a way to check this from pdb?

sys.getrefcount(obj)

Are there any ways that wxPython can hold onto python objects without having a reference from a python object?

Yes, there are a few places in the wxPython C++ that do hold references to Python objects. If you're able to narrow down the source of the problem do let me know about it.

···

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

Jeff Norton wrote:

I built on Windows (XP) using the cygwin make and gcc.

Just for clarification, did you build both Python and wxPython using gcc?

Hi Kevin,

I just built Python and then copied in all the libraries in
site-packages
in my old Python 2.4 installation into the new one. Do I need to build
wxPython as well?

I would expect so. There may be some ABI issues between compilers that you are running in to.

···

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

Christopher Barker wrote:

Josiah Carlson wrote:

I am quite certain that attempting to mix
cygwin gcc (your compilation) with VC (the precompiled wxPython) *will
not work*.

However, Mingw does work, though it takes some tweaking.

-Chris

If you switch to Python 2.5, you can use the visual
studio 2005 SDK, also freely available and much easier to find.

Ah! great news. For some reason I thought 2.5 also used the 2003 version.

It does, but there are also project files for VS2005 in the source tree.

···

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

Robin Dunn wrote:

Ah! great news. For some reason I thought 2.5 also used the 2003 version.

It does, but there are also project files for VS2005 in the source tree.

Darn. So to use VS2005, I'd need to re-build Python and all extensions?

Oh well, back to mingw.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (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

Or ask nicely and I'll send you the 32 meg VS 2003 platform SDK.
Coupled with VMWare or Parallels, and you don't even need to change your
current setup.

- Josiah

···

Christopher Barker <Chris.Barker@noaa.gov> wrote:

Robin Dunn wrote:
>> Ah! great news. For some reason I thought 2.5 also used the 2003 version.
>
> It does, but there are also project files for VS2005 in the source tree.

Darn. So to use VS2005, I'd need to re-build Python and all extensions?

Oh well, back to mingw.