Skins and one critical TK snafu

View: New views
1 Messages — Rating Filter:   Alert me  

Skins and one critical TK snafu

by dmark :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Replaces code/common/tk_frames.pl.  Accompanying tk_widgets is pared down (and should ultimately merge with the skin module.)  And for Christ's sake, delete tk_widgets.pl from lib (or move both of these there or whatever.)  There is absolutely no reason at all to have that file duplicated in the lib folder.

tk_skin.pl
tk_widgets.pl

There are a bunch of tk-related changes (in bin/mh) needed to make this work.  I copied a subsection of them to show how this works, but as with all of these updates, you need ALL of the pieces to make them work.

IMPORTANT: By a happy coincidence, I see that the "optional scrollbar" code for the log frames is in here.  That is crucial and should be copied over to the SVN version immediately (for reasons I have posted repeatedly over the last six months or so.)  That's what happens when dumbasses arbitrarily cut off updates in mid-upload.  Checking their version of tk_frames (their tk code is still a bit disorganized), I see:

 $Tk_objects{log_window} = $Tk_objects{fb}->
            Scrolled('Text', -height => 3, -width => 100, -wrap => 'none', -scrollbars => 'osoe',
                     -setgrid => 'true')->

Change 'osoe' to 'se'.

I wrote Bruce Winter and several others about this several times and IT WAS POSTED IN THE $#@ FORUM around last July.  -scrollbars => 'osoe' is POISON!  It can lock up the whole interface, which pauses MH indefinitely.  At least one other person has posted about a bad experience with this.  Clue: don't cut off an upgrade in the middle unless you know what you are doing with regard to the new code.  And certainly don't ignore posts/emails about CRITICAL SHOW-STOPPER BUGS that have been left to fester in the source.  I wonder how many people have downloaded this thing, only to find out it pauses constantly and uninstalled it without even asking about it in the forum.  What a bunch of bums.  Know-nothings led by a do-nothing.

From new bin/mh.  NOTE that skins respond to the View menu (View | Toolbar, View | Status Bar, etc.)

sub tk_toolbar_sync {
        if ($config_parms{tk_toolbar}) {
                &tk_toolbar_create();
        }
        else {
                &tk_toolbar_destroy();
        }
}

sub tk_statusbar_sync {
        if ($config_parms{tk_status}) {
                &read_code_forced(); # creates widgets anew
        }
        else {
                &tk_statusbar_destroy();
        }
}

sub tk_speak_log_sync {
        if ($config_parms{tk_speak_log}) {
                &tk_speak_log_create();
        }
        else {
                &tk_speak_log_destroy();
        }
}

sub tk_print_log_sync {
        if ($config_parms{tk_print_log}) {
                &tk_print_log_create();
        }
        else {
                &tk_print_log_destroy();
        }
}

sub tk_print_log {
        my $parent = shift;
        my $optional_scrollbars = $config_parms{tk_optional_scrollbars};

        $optional_scrollbars = 0 unless defined $optional_scrollbars;
        my $scrollbar_parameters = ($optional_scrollbars)?'osoe':'se';

        $Tk_objects{log_window} = $parent->
            Scrolled('Text', -height => 3, -width => 40, -wrap => 'none', -scrollbars => $scrollbar_parameters,
                     -setgrid => 'true')->
                         pack(qw/-side top -expand 1 -fill both/);
        $Tk_objects{log_window}->insert('0.0', (join "\n", @Print_Log)); # Seed with previous entries

        &configure_element('log', \$Tk_objects{log_window});
        return $Tk_objects{log_window};
}
sub tk_speak_log {
        my $parent = shift;
        my $optional_scrollbars = $config_parms{tk_optional_scrollbars};

        $optional_scrollbars = 0 unless defined $optional_scrollbars;
        my $scrollbar_parameters = ($optional_scrollbars)?'osoe':'se';

                                # Add speak and log windows to bottom frame
        $Tk_objects{speak_window} = $parent->
            Scrolled('Text', -height => 3, -width => 40, -wrap => 'none', -scrollbars => $scrollbar_parameters,
                     -setgrid => 'true')->
                         pack(qw/-side top -expand 1 -fill both/);
        $Tk_objects{speak_window}->insert('0.0', (join "\n", @Speak_Log)); # Seed with previous entries

        &configure_element('log', \$Tk_objects{speak_window});
        return $Tk_objects{speak_window};
}


sub tk_command_list_sync {
        if ($config_parms{tk_command_list}) {
                &tk_command_list_create();
        }
        else {
                &tk_command_list_destroy();
        }
}

And since I am naming the guilty parties in this last post, I want to take a moment and thank the few MH developers who actually tried to help with the renovation (even succeeded in a few cases.)  Gregg Liming and Jason Sharpee are the only two I can think of.  Jack Edin (user) tried to help, but the mice in charge wouldn't listen to him.  Thanks to you three for trying.

And to that one guy who kept repeating himself: "If your stuff is so good, why don't you post it somewhere else.", I have emailed the bulk of this to the other MH developers in the past.  Besides, you don't lock me out of the repository and expect me to do extra work to create a new one, just to prove to some dorks that I am not making up stories about vaporware a la Brent DeShazer.  I don't make movies about what I plan to do.  Those who can do, those who can't post movies and screen shots.  So shut the hell up and be glad I posted anything at all at this juncture.