maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   Pygtk weird behavior; no buttons/labels background, just text. (https://talk.maemo.org/showthread.php?t=42159)

cpscotti 2010-01-25 14:46

Pygtk weird behavior; no buttons/labels background, just text.
 
Today I just realized that all python applications (in my n900) that use pygtk, (e.g. pygtkeditor, n900fly, accdisplay.. ) are with their themes screwed up.


Menu of pygtkeditor, note the absence of the bg
http://static.pixelpipe.com/c9928a2a...c75c5d6c_m.jpg

Trying to search something in pygtkeditor
http://static.pixelpipe.com/37ee29ec...a100b9dd_m.jpg
(if you enter text, you can see the auto-complete text but not the already entered chars)

To get it even weirder, all normal apps (non-pygtk) are ok. e.g:
Xterm menu:
http://static.pixelpipe.com/875b255d...a3e5cb6b_m.jpg

I already tried removing python-gtk (which removed all this "affected" apps) and installing again to no avail..

python-gtk2 and everything else is from extras (AFAIK).
Maybe related: I installed "Reflect Theme"..

This issue MAY be related to this thread but since what I'm experiencing is way worse and more global I'm creating this new thread

Anyone knows any pygtk - specific confs (something like .pygtk)?
Anyone has any clue?

Thanks in advance!

cpscotti 2010-07-01 21:05

Re: Pygtk weird behavior; no buttons/labels background, just text.
 
SO.. just to put some heat on this..
I already changed my FW numerous times. Each time Ireset the firmware, everything goes back into normal.. and then.. suddenly.. as if "from nowhere".. this behavior restarts..

Anyone?

daperl 2010-07-01 22:12

Re: Pygtk weird behavior; no buttons/labels background, just text.
 
1 Attachment(s)
Quote:

Originally Posted by cpscotti (Post 737846)
SO.. just to put some heat on this..
I already changed my FW numerous times. Each time Ireset the firmware, everything goes back into normal.. and then.. suddenly.. as if "from nowhere".. this behavior restarts..

Anyone?

No promises, but I do know a few things about these types of issues and I might be able to help.

Let's start with one of the built-in themes. For the purpose of this conversation, can you please switch to the Digital Nature Theme.

You talk about the Reflect Theme in your previous post, but it looks like the images are from the Digital Nature Theme (hildon-theme-beta). Is that correct?

I'm running PR 1.2 and I just installed pygtkeditor and set my theme to Digital Nature. Here's a screenshot that doesn't look like yours.

Attachment 11691

I have to get going at the moment, but I'll tell you about Fremantle themed buttons when I get back. That is actually a different issue. In the meantime, please post the output of the following:

Code:

ls -l /usr/share/themes/beta

cpscotti 2010-07-02 11:52

Re: Pygtk weird behavior; no buttons/labels background, just text.
 
1 Attachment(s)
So.. the output from the ls is:
Code:

Nokia-N900-51-1:~# ls -l /usr/share/themes/beta/
drwxr-xr-x    2 root    root        4096 Jan  2  2009 backgrounds
drwxr-xr-x    2 root    root        4096 Jan  2  2009 calendar
drwxr-xr-x    2 root    root        4096 Jan  2  2009 call-ui
-rw-r--r--    1 root    root          838 Feb 17 09:41 colors.config
drwxr-xr-x    2 root    root        4096 Jan  2  2009 css
drwxr-xr-x    2 root    root        4096 Jan  2  2009 gtk-2.0
drwxr-xr-x    2 root    root        69632 Jan  2  2009 images
-rw-r--r--    1 root    root          274 Feb 17 09:41 index.theme
drwxr-xr-x    2 root    root        4096 Jan  2  2009 matchbox
drwxr-xr-x    2 root    root        4096 Jan  2  2009 matchbox2
drwxr-xr-x    2 root    root        4096 Jan  2  2009 mediaplayer
drwxr-xr-x    2 root    root        4096 Jan  2  2009 rtcom-messaging-ui
drwxr-xr-x    2 root    root        4096 Jan  2  2009 startup-wizard

And the screenshot from pygtkeditor using the digital nature theme is attached.

The funny thing is that, as far as I know, only pygtk are affected.

daperl 2010-07-02 14:17

Re: Pygtk weird behavior; no buttons/labels background, just text.
 
Quote:

Originally Posted by cpscotti (Post 738475)
The funny thing is that, as far as I know, only pygtk are affected.

Yeah, that's strange. Let's see how yours differs from my output of the following:

Code:

dpkg -l | grep -i python
Code:

ii  python                                              2.5.2-3maemo3                    An interactive high-level object-oriented language (defaul
ii  python-cairo                                        1.4.12-1.2maemo1                Python bindings for the Cairo vector graphics library
ii  python-central                                      0.6.11.1maemo2                  register and build utility for Python packages
ii  python-dbus                                        0.83.0-1maemo3                  simple interprocess messaging system (Python interface)
ii  python-gconf                                        2.26.1-1maemo1                  Python bindings for the GConf configuration database syste
ii  python-gobject                                      2.16.1-1maemo1                  Python bindings for the GObject library
ii  python-gst0.10                                      0.10.14-2maemo5                  generic media-playing framework (Python bindings)
ii  python-gtk2                                        2.12.1-6maemo10                  Python bindings for the GTK+ widget set
ii  python-hildon                                      0.9.0-1maemo15                  Python bindings for Hildon Framework.
ii  python-hildondesktop                                0.1.0-1maemo3                    Python bindings for libhildondesktop
ii  python-minimal                                      2.5.2-3maemo3                    A minimal subset of the Python language (default version)
ii  python-notify                                      0.1.1-2maemo1                    Python bindings for libnotify
ii  python-numeric                                      24.2-9maemo4                    Numerical (matrix-oriented) Mathematics for Python
ii  python-numpy                                        1:1.4.0-1maemo2                  Numerical Python adds a fast array facility to the Python
ii  python-osso                                        0.4-0maemo2                      Python bindings for libosso library
ii  python-support                                      1.0.6maemo1                      automated rebuilding support for Python modules
ii  python-xml                                          0.8.4-10.1maemo4                XML tools for Python
ii  python2.5                                          2.5.4-1maemo5                    An interactive high-level object-oriented language (versio
ii  python2.5-minimal                                  2.5.4-1maemo5                    A minimal subset of the Python language (version 2.5)

I get no error or warning messages when I run pygtkeditor from the command line. Why not give that a try. And don't forget to bring up the menu.

cpscotti 2010-07-02 16:45

Re: Pygtk weird behavior; no buttons/labels background, just text.
 
Ok, first the output from the dpkg on python pkgs:
Code:

Nokia-N900-51-1:~# dpkg -l | grep -i python
ii  hildon-desktop-python-loader                        0.1.0-1maemo3                              Hildon Desktop Python Plugin Loader
ii  python                                              2.5.2-3maemo3                              An interactive high-level object-oriented language (default version)
ii  python-cairo                                        1.4.12-1.2maemo2                          Python bindings for the Cairo vector graphics library
ii  python-central                                      0.6.11.1maemo2                            register and build utility for Python packages
ii  python-dbus                                        0.83.0-1maemo3                            simple interprocess messaging system (Python interface)
ii  python-gconf                                        2.26.1-1maemo1                            Python bindings for the GConf configuration database system
ii  python-gobject                                      2.16.1-1maemo1                            Python bindings for the GObject library
ii  python-gst0.10                                      0.10.14-2maemo5                            generic media-playing framework (Python bindings)
ii  python-gtk2                                        2.12.1-6maemo10                            Python bindings for the GTK+ widget set
ii  python-hildon                                      0.9.0-1maemo16                            Python bindings for Hildon Framework.
ii  python-hildondesktop                                0.1.0-1maemo3                              Python bindings for libhildondesktop
ii  python-minimal                                      2.5.2-3maemo3                              A minimal subset of the Python language (default version)
ii  python-notify                                      0.1.1-2maemo1                              Python bindings for libnotify
ii  python-numeric                                      24.2-9maemo4                              Numerical (matrix-oriented) Mathematics for Python
ii  python-osso                                        0.4-0maemo4                                Python bindings for libosso library
ii  python-pycurl                                      7.18.2-1maemo1                            Python bindings to libcurl
ii  python-simplejson                                  2.0.9-1maemo1                              Simple, fast, extensible JSON encoder/decoder for Python
ii  python-support                                      1.0.6maemo1                                automated rebuilding support for Python modules
ii  python-twitter                                      0.6-maemo1                                A pure python interface for the Twitter API.
ii  python-xml                                          0.8.4-10.1maemo4                          XML tools for Python
ii  python2.5                                          2.5.4-1maemo6                              An interactive high-level object-oriented language (version 2.5)
ii  python2.5-minimal                                  2.5.4-1maemo6                              A minimal subset of the Python language (version 2.5)
ii  python2.5-qt4-common                                4.7.3-maemo5                              Shared files for PyQt4
ii  python2.5-qt4-core                                  4.7.3-maemo5                              Python bindings for Qt4 Core components.
ii  python2.5-qt4-gui                                  4.7.3-maemo5                              Python bindings for Qt4 Core components.
ii  python2.5-sip4                                      4.10.2-maemo0                              Python/C++ bindings generator runtime library.

Running pygtkeditor on terminal I get no error msgs.. nothing. (Neither when I open a menu).
Also, same thing (no warnings nor erros for other pygtk apps..)
The apps I see the same behavior are accDisplay and n900fly.
Do you have an idea on any other python apps I should try in order to "track down" the problem?

daperl 2010-07-02 17:11

Re: Pygtk weird behavior; no buttons/labels background, just text.
 
I don't have

hildon-desktop-python-loader

Maybe try uninstalling that and rebooting. Also, you have a different (newer?)

python-osso

than I do. But I'd start with hildon-desktop-python-loader.

cpscotti 2010-07-02 17:19

Re: Pygtk weird behavior; no buttons/labels background, just text.
 
1 Attachment(s)
Now looking at the difference between the two package listings, odd things I can see are:
Code:

ii  hildon-desktop-python-loader                        0.1.0-1maemo3                              Hildon Desktop Python Plugin Loader
ii  python2.5-qt4-common                                4.7.3-maemo5                              Shared files for PyQt4
ii  python2.5-qt4-core                                  4.7.3-maemo5                              Python bindings for Qt4 Core components.
ii  python2.5-qt4-gui                                  4.7.3-maemo5                              Python bindings for Qt4 Core components.
ii  python2.5-sip4                                      4.10.2-maemo0                              Python/C++ bindings generator runtime library.

I just found something interesting on this. After noting that the recaller app is also in python but didn't suffer from this problem, I took part of its code and made a small "test" (attached) which worked ok. I'll try to figure out which is the difference in the coming hours.

daperl 2010-07-02 17:39

Re: Pygtk weird behavior; no buttons/labels background, just text.
 
1 Attachment(s)
I think all you've done is found the button theme thing I was suppose to fill you in on. Your test program might need menu items to be helpful. Try this one:

cpscotti 2010-07-02 17:42

Re: Pygtk weird behavior; no buttons/labels background, just text.
 
Ok, I just found out some really funny thing..
Both my apps and pygtkeditor use a shell script like:
Code:

#!/bin/sh
exec python /opt/accDisplay/accDisplay.py

to launch the program. This scripts is stored under /usr/bin/.
Launching the app (both from the desktop links or the terminal) will call this scripts and then call the app itself.

I just tried running the exact same app but bypassing this script:
Code:

~ $ python /opt/pygtkeditor/pygtkeditor.py
And.. voila.. it works. What's the difference?

(EDIT: woops.. wait some more)

daperl 2010-07-02 17:58

Re: Pygtk weird behavior; no buttons/labels background, just text.
 
Like I said, maybe hildon-desktop-python-loader is the problem. It might not be setting up the environment right. Try changing the line in

/usr/share/applications/hildon/pygtkeditor.desktop

from
Code:

Exec=/usr/bin/pygtkeditor
to
Code:

Exec=/usr/bin/run-standalone.sh /usr/bin/pygtkeditor
and see what happens.

daperl 2010-07-02 18:07

Re: Pygtk weird behavior; no buttons/labels background, just text.
 
Woops, that might not explain your first command line problem.

I'll take a look at hildon-desktop-python-loader anyway.

cpscotti 2010-07-02 18:10

Re: Pygtk weird behavior; no buttons/labels background, just text.
 
Quote:

Originally Posted by daperl (Post 738805)
I think all you've done is found the button theme thing I was suppose to fill you in on. Your test program might need menu items to be helpful. Try this one:

That example works correctly too.
But I tried putting it on /opt/ and making a "bypass" script on /usr/bin/ and again.. it didn't work.

daperl 2010-07-02 18:38

Re: Pygtk weird behavior; no buttons/labels background, just text.
 
What's the output of

Code:

which python

cpscotti 2010-07-02 18:45

Re: Pygtk weird behavior; no buttons/labels background, just text.
 
Quote:

Originally Posted by daperl (Post 738871)
What's the output of

Code:

which python

output is the expected:
Code:

/usr/bin/python

cpscotti 2010-07-02 18:50

Re: Pygtk weird behavior; no buttons/labels background, just text.
 
by the way, the "run-standalone.sh" attempt didn't work as well...
Also, i removed hildon-desktop-python-loader and this didn't change much.

daperl 2010-07-02 19:14

Re: Pygtk weird behavior; no buttons/labels background, just text.
 
I know this might defeat the purpose, but I'm guessing changing the Exec line in

/usr/share/applications/hildon/pygtkeditor.desktop

to
Code:

Exec=/usr/bin/python /opt/pygtkeditor/pygtkeditor.py
should work.

Or you could do what I do and soft link like this

Code:

ln -s /usr/bin/pygtkeditor /opt/pygtkeditor/pygtkeditor.py
and then put

/usr/share/applications/hildon/pygtkeditor.desktop

back to the original.

That's all I can think of for now, sorry.

cpscotti 2010-07-02 19:24

Re: Pygtk weird behavior; no buttons/labels background, just text.
 
Yep.. quite weird anyway... but that works.. (linking the desktop file directly to the python file).
Anyway.. this solves my problem but I would still like to know if this affects more people.. then I would at least submit fixes for the apps.

Anyway, thanks daperl!

daperl 2010-07-02 19:26

Re: Pygtk weird behavior; no buttons/labels background, just text.
 
Woops, I think the soft link was backwards.

Code:

rm /usr/bin/pygtkeditor
ln -s /opt/pygtkeditor/pygtkeditor.py /usr/bin/pygtkeditor


Hwoarang 2010-12-10 16:19

Re: Pygtk weird behavior; no buttons/labels background, just text.
 
I have the same problem as well. No matter what theme/firmware to use, the results are always the same

I do noticed that replacing /usr/bin/env python with /usr/bin/python fixes the problem for each application. However you need to make the same change every time you update the specific application

I already opened a bug months ago

https://bugs.maemo.org/show_bug.cgi?id=11242

Hwoarang 2011-02-08 19:56

Re: Pygtk weird behavior; no buttons/labels background, just text.
 
Did you make any progress with that? Can you please tell me which applications you have installed? Maybe there a stupid application that messes up everything. I have already flashed my FW more than 10 times and I always get the same problem on 2-3 reboot

davide 2011-02-09 15:02

Re: Pygtk weird behavior; no buttons/labels background, just text.
 
wander why... "settings" button doesn't work any more. when I tap it, it does nothing!!!
Since I use pygtkeditor from shell with a text file as argument, I noticed this code in the shell:

Code:

python
Error in sys.excepthook:
Traceback (most recent call last):
File "/home/opt/pygtkeditor/pge_report.py", line 23, in my_excepthook
formatted_text = "%s Version %s\nTrace : %s\nComments : " (str(APP_NAME), str(APP_VERSION), s)
TypeError: 'str' object is not callable

Original exception was:
Traceback (most recent call last):
File "/home/opt/pygtkeditor/pge_window.py", line 492, in menu_button_clicked
prefs.edit(self)
File "/home/opt/pygtkeditor/pge_preferences.py", line 100, in edit
w_font.set_active(font_names.index(self.prefs_dict['font_name']))
ValueError: list.index(x): x not in list

any idea on how to restore the "setting" button functionality.
Thanks, a lot.


All times are GMT. The time now is 00:46.

vBulletin® Version 3.8.8