Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

TCL(Tool Command Language) Scripting

ttk::button text size


Hi,

Is it possible to make the size of the text in the ttk:button bigger?
I've tried setting the global font size but only makes the label texts
size bigger.

option add *font "Helvetica 20"

M.

On 14 Maj, 02:02, Michael <chun.@evolving.com> wrote:

> Hi,

> Is it possible to make the size of the text in the ttk:button bigger?
> I've tried setting the global font size but only makes the label texts
> size bigger.

> option add *font "Helvetica 20"

> M.

style configure  Big.TButton -font {Helvetica 60}
toplevel .t
pack [ttk::button .t.t -style Big.TButton -text "Tile Rocks!"]

/Mats

On 14 May, 08:00, Mats <mats@gmail.com> wrote:

Thanks Mats, is working nicely.

style configure Big.TButton -font {Helvetica 20} -background red -
foreground white

proc makeKeyboard { keySet } {
   set keyboard [ttk::frame $::BASE.keyboard]
   for {set row 0} {$row < 4} {incr row} {
      grid rowconfigure  $keyboard $row -weight 1 -uniform buttons -
minsize 50
      for {set col 0} {$col < 8} {incr col} {
        if {!$row} {
          grid columnconfigure  $keyboard $col -weight 1 -uniform
buttons -minsize 50
        }
        set key [lindex [lindex $keySet $row] $col]
        grid [ttk::button $keyboard.b$row$col -takefocus 0 -style
Big.TButton -text $key -command [list keyAction $key]] \
          -row $row -column $col -sticky snew
      }
   }

   $::pw add $keyboard

}

I've set the text and background of the buttons in my program. How can
I set the button color? I thought it was using the -background option
but this sets the background of the button itself.

M.

Michael wrote:

>Is it possible to make the size of the text in the ttk:button bigger?
>I've tried setting the global font size but only makes the label texts
>size bigger.

>option add *font "Helvetica 20"

Most Tile widgets (ttk::button included) do not have
a "-font" option, so option database settings have no
effect.

You can change the default font size for all widgets by
modifying the named font TkDefaultFont:

    font configure TkDefaultFont -size 20

or for button widgets only by changing the style database:

    ttk::style configure TButton -font "Helvetica 20"

--Joe English

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc