[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

wxRuby and getting the display size

Tim

7/10/2006 3:19:00 PM

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

3 Answers

Alex Fenton

7/10/2006 5:39:00 PM

0

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

Tim

7/11/2006 2:31:00 PM

0

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

Alex Fenton wrote:
> 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

Alex Fenton

7/11/2006 4:41:00 PM

0

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