http://www.perlmonks.org?node_id=999807


in reply to perl TK Gui rendering in windows remote desktop

this is seen on Win7 and WinXP. If the GUI is started locally, then mstsc does not render the GUI completely. If the GUI is started via mstsc, then locally the GUI is not rendered.

#!/usr/local/bin/perl -w #use 5.10.0; use Tk; use strict; use warnings; use Tk::NoteBook; use Data::Dumper; # -------------------------------------------------------------------- +---------- #<+MAIN part of the program +> # -------------------------------------------------------------------- +---------- my $mw = MainWindow->new; $mw->title('MSTSC test $Rev:$'); $mw->bind( '<Key-F5>', sub { $mw->update; } ); $mw->bind( '<Escape>', sub { exit; } ); $mw->bind( '<Alt-x>', sub { exit;} ); $mw->bind( '<Alt-X>', sub { exit;} ); my $menubar = $mw->Frame()->pack( -side => 'top', -anchor => 'w', ); $menubar->Button( -text => "Exit", -command => sub { exit; } )->pack( +-side => 'right' ); $menubar->Button( -text => "Exit", -command => sub { exit; } )->pack( +-side => 'right' ); $menubar->Button( -text => "Exit", -command => sub { exit; } )->pack( +-side => 'right' ); $menubar->Button( -text => "Exit", -command => sub { exit; } )->pack( +-side => 'right' ); my $npage = $mw->NoteBook(); #->pack; # create the Main window to hold start/status buttons my $start_page = $npage->add( 'start', -label => "Start", ); my %widget_obj; my $label = "ZZ"; $widget_obj{output_tab_wid} = $npage->add( $label, -label => "$label", + ); $widget_obj{output_tab_wid}->Label( -text => "Input Window" )->pack( - +side => 'top', -anchor => 'n' ); $widget_obj{intext_wid} = $widget_obj{output_tab_wid}->Scrolled("Text" +)->pack( -side => 'top', -fill => 'both', -expand => 1, ); my $drive_frame = $start_page->Frame( -relief => 'groove', -borderwidth => 2, -label => "Special Button" )->pack( -side => 'left', -fill => 'y' ); $start_page->pack(-anchor => 'n' , -side => 'left', ); $widget_obj{'button_wid'} = $drive_frame->Button( -state => 'disabled', -text => $label, -relief => 'flat', -borderwidth => 4, -width => 15, -height => 15, -highlightthickness => 0, )->pack( -anchor => 'w' , -side => 'left', ); $npage->pack(); $mw->update; # $mw->focusmodel("active"); MainLoop; exit 0;