A
Ara.T.Howard
can someone please tell me why the following does NOT produce a window half as
big as my screen?
require 'tk'
tkroot = TkRoot.new
width = (tkroot.winfo_screenwidth * 0.5).to_i
height = (tkroot.winfo_screenheight * 0.5).to_i
tklabel = TkLabel.new :text => 'foobar'
tklabel.pack :expand => true, :fill => 'both'
tkroot.configure :width => width, :height => height
Tk.mainloop
a similar approach works fine with 'place' instead of pack. i tried
'
ack_propagate => false' in the call to 'TkRoot.new' - but that didn't work
either...
-a
--
ATTN: please update your address books with address below!
===============================================================================
| EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE :: 303.497.6469
| ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328
| STP :: http://www.ngdc.noaa.gov/stp/
| NGDC :: http://www.ngdc.noaa.gov/
| NESDIS :: http://www.nesdis.noaa.gov/
| NOAA :: http://www.noaa.gov/
| US DOC :: http://www.commerce.gov/
|
| The difference between art and science is that science is what we
| understand well enough to explain to a computer.
| Art is everything else.
| -- Donald Knuth, "Discover"
|
| /bin/sh -c 'for l in ruby perl;do $l -e "print \"\x3a\x2d\x29\x0a\"";done'
===============================================================================
big as my screen?
require 'tk'
tkroot = TkRoot.new
width = (tkroot.winfo_screenwidth * 0.5).to_i
height = (tkroot.winfo_screenheight * 0.5).to_i
tklabel = TkLabel.new :text => 'foobar'
tklabel.pack :expand => true, :fill => 'both'
tkroot.configure :width => width, :height => height
Tk.mainloop
a similar approach works fine with 'place' instead of pack. i tried
'
either...
-a
--
ATTN: please update your address books with address below!
===============================================================================
| EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE :: 303.497.6469
| ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328
| STP :: http://www.ngdc.noaa.gov/stp/
| NGDC :: http://www.ngdc.noaa.gov/
| NESDIS :: http://www.nesdis.noaa.gov/
| NOAA :: http://www.noaa.gov/
| US DOC :: http://www.commerce.gov/
|
| The difference between art and science is that science is what we
| understand well enough to explain to a computer.
| Art is everything else.
| -- Donald Knuth, "Discover"
|
| /bin/sh -c 'for l in ruby perl;do $l -e "print \"\x3a\x2d\x29\x0a\"";done'
===============================================================================