Class: GTK::ShowLyricsDialog

Inherits:
BaseDialog
  • Object
show all
Defined in:
lib/wiki_lyrics/gui/gui-gtk.rb

Instance Attribute Summary

Attributes inherited from BaseDialog

#accepted, #values

Instance Method Summary collapse

Methods inherited from BaseDialog

#accept, #exec

Constructor Details

#initialize(values) ⇒ ShowLyricsDialog

Returns a new instance of ShowLyricsDialog.



915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
# File 'lib/wiki_lyrics/gui/gui-gtk.rb', line 915

def initialize( values )
	super( values )

	set_border_width( 5 )
	set_resizable( true )
	set_default_size( 400, 400 )
	resize( 350, 400 )

	title = I18n.get( "gui.lyrics.title", @values["title"], @values["artist"] )
	title += " [#{@values["site_name"]}]" if @values["site_name"]
	set_title( title )

	lyrics_scrolled_window = Gtk::ScrolledWindow.new()
	lyrics_scrolled_window.set_policy( Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC )
	@lyrics_text_buffer = GTK::TextBuffer.new()
	@lyrics_text_buffer.set_text( values["lyrics"] )
	@lyrics_text = GTK::TextView.new()
	@lyrics_text.set_indent( 2 )
	@lyrics_text.set_buffer( @lyrics_text_buffer )
	lyrics_scrolled_window.add( @lyrics_text )

	lyrics_frame = Gtk::Frame.new()
	lyrics_frame.add( lyrics_scrolled_window )
	lyrics_frame.set_shadow_type( Gtk::SHADOW_IN )

	add( lyrics_frame )
end