If you can move to Gtk2, the rotated fonts look way better than inTk.
#! /usr/bin/perl -w use strict; use Glib qw/TRUE FALSE/; use Gtk2 '-init'; my $deg = 0; my $label; Glib::Timeout->add (200,sub{ &rotate_label() }); #standard window creation, placement, and signal connecting my $window = Gtk2::Window->new('toplevel'); $window->signal_connect('delete_event' => sub { Gtk2->main_quit; }); $window->set_border_width(5); $window->set_position('center_always'); #this vbox will geturn the bulk of the gui my $vbox = &ret_vbox(); #add and show the vbox $window->add($vbox); $window->show(); #our main event-loop Gtk2->main(); sub ret_vbox { #create a vbox to pack the following widgets my $vbox = Gtk2::VBox->new(FALSE,5); #this will be the label who gets rotated throughout the program $label = Gtk2::Label->new(); #start with it at 90deg to have max space alllocated to it $label->set_angle(90); $label->set_markup('<span foreground="DarkRed" size="x-large"><b>R +otating Label</b></span>'); $vbox->pack_start($label,FALSE,FALSE,4); #create table to pack the labels that will demo how mnemonic text +work my $table = Gtk2::Table->new (2, 2, FALSE); my $lbl_mnemonic_one = Gtk2::Label->new_with_mnemonic("Label _ +One:"); $lbl_mnemonic_one->set_alignment (1, 1); $table->attach_defaults ($lbl_mnemonic_one, 0, 1, 0, 1); my $ent_one = Gtk2::Entry->new(); $lbl_mnemonic_one->set_mnemonic_widget ($ent_one); $table->attach_defaults ($ent_one, 1, 2, 0, 1); my $lbl_mnemonic_two = Gtk2::Label->new(); $lbl_mnemonic_two->set_markup_with_mnemonic('<span foreground= +"maroon" size="x-large"><i>Label _Two</i></span>'); $lbl_mnemonic_two->set_alignment (0, 0); $table->attach_defaults ($lbl_mnemonic_two, 0, 1, 1, 2); my $ent_two = Gtk2::Entry->new(); $lbl_mnemonic_two->set_mnemonic_widget ($ent_two); $table->attach_defaults ($ent_two, 1, 2, 1, 2); $vbox->pack_end($table,FALSE,FALSE,4); $vbox->pack_end(Gtk2::HSeparator->new(),FALSE,FALSE,4); #create a label that will demo pango markup my $label_markup = Gtk2::Label->new(); $label_markup->set_markup("<span foreground=\"yellow1\" size=\"400 +00\">Label with</span><s><big> Tango </big></s> Pango<span background + = 'black' foreground= 'green' size ='30000'><i>markup</i></span>"); $vbox->pack_end($label_markup,FALSE,FALSE,4); $vbox->pack_end(Gtk2::HSeparator->new(),FALSE,FALSE,4); $vbox->show_all(); return $vbox; } sub rotate_label { $deg = $deg +5; ($deg==360)&&($deg =0); $label->set_angle($deg); return 1; }

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh

In reply to Re: Rotating text in perl tk by zentara
in thread Rotating text in perl tk by karlj

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.