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 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
>
>
___
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", "/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



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 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