diff options
author | jake <jake@jakes-mail.top> | 2022-02-02 01:30:26 -0500 |
---|---|---|
committer | jake <jake@jakes-mail.top> | 2022-02-02 01:30:26 -0500 |
commit | 54f42602c935aa107b5ac2d5986a31d5873560d6 (patch) | |
tree | 1fe27f2dd2cd8066e52851b7e49a053ae0973c5d /gmi.pl | |
parent | 631e6039d7d0d8ddcaf84d0716ce83d7ff5864f1 (diff) |
i dont get Tk at all.
Diffstat (limited to 'gmi.pl')
-rwxr-xr-x | gmi.pl | 44 |
1 files changed, 29 insertions, 15 deletions
@@ -47,16 +47,30 @@ use File::Slurper qw(read_dir read_text); # CPAN #use Data::Dumper; # Core use File::BaseDir qw(xdg_config_home xdg_data_home xdg_cache_home); # CPAN use TOML qw(from_toml to_toml); # CPAN +use Tk; +use Tk::Text; +use Tk::Canvas; -# sudo cpanm IO::Socket::SSL URL::XS IO::Pager Text::Wraper Term::ReadKey Path::Naive Text::ParseWords Term::ReadLine Smart::Comments URI::Encode IO::Socket::SSL::Utils File::Slurper File::BaseDir TOML +# sudo cpanm IO::Socket::SSL URL::XS IO::Pager Text::Wraper Term::ReadKey Path::Naive Text::ParseWords Term::ReadLine Smart::Comments URI::Encode IO::Socket::SSL::Utils File::Slurper File::BaseDir TOML Tk + +my $top = MainWindow->new; + +my $t = $top->Scrolled(qw/Text -relief sunken -borderwidth 2 -setgrid true -height 30 -scrollbars e/); +$t->pack(qw/-expand yes -fill both/); + +$t->insert('0.0', "$something"); + +$t->mark(qw/set insert 0.0/); + +MainLoop; my %config = ( 'use_pager' => 1, 'pager_text_wrap_auto' => 1, 'textwrap' => 70, # not used if pager_text_warp_auto is 1 'timeout' => 10, - 'pretty_links' => 1, - 'pretty_headers' => 1, + 'pretty_links' => 0, + 'pretty_headers' => 0, 'auto_redirect' => 3, 'pager' => 'less -R', 'doc_out' => 1, @@ -202,18 +216,18 @@ $term->ornaments(0); $prompt = "$current_url > "; -print $OUT "gmi.pl Copyright (C) 2022 Jake Thoughts\n"; -print $OUT "This program comes with ABSOLUTELY NO WARRANTY.\n"; -print $OUT "This is free software, and you are welcome to redisdtribute it\n"; -print $OUT "under certain conditions. See COPYING for details.\n"; -print $OUT "Press <tab><tab> to see available commands.\n"; -while ( defined ($_ = $term->readline($prompt)) ) { - if ($_) { - my ($command, $detail, @other_details) = split(/\s/, $_); - do_command(\$command, \$detail, @other_details); - } - $prompt = "$current_url > "; -} +#print $OUT "gmi.pl Copyright (C) 2022 Jake Thoughts\n"; +#print $OUT "This program comes with ABSOLUTELY NO WARRANTY.\n"; +#print $OUT "This is free software, and you are welcome to redisdtribute it\n"; +#print $OUT "under certain conditions. See COPYING for details.\n"; +#print $OUT "Press <tab><tab> to see available commands.\n"; +#while ( defined ($_ = $term->readline($prompt)) ) { +# if ($_) { +# my ($command, $detail, @other_details) = split(/\s/, $_); +# do_command(\$command, \$detail, @other_details); +# } +# $prompt = "$current_url > "; +#} sub do_command { # referenced command, referenced arg, additional args |