class CssShadowsDemo

# Copyright © 2015-2016 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. #

Theming/Shadows

This demo shows how to use CSS shadows.

Public Class Methods

new(main_window) click to toggle source
# File gtk3/sample/gtk-demo/css_shadows.rb, line 10
def initialize(main_window)
  @window = Gtk::Window.new(:toplevel)
  @window.title = "Shadows"
  @window.transient_for = main_window
  @window.set_default_size(400, 300)

  paned = Gtk::Paned.new(:vertical)
  @window.add(paned)

  child = create_toolbar
  paned.add(child)

  @default_css = Gio::Resources.lookup_data("/css_shadows/gtk.css")
  initialize_text_buffer
  initialize_provider

  container = Gtk::ScrolledWindow.new
  paned.add(container)

  child = Gtk::TextView.new(@text)
  container.add(child)

  apply_style(@window, @provider)
end

Public Instance Methods

run() click to toggle source
# File gtk3/sample/gtk-demo/css_shadows.rb, line 35
def run
  if !@window.visible?
    @window.show_all
  else
    @window.destroy
  end
  @window
end