Skip to content

Changes to the Shoes DSL

jasonrclark edited this page Dec 25, 2014 · 14 revisions

The Shoes DSL is wonderful, but it does have some quirks. In Shoes 4, we are making changes to the DSL where necessary for clarity and consistency, and even to add features!

Here's a summary of the changes to the Shoes DSL in Shoes 4

Feature Shoes 3 Shoes 4
out-of-bounds rgb colors Wraps values, so that 256 is equivalent to 1, and -1 is equivalent to 255. Likewise, 1.1 is equivalent to 0.1, and -0.1 is equivalent to 0.9. Uses the closest valid value, so that 256 is equivalent to 255, and -1 is equivalent to 0. Likewise, 1.1 is equivalent to 1.0, and -0.1 is equivalent to 0.0.
Clickevents on Elements with blocks Elements like oval did not take a block Elements like oval do take a block and when those elements are clicked, the block is executed.
semantics of left/top/width etc. for background changed The behavior was not exactly like described in the manual/as exhibited in CSS. The behavior is modeled after the role model of CSS and like the manual describes it.
Emphasis Allows the option of choosing between "normal", "oblique", or "italic" type of emphasis. Takes true/false to set text to be normally italicized or not
Weight Allows the option of choosing between "ultralight", "light", "normal", "semibold", "bold", "ultrabold", or "heavy" for type of boldness applied Takes true/false to set text to be normally bolded or not
Underline Allows providing the options for the style of the underline with the following choices: "none", "single", "double", "low", and "error". Allows providing the options for the style of the underline with the following choices: "none", "single", "double", and "error".
Button text Buttons have no #text method Buttons have #text method that returns the text displayed on the button
width/height and margins If an element is asked for its width, it responds with the space it occupies MINUS the margins, e.g. the width of the element alone. If an element is asked for its width, it responds with the space it occupies (own width + margins). If you want to know the space the element alone takes up use element_width/element_height.
Arc and start left/top (see #423) left and top treated as center of element left and top treated as left/top of bounding box around element.