Changing font in Label widget 
Author Message
 Changing font in Label widget

I tried looking at the documentation for how to specifiy font
characteristics for widgets and got rather confused...

To help me get started could someone show me how to set the font
characteristics for the Label widget:-

ie. I wish to have several labels, each, say, Helvetica 16-point bold
italic
how do I do this?

Also could someone let me know what fonts are available on NT

Thanks
Richard Caton



Mon, 09 Apr 2001 03:00:00 GMT  
 Changing font in Label widget

Quote:

> I tried looking at the documentation for how to specifiy font
> characteristics for widgets and got rather confused...

> To help me get started could someone show me how to set the font
> characteristics for the Label widget:-

> ie. I wish to have several labels, each, say, Helvetica 16-point bold
> italic
> how do I do this?

With Tk800, the following should work (at least it works with unix):

        use Tk;
        $top = new MainWindow;
        $font = $top->fontCreate(-family => 'helvetica',
                                 -size => 16,
                                 -weight => 'bold',
                                 -slant => 'italic',
                                );
        $top->Label(-text => 'Hello, world',
                    -font => $font)->pack;
        MainLoop;

Quote:
> Also could someone let me know what fonts are available on NT

        print join("\n", $t->fontFamilies)

You can find more information in the Tk::Font pod.

Regards,
        Slaven

--
use Tk;$c=tkinit->Canvas->pack;$x=10;for(split/_/,'KPI1_+09IPK_K;-OA1_+K!;A__1;
Q!7G_1+QK_3CLPI90,_+K!;A_+1!KQ!.N_K+1Q!.F_1+KN.Q__1+KN._K+1Q!.F_1+KN.Q_+1Q__+1!
KQ!.N_1;Q!7G_K3,09Q_+1!K.Q_K+1Q!.F_1+KN.Q'){s/\n//g;for(split/!/){$c->create(
'line',map{$a=ord($_)-43;($x+($a>>3)*2,3+($a&7)*2)}split//)}$x+=12}MainLoop



Tue, 10 Apr 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Changing Frame label font

2. NoteBook label font - how to change?

3. Frame label font?

4. BrowseEntry: font for -label

5. change background color on a widget when the textvariable changes

6. CGI.pm on NT: assigning labels to popup via hash changes popup values

7. how to retrieve -label value from a BrowseEntry widget

8. Question about multiline Label widget.

9. Modify the height of BUTTON,LABEL,.. widgets

10. Clock Widget/Label

11. accessing -label value in cascade widget

12. Label Widget Used for Status Bar

 

 
Powered by phpBB® Forum Software