Glimmer DSL for LibUI 0.5.10 - Shape Listeners

This page summarizes the projects mentioned and recommended in the original post on dev.to

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • glimmer-dsl-libui

    Glimmer DSL for LibUI - Prerequisite-Free Ruby Desktop Development Cross-Platform Native GUI Library - The Quickest Way From Zero To GUI - If You Liked Shoes, You'll Love Glimmer! - No need to pre-install any prerequisites. Just install the gem and have platform-independent GUI that just works on Mac, Windows, and Linux.

  • # From: https://github.com/AndyObtiva/glimmer-dsl-libui#shape-coloring require 'glimmer-dsl-libui' class ShapeColoring include Glimmer::LibUI::Application COLOR_SELECTION = Glimmer::LibUI.interpret_color(:red) before_body { @shapes = [] } body { window('Shape Coloring', 200, 200) { margined false grid { label("Click a shape to select and\nchange color via color button") { left 0 top 0 hexpand true halign :center vexpand false } color_button { |cb| left 0 top 1 hexpand true vexpand false on_changed do @selected_shape&.fill = cb.color end } area { left 0 top 2 hexpand true vexpand true rectangle(0, 0, 600, 400) { # background shape fill :white } @shapes << colorable(:rectangle, 20, 20, 40, 20) { |shape| fill :lime } @shapes << colorable(:square, 80, 20, 20) { |shape| fill :blue } @shapes << colorable(:circle, 75, 70, 20, 20) { |shape| fill :green } @shapes << colorable(:arc, 120, 70, 40, 0, 145) { |shape| fill :orange } @shapes << colorable(:polygon, 120, 10, 120, 50, 150, 10, 150, 50) { fill :cyan } @shapes << colorable(:polybezier, 20, 40, 30, 100, 50, 80, 80, 110, 40, 120, 20, 120, 30, 91) { fill :pink } } } } } def colorable(shape_symbol, *args, &content) send(shape_symbol, *args) do |shape| on_mouse_up do |area_mouse_event| old_stroke = Glimmer::LibUI.interpret_color(shape.stroke).slice(:r, :g, :b) @shapes.each {|sh| sh.stroke = nil} @selected_shape = nil unless old_stroke == COLOR_SELECTION shape.stroke = COLOR_SELECTION.merge(thickness: 2) @selected_shape = shape end end content.call(shape) end end end ShapeColoring.launch

  • perfect-shape

    Perfect Shape is a collection of geometric algorithms that are mostly useful for GUI manipulation like checking containment of a point in popular geometric shapes such as rectangle, square, arc, circle, polygon, and paths containing lines, quadratic bézier curves, and cubic bezier curves. Also, some general math algorithms like IEEE-754 Remainder.

  • Support nesting area mouse listeners underneath shapes directly given the newly added support for the include?(x, y) method, which can be used to detect if a mouse event fired for a specific shape examples/shape_coloring.rb In summary, you can now use area mouse listeners within shapes directly and Glimmer DSL for LibUI will ensure that they do not fire unless the mouse x,y coordinates land within the shape regions (it does so by leveraging the Perfect Shape gem)

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Glimmer DSL for LibUI 0.5.11 - Basic Shape Drag & Drop

    1 project | dev.to | 21 May 2022
  • Show HN: Ruby WhatsApp SDK Gem

    1 project | news.ycombinator.com | 16 Apr 2023
  • Glimmer DSL for SWT v4.24.1.0 Improved Hello, Canvas Path!

    1 project | dev.to | 24 Jul 2022
  • Why Ruby is More Readable than Python

    1 project | /r/ruby | 19 Jul 2022
  • Glimmer DSL for SWT Hello, Canvas Data-Binding! (+ Quads & Cubics)

    1 project | dev.to | 15 Jul 2022