# Ruby draw fullscreen windows

**URL:** <https://www.ruby-forum.com/t/ruby-draw-fullscreen-windows/57975>\
**Category:** Ruby\
**Created:** [April 17, 2006, 12:30pm UTC](https://www.ruby-forum.com/t/ruby-draw-fullscreen-windows/57975 "2006-04-17T12:30:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RedShift](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/bbce88/32.png) [@RedShift](https://www.ruby-forum.com/u/RedShift)\
**Post date:** [April 17, 2006, 12:30pm UTC](https://www.ruby-forum.com/t/ruby-draw-fullscreen-windows/57975/1 "2006-04-17T12:30:40Z")

</div>

Hello

Seeing the current state of “mediacenter” software, I decided to write  
my own. For playing multimedia, I decided on xine-lib using  
[http://xiron.sourceforge.net/](http://xiron.sourceforge.net/)

I still need one thing though, something to draw windows with. Like GTK,  
QT, TK, etc… Easily skinnable would be nice. It should also be easy to  
control by keyboard, the goal of the GUI is that it can be used with  
only four arrow keys (up, down, left, right) and an enter button. And it  
should be able to draw windows fullscreen without borders. Any  
suggestions?

I would also like to know if it were able to access v4l (video for  
linux) devices from ruby, this thing has got to be able to make use of a  
TV card.

Thanks

Glenn

---

<div class="post-metadata">

**Author:** ![RedShift](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/bbce88/32.png) [@RedShift](https://www.ruby-forum.com/u/RedShift)\
**Post date:** [April 20, 2006, 4:03pm UTC](https://www.ruby-forum.com/t/ruby-draw-fullscreen-windows/57975/2 "2006-04-20T16:03:35Z")

</div>

From: RedShift [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: Ruby draw fullscreen windows  
Date: Mon, 17 Apr 2006 19:28:42 +0900  
Message-ID: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> I still need one thing though, something to draw windows with. Like GTK,  
> QT, TK, etc…

In the case of Ruby/Tk,

> ```
> Easily skinnable would be nice. 
> 
> ```

Maybe, Tile extension is useful for customizable skin.

> ```
> It should also be easy to 
> 
> ```
> 
> control by keyboard, the goal of the GUI is that it can be used with  
> only four arrow keys (up, down, left, right) and an enter button.

## For example,

require ‘tk’

btag = TkBindTag.new

widgets = (0…4).collect{|y|  
f = TkFrame.new.pack  
(0…6).collect{|x|  
b = TkButton.new(f, :text=\>“(#{x},#{y})”,  
:command=\>proc{puts “press (#{x},#{y})”},  
:takefocus=\>true).pack(:side=\>:left)  
b.bindtags\_unshift(btag)  
b.instance\_variable\_set(‘@coords’, [x, y])  
b  
}  
}

btag.bind(‘Return’, proc{|w| w.invoke}, ‘%W’)  
btag.bind(‘FocusIn’, proc{|w| w.state(‘active’)}, ‘%W’)  
btag.bind(‘FocusOut’, proc{|w| w.state(‘normal’)}, ‘%W’)  
btag.bind(‘Left’, proc{|w|  
x, y = w.instance\_variable\_get(‘@coords’)  
size = widgets[y].size  
widgets[y][(x+size-1)%size].focus  
}, ‘%W’)  
btag.bind(‘Right’, proc{|w|  
x, y = w.instance\_variable\_get(‘@coords’)  
size = widgets[y].size  
widgets[y][(x+1)%size].focus  
}, ‘%W’)  
btag.bind(‘Up’, proc{|w|  
x, y = w.instance\_variable\_get(‘@coords’)  
size = widgets.size  
widgets[(y+size-1)%size][x].focus  
}, ‘%W’)  
btag.bind(‘Down’, proc{|w|  
x, y = w.instance\_variable\_get(‘@coords’)  
size = widgets.size  
widgets[(y+1)%size][x].focus  
}, ‘%W’)

widgets[0][0].focus

## Tk.mainloop

> ```
> And it 
> 
> ```
> 
> should be able to draw windows fullscreen without borders. Any suggestions?

## For example,

## requrie ‘tk’ TkButton.new(:text=\>‘quit’, :command=\>proc{exit}).pack r = Tk.root r.withdraw r.overrideredirect = true r.deiconify r.geometry = “#{r.winfo\_screenwidth}x#{r.winfo\_screenheight}+0+0” Tk.mainloop

# On windows, “Tk.root.state = ‘zoomed’” is useful.
