Perl/Tk 804.027 Text Widget ( を使用Scrollable('ROText')
) にあると思われるバグに遭遇しました。すべてを選択するタグを追加し、構成の変更を適用して右揃えにすると、スクロールバーが表示されません。右揃えの tagConfigure をコメント アウトすると、スクロールバーが元に戻ります。
テキスト ウィジェットのコンテンツ (テキストおよび埋め込みエントリ ウィジェットを含む) を右揃えし、水平スクロールバーを機能させるための回避策または修正方法はありますか?
(アップデート)
問題を再現するスクリプトの例を次に示します。
use Tk;
$mw = MainWindow->new;
$mw->title("Testing");
$mw->geometry();
$pw = $mw->Scrolled('Panedwindow',-showhandle=>0, -sashwidth=>0, -sashpad=>0, -scrollbars=>'e');
$pw->pack(qw/-side top -expand yes -fill both -pady 2 -padx 2m/);
$t1 = $pw->Scrolled("Text", -scrollbars => 'os', -bg=>"red", -width => 40, -wrap => "none", -relief=>"flat");
$t2 = $pw->Scrolled("Text", -scrollbars => 'os', -bg=>"blue", -width => 20, -wrap => "none", -relief=>"flat");
$pw->add($t1,$t2);
# this loop is only to demonstrate the second problem: vertical scrolling
# on parent widget not working
foreach my $ct (1..50) {
$t1->insert("end","abcdef-abcdef-abcdef-abcdef-abcdef-abcdef-abcdef-abcdef-abcdef-abcdef\n");
}
$t1->tagAdd("content", '1.0', 'end');
# this is the justify right & loose horizontal scrolling problem:
# change the justify from left to right and the scrollbars will not show up
$t1->tagConfigure("content", -justify=>"left");
MainLoop;
私が抱えている問題は実際には 2 つのアプリケーションであり、上記の例ではどちらも機能しないことが示されています。
- ペインの左側を水平方向にスクロール可能で右寄せにする必要があります
- Paned Window ウィジェット (2 つのペインの親) を垂直方向にスクロール可能にする必要があります (左右のペインを一緒にスクロールします)。