# HG changeset patch # User Adam Chlipala # Date 1329060422 18000 # Node ID 7d001454219962ea2d4672b66a50ff55b500dd9d # Parent 5905b56e0cd9d00a20451c187d56ca2bea85efcd TogglePanel.isOpen diff -r 5905b56e0cd9 -r 7d0014542199 togglePanel.ur --- 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) diff -r 5905b56e0cd9 -r 7d0014542199 togglePanel.urs --- 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? *)