Forum: wxRuby Image in Title Bar

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Jason S. (Guest)
on 2009-04-25 11:33
(Received via mailing list)
All,



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



- Shelton
Dix Dix (Guest)
on 2009-04-25 21:34
(Received via mailing list)
Hi,

x < Wx::Frame
  def initialize()
    super
    icon_file = File.join(<path>, "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:

> _______________________________________________
> 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 :)
Dix ~=o)p

http://www.rquid.blogspot.com/
If you have some of time...Learn Ruby!
Jason S. (Guest)
on 2009-04-29 20:21
(Received via mailing list)
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(<path>, "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 :)
Dix ~=o)p

http://www.rquid.blogspot.com/
If you have some of time...Learn Ruby!
Dix Dix (Guest)
on 2009-04-29 21:12
(Received via mailing list)
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
Alex F. (Guest)
on 2009-04-29 21:15
(Received via mailing list)
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. (Guest)
on 2009-04-30 00:14
(Received via mailing list)
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
Alex F. (Guest)
on 2009-04-30 01:31
(Received via mailing list)
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
This topic is locked and can not be replied to.