Embedded the matplotlib in a GtkViewport.

Still trying to work out the kinks, as only one plot is showing,
and it's not updating with the sliders. I'll get there sooner
or later. Also updated the gitignore, and added images showing
the parametric equations used to calculate the graphs. Neat!
This commit is contained in:
A.M. Rowsell 2021-06-27 15:40:30 -04:00
commit 3e96363771
Signed by: amr
GPG key ID: 0B6E2D8375CF79A9
7 changed files with 217 additions and 29 deletions

153
spirographs.glade Normal file
View file

@ -0,0 +1,153 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.38.2 -->
<interface>
<requires lib="gtk+" version="3.24"/>
<object class="GtkAdjustment" id="bigRadiusAdjustment">
<property name="lower">0.10</property>
<property name="upper">100</property>
<property name="value">0.10</property>
<property name="step-increment">0.10</property>
<property name="page-increment">1</property>
<signal name="value-changed" handler="bigRadiusAdjustment_value_changed_cb" swapped="no"/>
</object>
<object class="GtkAdjustment" id="distanceAdjustment">
<property name="lower">0.10</property>
<property name="upper">100</property>
<property name="value">0.10</property>
<property name="step-increment">0.10</property>
<property name="page-increment">1</property>
<signal name="value-changed" handler="distanceAdjustment_value_changed_cb" swapped="no"/>
</object>
<object class="GtkAdjustment" id="smallRadiusAdjustment">
<property name="lower">0.10</property>
<property name="upper">100</property>
<property name="value">0.10</property>
<property name="step-increment">0.10</property>
<property name="page-increment">1</property>
<signal name="value-changed" handler="smallRadiusAdjustment_value_changed_cb" swapped="no"/>
</object>
<object class="GtkWindow" id="spWindow">
<property name="can-focus">False</property>
<signal name="destroy" handler="onDestroy" swapped="no"/>
<child>
<!-- n-columns=2 n-rows=5 -->
<object class="GtkGrid" id="topGrid">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="row-spacing">10</property>
<property name="column-homogeneous">True</property>
<child>
<object class="GtkScale" id="bigRadiusScale">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="adjustment">bigRadiusAdjustment</property>
<property name="show-fill-level">True</property>
<property name="fill-level">100</property>
<property name="round-digits">1</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkScale" id="smallRadiusScale">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="adjustment">smallRadiusAdjustment</property>
<property name="show-fill-level">True</property>
<property name="fill-level">100</property>
<property name="round-digits">1</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkScale" id="distanceScale">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="adjustment">distanceAdjustment</property>
<property name="show-fill-level">True</property>
<property name="fill-level">100</property>
<property name="round-digits">1</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="bigRadiusLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Big Radius (R):</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="smallRadiusLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Small Radius (r):</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="distanceLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Distance (d):</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkImage" id="epichondroidFormulaImage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="pixbuf">img/small_epitrochoid.png</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkImage" id="hypotrochoidFormulaImage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="pixbuf">img/small_hypotrochoid.png</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkViewport" id="plotViewport">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
<property name="width">2</property>
</packing>
</child>
</object>
</child>
</object>
</interface>