Skip to content

Port to GTK+ 3 #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
quozl opened this issue Apr 8, 2018 · 6 comments
Open

Port to GTK+ 3 #4

quozl opened this issue Apr 8, 2018 · 6 comments

Comments

@quozl
Copy link
Contributor

quozl commented Apr 8, 2018

No description provided.

@abhishektanwar
Copy link

abhishektanwar commented Jan 19, 2020

@quozl I want to contribute to this activity and port it to GTK +3

@quozl
Copy link
Contributor Author

quozl commented Jan 23, 2020

That's great, thanks.

@abhishektanwar
Copy link

@quozl I started to port this activity to GTK+3 ,when I ran it on my sugar desktop it didn't work and following errors were obtained in log file.

<type 'exceptions.ImportError'>
Python 2.7.17: /usr/bin/python
Thu Jan 23 04:13:18 2020

A problem occurred in a Python script. Here is the sequence of
function calls leading up to the error, in the order they occurred.

/usr/bin/sugar-activity in ()
215
216 if hasattr(instance, 'run_main_loop'):
217 instance.run_main_loop()
218
219 main()
main =

/usr/bin/sugar-activity in main()
161 class_name = splitted_module[1]
162
163 module = import(module_name)
164 for comp in module_name.split('.')[1:]:
165 module = getattr(module, comp)
module undefined
builtin__import__ =
module_name = 'arithmetic'

/usr/share/sugar/activities/Arithmetic.activity/arithmetic.py in ()
15
16 import logging
17 import gtk
18 import pango
19 import random
gtk undefined
<type 'exceptions.ImportError'>: No module named gtk
class = <type 'exceptions.ImportError'>
delattr = <method-wrapper 'delattr' of exceptions.ImportError object>
dict = {}
doc = "Import can't find module, or can't find name in module."
format =
getattribute = <method-wrapper 'getattribute' of exceptions.ImportError object>
getitem = <method-wrapper 'getitem' of exceptions.ImportError object>
getslice = <method-wrapper 'getslice' of exceptions.ImportError object>
hash = <method-wrapper 'hash' of exceptions.ImportError object>
init = <method-wrapper 'init' of exceptions.ImportError object>
new =
reduce =
reduce_ex =
repr = <method-wrapper 'repr' of exceptions.ImportError object>
setattr = <method-wrapper 'setattr' of exceptions.ImportError object>
setstate =
sizeof =
str = <method-wrapper 'str' of exceptions.ImportError object>
subclasshook =
unicode =
args = ('No module named gtk',)
message = 'No module named gtk'

The above is a description of an error in a Python program. Here is
the original traceback:

Traceback (most recent call last):
File "/usr/bin/sugar-activity", line 219, in
main()
File "/usr/bin/sugar-activity", line 163, in main
module = import(module_name)
File "/usr/share/sugar/activities/Arithmetic.activity/arithmetic.py", line 17, in
import gtk
ImportError: No module named gtk

Exited with status 1, pid 1675 data (<open file '', mode 'w' at 0x7f28d7dbc780>, 'e1df43f3e9571a85b2dc8b025ba334c83eff39ea')

This is my first time contributing to such a big organization and I cannot figure out how to approach these errors and move forward by making changes and getting the desired results.
Any input from you would be very valueable to me.
Thanks
arithmetic.txt

@chimosky
Copy link
Member

@abhishektanwar when porting, all occurences of import gtk become from gi.repository import Gtk.
See our GTK3 porting guide for the changes that need to be made.

@quozl
Copy link
Contributor Author

quozl commented Jan 23, 2020

You should also test it with GTK 2 first, so you know what it is meant to look like; otherwise it would by like flying an airplane with eyes closed.

@quozl
Copy link
Contributor Author

quozl commented Jan 29, 2020

Reference to a related mailing list thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants