I would like to know if it's possible to modify the options of the context menu when there is an element selected. I would like to add a new custom option. I would like to know the way to do it.
As far as I'm aware you'll have to change the source and recompile, dont think the menus.xml stuff touches the context menu. The main code for it is in src\ui\context-menu.cpp Adding extra item related ones is pretty straight forward, just add another block like this to sp_item_menu:
/* Do something custom */ w = gtk_menu_item_new_with_mnemonic(_("_Do Something")); gtk_object_set_data(GTK_OBJECT(w), "desktop", desktop); gtk_signal_connect(GTK_OBJECT(w), "activate", GTK_SIGNAL_FUNC(sp_item_do_some_stuff), item); gtk_widget_show(w); gtk_menu_append(GTK_MENU(m), w);
then create the funtion sp_item_do_some_stuff that does whatever. just add its declaration to the list above sp_item_menu ie
static void sp_item_do_some_stuff(GtkMenuItem *menuitem, SPItem *item);
Hope that helps
Sim
On 12/20/07, PilarPP <ppalominos@...155...> wrote:
I would like to know if it's possible to modify the options of the context menu when there is an element selected. I would like to add a new custom option. I would like to know the way to do it. -- View this message in context: http://www.nabble.com/modify-context-menu-tp14434682p14434682.html Sent from the Inkscape - User mailing list archive at Nabble.com.
SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
Thank you John, But I have another question, I change the source of context-menu.cpp, but How can I compile to use the changes o How build a dll?
Thank you for your help.
Pilar.
john cliff-2 wrote:
As far as I'm aware you'll have to change the source and recompile, dont think the menus.xml stuff touches the context menu. The main code for it is in src\ui\context-menu.cpp Adding extra item related ones is pretty straight forward, just add another block like this to sp_item_menu:
/* Do something custom */ w = gtk_menu_item_new_with_mnemonic(_("_Do Something")); gtk_object_set_data(GTK_OBJECT(w), "desktop", desktop); gtk_signal_connect(GTK_OBJECT(w), "activate", GTK_SIGNAL_FUNC(sp_item_do_some_stuff), item); gtk_widget_show(w); gtk_menu_append(GTK_MENU(m), w);
then create the funtion sp_item_do_some_stuff that does whatever. just add its declaration to the list above sp_item_menu ie
static void sp_item_do_some_stuff(GtkMenuItem *menuitem, SPItem *item);
Hope that helps
Sim
On 12/20/07, PilarPP <ppalominos@...155...> wrote:
I would like to know if it's possible to modify the options of the context menu when there is an element selected. I would like to add a new custom option. I would like to know the way to do it. -- View this message in context: http://www.nabble.com/modify-context-menu-tp14434682p14434682.html Sent from the Inkscape - User mailing list archive at Nabble.com.
SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
you'll need to recompile inkscape itself with the changes. How to do that is
described here:
http://wiki.inkscape.org/wiki/index.php/CompilingInkscape
and is dependant upon the platform your on. from the fact you mention dlls I'm guessing win, in which case you want to follow the instructions here: http://wiki.inkscape.org/wiki/index.php/Win32Port
If you get stuck at all the jabber/IRC chat room is a good place to ask
Cheers
John
On 12/21/07, PilarPP <ppalominos@...155...> wrote:
Thank you John, But I have another question, I change the source of context-menu.cpp, but How can I compile to use the changes o How build a dll?
Thank you for your help.
Pilar.
john cliff-2 wrote:
As far as I'm aware you'll have to change the source and recompile, dont think the menus.xml stuff touches the context menu. The main code for it is in src\ui\context-menu.cpp Adding extra item related ones is pretty straight forward, just add another block like this to sp_item_menu:
/* Do something custom */ w = gtk_menu_item_new_with_mnemonic(_("_Do Something")); gtk_object_set_data(GTK_OBJECT(w), "desktop", desktop); gtk_signal_connect(GTK_OBJECT(w), "activate", GTK_SIGNAL_FUNC(sp_item_do_some_stuff), item); gtk_widget_show(w); gtk_menu_append(GTK_MENU(m), w);
then create the funtion sp_item_do_some_stuff that does whatever. just add its declaration to the list above sp_item_menu ie
static void sp_item_do_some_stuff(GtkMenuItem *menuitem, SPItem *item);
Hope that helps
Sim
On 12/20/07, PilarPP <ppalominos@...155...> wrote:
I would like to know if it's possible to modify the options of the context menu when there is an element selected. I would like to add a new custom option. I would like to know the way
to
do it. -- View this message in context: http://www.nabble.com/modify-context-menu-tp14434682p14434682.html Sent from the Inkscape - User mailing list archive at Nabble.com.
SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
-- View this message in context: http://www.nabble.com/modify-context-menu-tp14434682p14452410.html Sent from the Inkscape - User mailing list archive at Nabble.com.
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
Hello, I am modifying Inkscape source code, in order to add a new option in context menu, but I have a problem because there are many classes and it's difficult to understand the whole functionality from all of them.... To the point: I've developed several extensions in python (.inx and .py files) to draw custom elements. But I would like to add the functionality to modify these elements in a easy way. Then whenever someone selects one of them and clicks the right button, shows up the contex menu with an option to modify the properties of the curernt element. So I don't know wheter there is any function to show the same dialog of the extensions with the elements properties I have selected or I must code new dialogs in c++ through gtk.
Furthermore, I wonder how to get the element's attributes when I have it selected:
if (sp_destop_selection(desktop)->isEmpty()) { sp_desktop_selection(desktop)->set(item); }
Thanks for your help,
Pilar.
john cliff-2 wrote:
you'll need to recompile inkscape itself with the changes. How to do that is
described here:
http://wiki.inkscape.org/wiki/index.php/CompilingInkscape
and is dependant upon the platform your on. from the fact you mention dlls I'm guessing win, in which case you want to follow the instructions here: http://wiki.inkscape.org/wiki/index.php/Win32Port
If you get stuck at all the jabber/IRC chat room is a good place to ask
Cheers
John
On 12/21/07, PilarPP <ppalominos@...155...> wrote:
Thank you John, But I have another question, I change the source of context-menu.cpp, but How can I compile to use the changes o How build a dll?
Thank you for your help.
Pilar.
john cliff-2 wrote:
As far as I'm aware you'll have to change the source and recompile,
dont
think the menus.xml stuff touches the context menu. The main code for
it
is in src\ui\context-menu.cpp Adding extra item related ones is pretty straight forward, just add another block like this to sp_item_menu:
/* Do something custom */ w = gtk_menu_item_new_with_mnemonic(_("_Do Something")); gtk_object_set_data(GTK_OBJECT(w), "desktop", desktop); gtk_signal_connect(GTK_OBJECT(w), "activate", GTK_SIGNAL_FUNC(sp_item_do_some_stuff), item); gtk_widget_show(w); gtk_menu_append(GTK_MENU(m), w);
then create the funtion sp_item_do_some_stuff that does whatever. just add its declaration to the list above sp_item_menu ie
static void sp_item_do_some_stuff(GtkMenuItem *menuitem, SPItem *item);
Hope that helps
Sim
On 12/20/07, PilarPP <ppalominos@...155...> wrote:
I would like to know if it's possible to modify the options of the context menu when there is an element selected. I would like to add a new custom option. I would like to know the way
to
do it. -- View this message in context: http://www.nabble.com/modify-context-menu-tp14434682p14434682.html Sent from the Inkscape - User mailing list archive at Nabble.com.
SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
-- View this message in context: http://www.nabble.com/modify-context-menu-tp14434682p14452410.html Sent from the Inkscape - User mailing list archive at Nabble.com.
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
On Feb 5, 2008 7:40 AM, PilarPP <ppalominos@...155...> wrote:
the right button, shows up the contex menu with an option to modify the properties of the curernt element. So I don't know wheter there is any function to show the same dialog of the extensions with the elements properties I have selected or I must code new dialogs in c++ through gtk.
Nope, I think you need to code that.
Furthermore, I wonder how to get the element's attributes when I have it selected:
The way to get to the attrs is to first get the repr of the item and from that, take repr->attribute(name).
participants (3)
-
bulia byak
-
john cliff
-
PilarPP