add marginalUI spike in perl
authorElliot Winard <enw@caveteen.com>
Sat, 2 Oct 2010 21:18:05 +0000 (17:18 -0400)
committerElliot Winard <enw@caveteen.com>
Sat, 2 Oct 2010 21:27:54 +0000 (17:27 -0400)
marginalUI.glade [new file with mode: 0644]
marginalUI.pl [new file with mode: 0755]

diff --git a/marginalUI.glade b/marginalUI.glade
new file mode 100644 (file)
index 0000000..fe3bb9e
--- /dev/null
@@ -0,0 +1,68 @@
+<?xml version="1.0"?>
+<glade-interface>
+  <!-- interface-requires gtk+ 2.16 -->
+  <!-- interface-naming-policy project-wide -->
+  <widget class="GtkDialog" id="dialog">
+    <property name="visible">True</property>
+    <property name="border_width">5</property>
+    <property name="type_hint">normal</property>
+    <property name="has_separator">False</property>
+    <child internal-child="vbox">
+      <widget class="GtkVBox" id="dialog-vbox1">
+        <property name="visible">True</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">2</property>
+        <child>
+          <widget class="GtkLabel" id="messageLabel">
+            <property name="visible">True</property>
+            <property name="use_markup">True</property>
+          </widget>
+          <packing>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <widget class="GtkHButtonBox" id="dialog-action_area1">
+            <property name="visible">True</property>
+            <property name="layout_style">end</property>
+            <child>
+              <widget class="GtkButton" id="yesButton">
+                <property name="label">gtk-yes</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+                <signal name="clicked" handler="on_yesButton_clicked"/>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkButton" id="noButton">
+                <property name="label">gtk-no</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+                <signal name="clicked" handler="on_noButton_clicked" object="no"/>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
+</glade-interface>
diff --git a/marginalUI.pl b/marginalUI.pl
new file mode 100755 (executable)
index 0000000..0714423
--- /dev/null
@@ -0,0 +1,55 @@
+#!/usr/bin/perl -w
+
+#----------------------------------------------------------------------
+# marginalUI
+#
+# TODO: make the $heredoc a fucntion that takes the following args -
+#    end entity uid - string
+#    certifiers - list of certifiers
+#
+#----------------------------------------------------------------------
+
+use strict;
+use warnings;
+
+use Gtk2 '-init'; # auto-initializes Gtk2
+use Gtk2::GladeXML;
+
+my $glade;
+my $label;
+
+# populate UI from 
+$glade = Gtk2::GladeXML->new("marginalUI.glade");
+
+# Connect the signals
+$glade->signal_autoconnect_from_package('main');
+
+$label = $glade->get_widget('messageLabel');
+my $labeltxt = <<'END';
+pub   4096R/E27BAABC 2007-01-08 [expires: 2012-01-07] 
+uid       [  full  ] Jameson Graef Rollins <jrollins@finestructure.net> 
+uid       [  full  ] Jameson Graef Rollins <jrollins@phys.columbia.edu>
+uid       [  full  ] Jameson Graef Rollins <jrollins@fifthhorseman.net>
+uid       [  full  ] Jameson Graef Rollins <jrollins@astro.columbia.edu>
+uid       [  full  ] Jameson Rollins <jrollins@fifthhorseman.net>
+uid       [  full  ] Jameson Graef Rollins <jameson.rollins@ligo.org>
+uid       [  full  ] [jpeg image of size 4097]
+uid       [marginal] Jameson Rollins <jrollins@finestructure.net>
+sub   4096R/1321E689 2007-01-09 [expires: 2012-01-08]
+sub   2048R/4414A10A 2008-06-18 [expires: 2013-06-17]
+
+Do you trust this dude?
+END
+$label->set_text($labeltxt);
+
+# Start it up
+Gtk2->main;
+
+exit 0;
+
+sub on_yesButton_clicked {
+    exit 0;
+}
+sub on_noButton_clicked {
+    exit 1;
+}