changeset 28:7d0014542199

TogglePanel.isOpen
author Adam Chlipala <adam@chlipala.net>
date Sun, 12 Feb 2012 10:27:02 -0500
parents 5905b56e0cd9
children 93140c5cc972
files togglePanel.ur togglePanel.urs
diffstat 2 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/togglePanel.ur	Tue Dec 20 21:04:21 2011 -0500
+++ b/togglePanel.ur	Sun Feb 12 10:27:02 2012 -0500
@@ -54,3 +54,9 @@
     end
 
 fun gui_togglePanel [t ::: Type] [ctx ::: {Unit}] (g : gui t ctx) = mkGui (@render g)
+
+fun isOpen [t] [ctx] (t : togglePanel t ctx) =
+    v <- signal t.PanelState;
+    return (case v of
+                Open => True
+              | Closed => False)
--- a/togglePanel.urs	Tue Dec 20 21:04:21 2011 -0500
+++ b/togglePanel.urs	Sun Feb 12 10:27:02 2012 -0500
@@ -39,3 +39,6 @@
                       -> Gui.gui (togglePanel t ctx) ctx
 (* The togglePanel is itself a widget.  It can be pretty printed to a piece
  * of XML with a use of [toXml]. *)
+
+val isOpen : t ::: Type -> ctx ::: {Unit} -> togglePanel t ctx -> signal bool
+(* Is the inner content currently being displayed? *)