How to import other modules from my own code?

2013-06-29 Thread Bao Niu
I wanted to import dia_rotate.py from my own code. I wrote this as the beginning of my code: import dia import dia_rotate class ModKeys: .. dia_rotate.py is located in Home/.dia/python . The code doesn't work. If I try importing from the python console, it simply gives me an ImportError

Re: How to deal with menupath in dia.register_callback()

2013-06-29 Thread Bao Niu
Thanks Hans. Got the basic idea now. On Sat, Jun 29, 2013 at 5:36 AM, Hans Breuer wrote: > At 29.06.2013 13:13, Bao Niu wrote: > >> I tried this in my code: >> dia.register_callback("**ModKeys", "/Database/ModKeys", >> mod_keys()) >> >> There is one obvious bug in your code: you are supposed t

Re: How to deal with menupath in dia.register_callback()

2013-06-29 Thread Hans Breuer
At 29.06.2013 13:13, Bao Niu wrote: I tried this in my code: dia.register_callback("ModKeys", "/Database/ModKeys", mod_keys()) There is one obvious bug in your code: you are supposed to pass the function as paramter to register_callback, not the return value of your function. I was expectin

How to deal with menupath in dia.register_callback()

2013-06-29 Thread Bao Niu
I tried this in my code: dia.register_callback("ModKeys", "/Database/ModKeys", mod_keys()) I was expecting that there would be a new menu called "Database" showing up in the top, but instead it is "ModKeys=>Activate", what is the logic of menupath here? I couldn't find documentation on this topic

tply me

2013-06-29 Thread Ravikumar Patil
hi ___ dia-list mailing list dia-list@gnome.org https://mail.gnome.org/mailman/listinfo/dia-list FAQ at http://live.gnome.org/Dia/Faq Main page at http://live.gnome.org/Dia