# wxRuby and getting the display size

**URL:** <https://www.ruby-forum.com/t/wxruby-and-getting-the-display-size/97798>\
**Category:** Ruby\
**Created:** [July 10, 2006, 5:22pm UTC](https://www.ruby-forum.com/t/wxruby-and-getting-the-display-size/97798 "2006-07-10T17:22:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ce73a5/32.png) [@tim](https://www.ruby-forum.com/u/tim)\
**Post date:** [July 10, 2006, 5:22pm UTC](https://www.ruby-forum.com/t/wxruby-and-getting-the-display-size/97798/1 "2006-07-10T17:22:53Z")

</div>

Hi, I’m using wxRuby v0.6.0 and am trying to get the size of the  
display. According to the wxWindows documentation, there’s a function  
wxGetDisplaySize() that will do what I want. Does wxRuby provide access  
to this function or is there another way to get this info? I tried  
Wx::get\_display\_size(), but that didn’t work.

Thanks in advance.

Tim

---

<div class="post-metadata">

**Author:** ![tim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ce73a5/32.png) [@tim](https://www.ruby-forum.com/u/tim)\
**Post date:** [July 10, 2006, 7:41pm UTC](https://www.ruby-forum.com/t/wxruby-and-getting-the-display-size/97798/2 "2006-07-10T19:41:59Z")

</div>

Hi Tim

> Hi, I’m using wxRuby v0.6.0 and am trying to get the size of the  
> display.

I’m pretty sure this functionality isn’t available in 0.6.0.

The comprehensive class Wx::SystemSettings is ported in wxruby2 which  
will get you the screen width & height. There is an example in  
samples/etc/system\_settings.rb of how to use the class, but basically  
you want something like:

Wx::SystemSettings.get\_metric(Wx::SYS\_SCREEN\_X)

ugly, I know 😉

hth  
alex

---

<div class="post-metadata">

**Author:** ![tim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ce73a5/32.png) [@tim](https://www.ruby-forum.com/u/tim)\
**Post date:** [July 11, 2006, 4:36pm UTC](https://www.ruby-forum.com/t/wxruby-and-getting-the-display-size/97798/3 "2006-07-11T16:36:42Z")

</div>

Thanks for the help, Alex. I’m trying to get wxRuby2 built on my  
system. It seems to be a non-trivial task on a PC system . . .

Tim

---

<div class="post-metadata">

**Author:** ![tim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ce73a5/32.png) [@tim](https://www.ruby-forum.com/u/tim)\
**Post date:** [July 11, 2006, 6:48pm UTC](https://www.ruby-forum.com/t/wxruby-and-getting-the-display-size/97798/4 "2006-07-11T18:48:09Z")

</div>

Tim wrote:

> Thanks for the help, Alex. I’m trying to get wxRuby2 built on my  
> system. It seems to be a non-trivial task on a PC system . . .

I’m sure it is - I have only built it on OS X & Linux where the tools  
(gcc, SWIG, Wx) are there or easily installed. The wxruby mailing list  
is a good place to get help on all platforms though.

I think getting a binary release esp for windows is the top priority for  
wxruby2 at the moment, but temporarily stalled b/c of developers’ other  
commitments. Personally I plan to get back to sending in small patches  
pretty soon, now the football’s finished and the sun will stop shining  
outside

a
