Commits

Zachary Allaun  committed 7d003de

Adds remove-resize-listener

  • Participants
  • Parent commits 424c2aa

Comments (0)

Files changed (2)

File src/lanterna/screen.clj

   The listener itself will be returned.  You don't need to do anything with it,
   but you can use it to remove it later with remove-resize-listener.
 
-  TODO: Add remove-resize-listener.
-
   "
   [^Screen screen listener-fn]
   (t/add-resize-listener (.getTerminal screen)
                          listener-fn))
 
+(defn remove-resize-listener
+  "Remove a resize listener from the given screen."
+  [^Screen screen listener]
+  (t/remove-resize-listener (.getTerminal screen) listener))
 
 (defn get-screen
   "Get a screen object.

File src/lanterna/terminal.clj

   The listener itself will be returned.  You don't need to do anything with it,
   but you can use it to remove it later with remove-resize-listener.
 
-  TODO: Add remove-resize-listener.
-
   "
   [^Terminal terminal listener-fn]
   (let [listener (reify com.googlecode.lanterna.terminal.Terminal$ResizeListener
     (.addResizeListener terminal listener)
     listener))
 
+(defn remove-resize-listener
+  "Remove a resize listener from the given terminal."
+  [^Terminal terminal listener]
+  (.removeResizeListener terminal listener))
 
 (defn get-available-fonts []
   (set (.getAvailableFontFamilyNames