Monday, September 14, 2020

Glimmer DSL for SWT 0.6.6 User Profile Sample

Glimmer DSL for SWT 0.6.6 has been released with the following changes:

  • Add the User Profile sample from the DZone Glimmer article
  • Colored Ruby syntax highlighting for sample:code and sample:run tasks courtesy of tty-markdown
  • Support `check` as alias to `checkbox` DSL keyword for Button widget with :check style. 
  • Validate scaffolded custom shell gem name to ensure it doesn't clash with a built in Ruby method
  • GLIMMER_LOGGER_ASYNC env var for disabling async logging when needed for immediate troubleshooting purposes
  • Fix issue with table equivalent sort edge case (that is two sorts that are equivalent causing an infinite loop of resorting since the table is not correctly identified as sorted already)

Below is the new sample syntax-highlighted code and app screenshot from running `glimmer sample:run[user_profile]`
    

$ glimmer sample:run[user_profile]


# /Users/User/code/glimmer-dsl-swt/samples/elaborate/user_profile.rb


include Glimmer


shell {

  text "User Profile"


  composite {

    grid_layout 2, false


    group {

      text "Name"

      grid_layout 2, false

      layout_data :fill, :fill, true, true

      label {text "First"}; text {text "Bullet"}

      label {text "Last"}; text {text "Tooth"}  

    }


    group {

      layout_data :fill, :fill, true, true

      text "Gender"

      radio {text "Male"; selection true}

      radio {text "Female"}  

    }


    group {

      layout_data :fill, :fill, true, true

      text "Role"

      check {text "Student"; selection true}

      check {text "Employee"; selection true}  

    }


    group {

      text "Experience"

      row_layout

      layout_data :fill, :fill, true, true

      spinner {selection 5}; label {text "years"}

    }


    button {

      text "save"

      layout_data :right, :center, true, true

      on_widget_selected { 

        message_box {

          text 'Profile Saved!'

          message 'User profile has been saved!'

        }.open 

      }

    }


    button {

      text "close"

      layout_data :left, :center, true, true

      on_widget_selected { exit(0) }

    }

  }

}.open



# # #


Happy Glimmering!

No comments: