wxRuby and getting the display size

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

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 :wink:

hth
alex

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

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs