Class: Glimmer::Gtk::WidgetProxy::WindowProxy

Inherits:
Glimmer::Gtk::WidgetProxy show all
Defined in:
lib/glimmer/gtk/widget_proxy/window_proxy.rb

Overview

Proxy for Gtk window objects

Follows the Proxy Design Pattern

Constant Summary collapse

DEFAULT_WIDTH =
190
DEFAULT_HEIGHT =
150

Constants inherited from Glimmer::Gtk::WidgetProxy

KEYWORD_ALIASES

Instance Attribute Summary

Attributes inherited from Glimmer::Gtk::WidgetProxy

#args, #block, #gtk, #keyword, #parent_proxy

Instance Method Summary collapse

Methods inherited from Glimmer::Gtk::WidgetProxy

constant_symbol, #content, create, descendant_keyword_constant_map, exist?, gtk_constant_symbol, #initialize, keyword, map_descendant_keyword_constants_for, #method_missing, #post_initialize_child, reset_descendant_keyword_constant_map, #respond_to?, #respond_to_gtk?, #send_to_gtk, widget_proxy_class, #window_proxy

Constructor Details

This class inherits a constructor from Glimmer::Gtk::WidgetProxy

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Glimmer::Gtk::WidgetProxy

Instance Method Details

#post_add_contentObject



72
73
74
75
76
77
# File 'lib/glimmer/gtk/widget_proxy/window_proxy.rb', line 72

def post_add_content
  unless @initial_content_added
    @initial_content_added = true
    self.set_default_size(DEFAULT_WIDTH, DEFAULT_HEIGHT) if default_size.include?(-1)
  end
end

#presentObject



87
88
89
90
91
92
93
# File 'lib/glimmer/gtk/widget_proxy/window_proxy.rb', line 87

def present
  super
  unless @shown_at_least_once
    @shown_at_least_once = true
    ::Gtk.main
  end
end

#showObject



79
80
81
82
83
84
85
# File 'lib/glimmer/gtk/widget_proxy/window_proxy.rb', line 79

def show
  super
  unless @shown_at_least_once
    @shown_at_least_once = true
    ::Gtk.main
  end
end

#signal_connect(signal, &block) ⇒ Object



95
96
97
98
# File 'lib/glimmer/gtk/widget_proxy/window_proxy.rb', line 95

def signal_connect(signal, &block)
  @destroy_signal_connected = true if signal.to_s.downcase == 'destroy'
  super
end