Image in Title Bar


#1

All,

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

  • Shelton

#2

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.
removed_email_address@domain.invalidwrote:


wxruby-users mailing list
removed_email_address@domain.invalid
http://rubyforge.org/mailman/listinfo/wxruby-users

http://dix-dix.blogspot.com/
101010 base 2 = 42 :slight_smile:
Dix ~=o)p

http://www.rquid.blogspot.com/
If you have some of time…Learn Ruby!


#3

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


#4

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: removed_email_address@domain.invalid
To: removed_email_address@domain.invalid
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. removed_email_address@domain.invalid
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
removed_email_address@domain.invalid
http://rubyforge.org/mailman/listinfo/wxruby-users

http://dix-dix.blogspot.com/
101010 base 2 = 42 :slight_smile:
Dix ~=o)p

http://www.rquid.blogspot.com/
If you have some of time…Learn Ruby!


#5

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


#6

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


#7

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