Image in Title Bar

All,

How do you display an image/icon in the title bar of a window? Thanks
in advance.

  • Shelton

Hi,

x < Wx::Frame
def initialize()
super
icon_file = File.join(, “help.ico”)
icon = Wx::Icon.new(icon_file, Wx::BITMAP_TYPE_ICO)
set_icon(icon)

On Fri, Apr 24, 2009 at 7:04 PM, Jason S.
[email protected]wrote:


wxruby-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wxruby-users

101010 base 2 = 42 :slight_smile:
Dix ~=o)p

If you have some of time…Learn Ruby!

Hi,

Follow the documentation
http://wxruby.rubyforge.org/doc/image.html
http://wxruby.rubyforge.org/wxrubydoc.html

Image#replace http://wxruby.rubyforge.org/doc/image.html#Image_replace
Image#resize http://wxruby.rubyforge.org/doc/image.html#Image_resize
Image#size http://wxruby.rubyforge.org/doc/image.html#Image_size
etc.

If I have an advice for you is to design your needed with WxFormBuilder.
That’s create for you an XRC.
Install gem wx_sugar
and create your based class etc.

you will win a lot of time, and it will be easiest because all your
designed
objects are created and you have just to change event & properties

All it explain in wiki
http://wxruby.rubyforge.org/wiki/wiki.pl?Using_GUI_Designers
http://wxruby.rubyforge.org/wiki/wiki.pl?WxSugar

Dix

Thanks for the response. Can you now tell me how to display an image on
a frame and/or window, and set the size and position of the image?
Thanks in advance for all assistance.

  • Shelton

Date: Sat, 25 Apr 2009 19:09:53 +0200
From: [email protected]
To: [email protected]
Subject: Re: [wxruby-users] Image in Title Bar

Hi,

x < Wx::Frame
def initialize()
super
icon_file = File.join(, “help.ico”)
icon = Wx::Icon.new(icon_file, Wx::BITMAP_TYPE_ICO)
set_icon(icon)

On Fri, Apr 24, 2009 at 7:04 PM, Jason S. [email protected]
wrote:

All,

How do you display an image/icon in the title bar of a window? Thanks
in advance.

  • Shelton

Windows Liveâ„¢ SkyDriveâ„¢: Get 25 GB of free online storage. Check it out.


wxruby-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wxruby-users

101010 base 2 = 42 :slight_smile:
Dix ~=o)p

If you have some of time…Learn Ruby!

Jason S. wrote:

Thanks for the response. Can you now tell me how to display an image
on a frame and/or window, and set the size and position of the image?
Thanks in advance for all assistance.

As well as Dix’s advice about using Wx::Image to size images, see also
the documentation for DC (Device Context, which handles all drawing on
screen), and Bitmap. There’s a number of relevant samples in
samples/drawing which show how to display an image on a Window.

a

Jason S. wrote:

I can get the image on the window, but I cannot get it to show on a
panel. Is this possible? If so, how? Thanks again.

Yes it is possible, the method is the same. What have you tried?

alex

I can get the image on the window, but I cannot get it to show on a
panel. Is this possible? If so, how? Thanks again.

  • Shelton