<commit_before>#!/usr/bin/env ruby
=begin
  scalebutton.rb - Very simple Gtk::ScaleButton example.

  Copyright (c) 2007 Ruby-GNOME2 Project Team 
  This program is licenced under the same licence as Ruby-GNOME2.

  $Id: scalebutton.rb,v 1.1 2007/07/12 14:04:54 ggc Exp $
=end

require 'gtk3'

window = Gtk::Window.new
window.add(scale = Gtk::ScaleButton.new(Gtk::IconSize::IconSize::BUTTON))
scale.set_icons(['gtk-goto-bottom', 'gtk-goto-top', 'gtk-execute'])
scale.signal_connect('value-changed') { |widget, value| puts "value changed: #{value}" }
window.show_all

Gtk.main<commit_msg>Update to Gtk3 api, update Copyright and fix style issue in scalebutton.rb<commit_after>#!/usr/bin/env ruby
=begin
  scalebutton.rb - Very simple Gtk::ScaleButton example.

  Copyright (c) 2007-2015 Ruby-GNOME2 Project Team
  This program is licenced under the same licence as Ruby-GNOME2.
=end

require "gtk3"

window = Gtk::Window.new
window.set_size_request(300, 300)
scale = Gtk::ScaleButton.new(Gtk::IconSize::BUTTON, 0, 100, 2, nil)
scale.set_value(30)
scale.set_valign(Gtk::Align::END)
scale.set_halign(Gtk::Align::END)
box = Gtk::Box.new(:vertical)
box.add(scale)
box.vexpand = true
box.hexpand = true

window.add(box)
# see here for an explication  on icons order
# https://developer.gnome.org/gtk3/stable/GtkScaleButton.html#GtkScaleButton--icons
scale.set_icons(%w(gtk-goto-bottom gtk-goto-top gtk-execute))
scale.signal_connect("value-changed") { |_widget, value| puts "value changed: #{value}" }

window.show_all

window.signal_connect("destroy") { Gtk.main_quit }
Gtk.main
{'fraction_non_alphanumeric': 0.14049586776859505, 'fraction_numerical': 0.031150667514303877, 'mean_word_length': 5.3983739837398375, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2990554', 'n_tokens_mistral': 613, 'n_tokens_neox': 556, 'n_words': 131}