# How to find out the resolution of the monitor before starting a Ruby-Gnome widget?

**URL:** <https://www.ruby-forum.com/t/how-to-find-out-the-resolution-of-the-monitor-before-starting-a-ruby-gnome-widget/234763>\
**Category:** Ruby-Gnome 2\
**Created:** [March 27, 2015, 9:53pm UTC](https://www.ruby-forum.com/t/how-to-find-out-the-resolution-of-the-monitor-before-starting-a-ruby-gnome-widget/234763 "2015-03-27T21:53:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [March 27, 2015, 9:53pm UTC](https://www.ruby-forum.com/t/how-to-find-out-the-resolution-of-the-monitor-before-starting-a-ruby-gnome-widget/234763/1 "2015-03-27T21:53:08Z")

</div>

Hi,

I wish to set the start-size of my widget to 80% of width and height.

But for this, I need to know the resolution of the computer.

Is this doable?

---

<div class="post-metadata">

**Author:** ![quik77](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/q/dec6dc/32.png) [@quik77](https://www.ruby-forum.com/u/quik77)\
**Post date:** [March 27, 2015, 9:55pm UTC](https://www.ruby-forum.com/t/how-to-find-out-the-resolution-of-the-monitor-before-starting-a-ruby-gnome-widget/234763/2 "2015-03-27T21:55:03Z")

</div>

Found it in the API docu:

x = Gdk::Screen.default  
x.width  
x.height
