957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
|
# File 'lib/wiki_lyrics/gui/gui-tk.rb', line 957
def initialize( values )
super( values )
@fetch_func = eval( @values["fetch_func"] )
@fix_func = eval( @values["fix_func"] )
@submit_func = eval( @values["submit_func"] )
set_size( 600, 400 )
@shell.title( "#{values["site_name"]} - #{values["title"]}" )
label = Label.new( @shell, I18n.get( "gui.common.url" ) )
label.grid( "row"=>1, "column"=>1 )
@url_lineedit = TextEdit.new( @shell, values["url"] )
@url_lineedit.grid( "row"=>1, "column"=>2, "columnspan"=>3, "sticky"=>"ew" )
page_frame = TkFrame.new( @shell )
page_frame.grid( "row"=>2, "column"=>1, "columnspan"=>4, "sticky"=>"nesw" )
bar = TkScrollbar.new( page_frame, "orient"=>"ver" )
bar.pack( "side"=>"right", "fill"=>"y" )
@page_text = TextArea.new( page_frame ) { yscrollcommand { |first, last| bar.set( first, last ) } }
@page_text.pack( "side"=>"left", "fill"=>"both", "expand"=>true )
bar.command( proc { |*args| @page_text.yview( *args ) } )
buttons_frame = TkFrame.new( @shell )
@submit_button = Button.new( buttons_frame, I18n.get( "gui.common.submit" ) )
@submit_button.command( proc { submit_page() } )
@submit_button.pack( "side"=>"right" )
@fix_button = Button.new( buttons_frame, I18n.get( "gui.common.fix" ) )
@fix_button.command( proc { fix_page() } )
@fix_button.pack( "side"=>"right" )
@fetch_button = Button.new( buttons_frame, I18n.get( "gui.common.load" ) )
@fetch_button.command( proc { fetch_page() } )
@fetch_button.pack( "side"=>"right" )
buttons_frame.grid( "row"=>3, "column"=>1, "columnspan"=>4, "sticky"=>"ew" )
@shell.grid_rowconfigure( 2, "weight"=>1 )
@shell.grid_columnconfigure( 2, "weight"=>1 )
end
|