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



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, Display/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 in our forum. Could anybody
please help explain a bit? Many thanks.
___
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



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, Display/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 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?

- You are not supposed to create top level menu entries
  just from the plug-in
- If you really need such it has to be added to the corresponding
  ui file first (integrate-ui.xml or display-ui.xml)
- The random text in the menu might be an artifact coming from your script.
  In my experiments I haven't seen such.


I couldn't find documentation on this topic in our forum.

 Could anybody please help explain a bit? Many thanks.
If you want help debugging your source it is generally a good idea to 
provide a minimal working example exhibiting the behavior you don't understand.


 Hans at Breuer dot Org ---
Tell me what you need, and I'll tell you how to
get along without it.-- Dilbert
___
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



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 h...@breuer.org wrote:

 At 29.06.2013 13:13, Bao Niu wrote:

 I tried this in my code:
 dia.register_callback(**ModKeys, Display/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 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?

 - You are not supposed to create top level menu entries
   just from the plug-in
 - If you really need such it has to be added to the corresponding
   ui file first (integrate-ui.xml or display-ui.xml)
 - The random text in the menu might be an artifact coming from your script.
   In my experiments I haven't seen such.


  I couldn't find documentation on this topic in our forum.

  Could anybody please help explain a bit? Many thanks.
 If you want help debugging your source it is generally a good idea to
 provide a minimal working example exhibiting the behavior you don't
 understand.

  Hans at Breuer dot Org ---
 Tell me what you need, and I'll tell you how to
 get along without it.-- Dilbert
 __**_
 dia-list mailing list
 dia-list@gnome.org
 https://mail.gnome.org/**mailman/listinfo/dia-listhttps://mail.gnome.org/mailman/listinfo/dia-list
 FAQ at http://live.gnome.org/Dia/Faq
 Main page at http://live.gnome.org/Dia


___
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



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,
simply can't find them. What should I do to import it?
___
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