Re: call python code from UI



Looks interesting.

The first change to py-func/plugin.xml.in introduces whitespace at the
start and end of the description.  That doesn't look right.

Why the changes to python-loader/python-loader.c?

M.


On Thu, Oct 17, 2013 at 12:14 PM, Anatoly Asviyan <aanatoly gmail com> wrote:
Hi
I've spent some time with gdb and fixed the problem. Now UI can call python
actions.
Hope  the patch is ok and could be commited. What do you think?

Changelog:
1. fix to 'ui' service,to start/stop in the same way as working 'function
group' service
2. UI example in py-func demo plugin. It adds 'Tools/Say hello' menu item
that prints 'hello' in A1 cell

Patch:
The patch against gnumeric-1.12.7 is here
http://sourceforge.net/p/fborg/code/HEAD/tree/gnumeric/py-ui-fix.patch


2013/10/11 Anatoly Asviyan <aanatoly gmail com>

Hi
I'm writing demo python plugin that adds  menu item to insert 'hello' into
A1  cell
The function to change a spreadsheat is ok (see below) but I can't make UI
to actually call it
and need help with that


Gnumeric version: 1.12.0
Plugin code: https://sourceforge.net/p/fborg/code/HEAD/tree/abc/
Details:
1. gnumeric's plugin manager shows new 'abc' plugin with 1 user interface
action
2. there is new 'Say hello' menu item under 'Tools' menu
3. running the action from python console works
4. running same action from menu does not (seems that it just isn't
called)

To run it from console
1. click on a 'say hello' menu item, that adds new interpreter
2. open python console, select 'abc' interpreter
3. run f_abc_action1(0,0) and see 'hello' in A1 cell


--
Regards, Anatoly




--
Regards, Anatoly

_______________________________________________
gnumeric-list mailing list
gnumeric-list gnome org
https://mail.gnome.org/mailman/listinfo/gnumeric-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]