How to include examples in an Extension?
Hi all,
I'm currently working on an expansion of the L-System Extension (just for fun, getting to know XML and Python). I implemented an extra parameter "Factor", such that the fractal scales with each level. More info about this at the Inkscape Forums: http://www.inkscapeforum.com/viewtopic.php?f=5&t=6411
The thing is, I would like to include some examples in the extension. I thought of a drop-down menu (an "enum" type), with entries like "Koch Snowflake" and "Pythagoras Tree".
|<param name="Examples" type="enum" _gui-text="Examples:"> <item value="Koch_Snowflake">Koch Snowflake</item> <item value="Pythagoras_Tree">Pythagoras Tree</item> </param>|
When the user clicks on such an entry, appropriate values should be assigned to the fields (e.g. Axiom="F", Rules="F=F+F+F", Factor="0.5", etc.). I wondered whether this is possible using XML, or the Relax NG schema language?
So to be clear, the GUI-part isn't a problem. The UI looks like this at the moment: http://www.redpanda.nl/ExamplesInkscape.png However, the "auto-assign" function needs to be implemented yet.
Thanks, Pieter
Hi,
I wondered whether you guys agree with me that examples could be useful in some extensions? With most extensions, you can create the desired result by trial-and-error (using the Live Preview function). However, other extensions aren't really self-explanatory (like the Lindenmayer System extension). Although there is a description how it can be used, most users won't understand what you can create with the extension. Therefore, I proposed to implement a list of examples (or a tab "Examples").
I would like to implement it myself, but I don't know where to start. I found some documentation about the INX files: http://wiki.inkscape.org/wiki/index.php/MakingAnINX Maybe with a <script> environment, it would be possible to automatically assign appropriate values to the fields?
Regards, Pieter
On 10/27/2010 06:12 PM, Pieter Barendrecht wrote:
Hi all,
I'm currently working on an expansion of the L-System Extension (just for fun, getting to know XML and Python). I implemented an extra parameter "Factor", such that the fractal scales with each level. More info about this at the Inkscape Forums: http://www.inkscapeforum.com/viewtopic.php?f=5&t=6411
The thing is, I would like to include some examples in the extension. I thought of a drop-down menu (an "enum" type), with entries like "Koch Snowflake" and "Pythagoras Tree".
|<param name="Examples" type="enum" _gui-text="Examples:"> <item value="Koch_Snowflake">Koch Snowflake</item> <item value="Pythagoras_Tree">Pythagoras Tree</item>
</param>|
When the user clicks on such an entry, appropriate values should be assigned to the fields (e.g. Axiom="F", Rules="F=F+F+F", Factor="0.5", etc.). I wondered whether this is possible using XML, or the Relax NG schema language?
So to be clear, the GUI-part isn't a problem. The UI looks like this at the moment: http://www.redpanda.nl/ExamplesInkscape.png However, the "auto-assign" function needs to be implemented yet.
Thanks, Pieter
Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps& games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev
Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Hi Pieter,
Your request is a special case of "a more interactive extension dialog". I think that is a important feature and you may consider to integrate Autoglade to inkscape as a default module to extensions that need a more inteligent dialog. http://autoglade.sourceforge.net
But that will be really more cool if the Autoglade idea was implemented inside the inkscape and the INX may point to a partial glade file to build the fields area with more flexibility to the developer and some automation inside the dialog.
Aurium
On Tue, Nov 16, 2010 at 10:31 AM, Pieter Barendrecht <pieter@...2481...> wrote:
Hi,
I wondered whether you guys agree with me that examples could be useful in some extensions? With most extensions, you can create the desired result by trial-and-error (using the Live Preview function). However, other extensions aren't really self-explanatory (like the Lindenmayer System extension). Although there is a description how it can be used, most users won't understand what you can create with the extension. Therefore, I proposed to implement a list of examples (or a tab "Examples").
I would like to implement it myself, but I don't know where to start. I found some documentation about the INX files: http://wiki.inkscape.org/wiki/index.php/MakingAnINX Maybe with a <script> environment, it would be possible to automatically assign appropriate values to the fields?
Regards, Pieter
On 10/27/2010 06:12 PM, Pieter Barendrecht wrote:
Hi all,
I'm currently working on an expansion of the L-System Extension (just for fun, getting to know XML and Python). I implemented an extra parameter "Factor", such that the fractal scales with each level. More info about this at the Inkscape Forums: http://www.inkscapeforum.com/viewtopic.php?f=5&t=6411
The thing is, I would like to include some examples in the extension. I thought of a drop-down menu (an "enum" type), with entries like "Koch Snowflake" and "Pythagoras Tree".
<param name="Examples" type="enum" _gui-text="Examples:"> <item value="Koch_Snowflake">Koch Snowflake</item> <item value="Pythagoras_Tree">Pythagoras Tree</item> </param>
When the user clicks on such an entry, appropriate values should be assigned to the fields (e.g. Axiom="F", Rules="F=F+F+F", Factor="0.5", etc.). I wondered whether this is possible using XML, or the Relax NG schema language?
So to be clear, the GUI-part isn't a problem. The UI looks like this at the moment: http://www.redpanda.nl/ExamplesInkscape.png However, the "auto-assign" function needs to be implemented yet.
Thanks, Pieter
Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev
Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today http://p.sf.net/sfu/msIE9-sfdev2dev _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Hi Aurium,
Thanks for your support. I tried to install Autoglade (on Ubuntu 10.04), however the Package Installer complains about "Dependency is not satisfiable: python-xml". I found on Google that this package may be unstable and is obsolete, and therefore removed from the repo. I didn't have time yet to look into the source how to fix this.
Back to the original question. If I understand correctly, it is not possible to create an interactive dialog using the RelaxNG schema language (used for the xml in the INX files)?
Pieter
On 11/16/2010 05:01 PM, Aurélio A. Heckert wrote:
Hi Pieter,
Your request is a special case of "a more interactive extension dialog". I think that is a important feature and you may consider to integrate Autoglade to inkscape as a default module to extensions that need a more inteligent dialog. http://autoglade.sourceforge.net
But that will be really more cool if the Autoglade idea was implemented inside the inkscape and the INX may point to a partial glade file to build the fields area with more flexibility to the developer and some automation inside the dialog.
Aurium
On Tue, Nov 16, 2010 at 10:31 AM, Pieter Barendrecht<pieter@...2481...> wrote:
Hi,
I wondered whether you guys agree with me that examples could be useful in some extensions? With most extensions, you can create the desired result by trial-and-error (using the Live Preview function). However, other extensions aren't really self-explanatory (like the Lindenmayer System extension). Although there is a description how it can be used, most users won't understand what you can create with the extension. Therefore, I proposed to implement a list of examples (or a tab "Examples").
I would like to implement it myself, but I don't know where to start. I found some documentation about the INX files: http://wiki.inkscape.org/wiki/index.php/MakingAnINX Maybe with a<script> environment, it would be possible to automatically assign appropriate values to the fields?
Regards, Pieter
On 10/27/2010 06:12 PM, Pieter Barendrecht wrote:
Hi all,
I'm currently working on an expansion of the L-System Extension (just for fun, getting to know XML and Python). I implemented an extra parameter "Factor", such that the fractal scales with each level. More info about this at the Inkscape Forums: http://www.inkscapeforum.com/viewtopic.php?f=5&t=6411
The thing is, I would like to include some examples in the extension. I thought of a drop-down menu (an "enum" type), with entries like "Koch Snowflake" and "Pythagoras Tree".
<param name="Examples" type="enum" _gui-text="Examples:"> <item value="Koch_Snowflake">Koch Snowflake</item> <item value="Pythagoras_Tree">Pythagoras Tree</item> </param>
When the user clicks on such an entry, appropriate values should be assigned to the fields (e.g. Axiom="F", Rules="F=F+F+F", Factor="0.5", etc.). I wondered whether this is possible using XML, or the Relax NG schema language?
So to be clear, the GUI-part isn't a problem. The UI looks like this at the moment: http://www.redpanda.nl/ExamplesInkscape.png However, the "auto-assign" function needs to be implemented yet.
Thanks, Pieter
Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps& games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev
Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2& L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today http://p.sf.net/sfu/msIE9-sfdev2dev _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
On Mon, Nov 22, 2010 at 10:52 AM, Pieter Barendrecht <pieter@...2481...> wrote:
Hi Aurium,
Thanks for your support. I tried to install Autoglade (on Ubuntu 10.04), however the Package Installer complains about "Dependency is not satisfiable: python-xml". I found on Google that this package may be unstable and is obsolete, and therefore removed from the repo. I didn't have time yet to look into the source how to fix this.
Ho... Will be good you to fix an test this! Than you will see how good is the idea.
Back to the original question. If I understand correctly, it is not possible to create an interactive dialog using the RelaxNG schema language (used for the xml in the INX files)?
May be... but i think that will be a bad approach. The glade syntax can do better dialogs, and with some code that will be more "smart".
Pieter
Hmm, I just figured out how to work with Glade and Python together. I'm not sure why I need Autoglade though, because the mentioned Examples can be easily implemented using just Glade:
... def ExampleData(self,widget): index = self.wTree.get_widget("Examples").get_active(); if index == 0: self.wTree.get_widget("windowMain").set_title("Pythagorean Tree") self.wTree.get_widget("Field1").set_text("60") self.wTree.get_widget("Field2").set_text("45") ...
However, I've yet to find out how to link the above Python script to Inkscape. For those who aren't familiar with Glade/Python, the Python script calls the GUI defined in the Glade file. So via a terminal, the GUI appears by typing "python Examples.py". Somehow the Python file needs a link to the Inkscape Canvas. I hope somebody has some spare time to join me in creating interactive dialogs!
Best regards, Pieter
On 11/22/2010 10:44 PM, Aurélio A. Heckert wrote:
On Mon, Nov 22, 2010 at 10:52 AM, Pieter Barendrecht<pieter@...2481...> wrote:
Hi Aurium,
Thanks for your support. I tried to install Autoglade (on Ubuntu 10.04), however the Package Installer complains about "Dependency is not satisfiable: python-xml". I found on Google that this package may be unstable and is obsolete, and therefore removed from the repo. I didn't have time yet to look into the source how to fix this.
Ho... Will be good you to fix an test this! Than you will see how good is the idea.
Back to the original question. If I understand correctly, it is not possible to create an interactive dialog using the RelaxNG schema language (used for the xml in the INX files)?
May be... but i think that will be a bad approach. The glade syntax can do better dialogs, and with some code that will be more "smart".
Pieter
Ok, wait... :-)
Glade is not automatically interactive. Glade is only a XML description and a lib to build GTK interfaces.
Autoglade is a script to automagically build a GTK window from a glade file and add interaction based on the names given to the widgets.
You don't need to know glade+python or gtk+python to use autoglade.
So, there are two interesting ways to use it for extensions: 1- correct autoglade code and include it on a extension code. This extension will not to use a inkscape dialog based on INX. All will be done by a autoglade dialog. 2- re-implement the autoglade idea inside inkscape using the libGlade and allows any extension to use a rich interface based on a glade file.
if you are a C++ programmer i vote on "2"! :-)
Aurium
On Tue, Nov 23, 2010 at 10:42 AM, Pieter Barendrecht <pieter@...2481...> wrote:
Hmm, I just figured out how to work with Glade and Python together. I'm not sure why I need Autoglade though, because the mentioned Examples can be easily implemented using just Glade:
... def ExampleData(self,widget): index = self.wTree.get_widget("Examples").get_active(); if index == 0: self.wTree.get_widget("windowMain").set_title("Pythagorean Tree") self.wTree.get_widget("Field1").set_text("60") self.wTree.get_widget("Field2").set_text("45") ...
However, I've yet to find out how to link the above Python script to Inkscape. For those who aren't familiar with Glade/Python, the Python script calls the GUI defined in the Glade file. So via a terminal, the GUI appears by typing "python Examples.py". Somehow the Python file needs a link to the Inkscape Canvas. I hope somebody has some spare time to join me in creating interactive dialogs!
Best regards, Pieter
On 11/22/2010 10:44 PM, Aurélio A. Heckert wrote:
On Mon, Nov 22, 2010 at 10:52 AM, Pieter Barendrecht<pieter@...2481...> wrote:
Hi Aurium,
Thanks for your support. I tried to install Autoglade (on Ubuntu 10.04), however the Package Installer complains about "Dependency is not satisfiable: python-xml". I found on Google that this package may be unstable and is obsolete, and therefore removed from the repo. I didn't have time yet to look into the source how to fix this.
Ho... Will be good you to fix an test this! Than you will see how good is the idea.
Back to the original question. If I understand correctly, it is not possible to create an interactive dialog using the RelaxNG schema language (used for the xml in the INX files)?
May be... but i think that will be a bad approach. The glade syntax can do better dialogs, and with some code that will be more "smart".
Pieter
participants (2)
-
Aurélio A. Heckert
-
Pieter Barendrecht