Skip to content

Commit

Permalink
:divider-size, :resize-weight, and :one-touch-expandable? for splitter
Browse files Browse the repository at this point in the history
  • Loading branch information
daveray committed Jul 20, 2011
1 parent b6e272e commit e6bfcda
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/seesaw/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1673,6 +1673,9 @@

(def ^{:private true} splitter-options {
:divider-location divider-location!
:divider-size #(.setDividerSize ^JSplitPane %1 %2)
:resize-weight #(.setResizeWeight ^JSplitPane %1 %2)
:one-touch-expandable? #(.setOneTouchExpandable ^JSplitPane %1 (boolean %2))
})

(defn splitter
Expand Down
8 changes: 7 additions & 1 deletion test/seesaw/test/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,13 @@
; We can't really test this since the expected divider location (in pixels)
; is pretty hard to predict and because of the JSplitPane visibility hack
; that's required, it won't actually happen until it's displayed in a frame :(
(expect true))))
(expect true)))
(it "should set the :divider-side"
(= 93 (.getDividerSize (splitter :left-right (label) (label) :divider-size 93))))
(it "should set the :resize-weight"
(= 0.75 (.getResizeWeight (splitter :left-right (label) (label) :resize-weight 0.75))))
(it "should set :one-touch-expandable?"
(.isOneTouchExpandable (splitter :left-right (label) (label) :one-touch-expandable? true))))

(describe menu-item
(it "should create a JMenuItem"
Expand Down

0 comments on commit e6bfcda

Please sign in to comment.