[SOLVED]mouse problems after executing code.

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

[SOLVED]mouse problems after executing code.

Postby nwtmg » Aug 2nd, '17, 16:57

HI,

Attempting some python gtk coding. When I code the following lines

Code: Select all
#!/usr/bin/python3

import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk


my mouse cursor becomes a cross and I cannot get it to return to normal. I cannot select a menu item or click a button so I have to hard reboot. I am coding in geany. Any suggestions would be helpful.
Last edited by nwtmg on Aug 4th, '17, 17:21, edited 1 time in total.
nwtmg
 
Posts: 175
Joined: Jun 2nd, '15, 22:14

Re: mouse problems after executing code.

Postby doktor5000 » Aug 2nd, '17, 17:08

Could it be that you are following the tutorial https://python-gtk-3-tutorial.readthedo ... ction.html ?

Also, do you run that code directly within geany or outside in a terminal? And how did you install the respective python packages?
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18054
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: mouse problems after executing code.

Postby nwtmg » Aug 3rd, '17, 16:15

Hi,

That is the example I am running. I have run it from both the prompt and also geany. I only install my python packages from mageia drake. Am I missing specific packages? Thanks.
nwtmg
 
Posts: 175
Joined: Jun 2nd, '15, 22:14

Re: mouse problems after executing code.

Postby doktor5000 » Aug 3rd, '17, 18:31

Sorry, cannot tell as I don't know what packages you have installed :) But I've got to admit that I can't tell which packages you need, certainly quite a few python ones, then pygobject/gi-repository/gir and at least some gtk3 ones. You'd have to wait for somebody that is a bit more into current python/gtk to get a relevant comment on that.

But I can definitely tell that you only have half of the example program, you should probably add the rest and test again with that, as you are stopping before creating a window, and you don't close the program at the end.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18054
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: mouse problems after executing code.

Postby nwtmg » Aug 4th, '17, 17:21

Hi

Ran the full example from the prompt and got the following error

Code: Select all
bash: ./test.py: line 4: syntax error near unexpected token `'Gtk','
bash: ./test.py: line 4: `gi.require_version('Gtk', '3.0')'


full example

Code: Select all
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk

win = Gtk.Window()
win.connect("delete-event", Gtk.main_quit)
win.show_all()
Gtk.main()


Still returned the cross cursor. Typed ps -e at prompt and got an import in the returned list. Killed the import using kill -9 pid and that fixed the problem. I will mark this as solved.
nwtmg
 
Posts: 175
Joined: Jun 2nd, '15, 22:14


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest

cron