Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
wxRuby setting the Frame's icon - getting started example
7stud --
3/24/2009 11:05:00 AM
The following is a simplified example from the wxRuby wiki here:
http://wxruby.rubyforge.org/wiki/wiki....
(Part_1)
It's the second example in the wxRuby tutorial entitled "Getting
Started". However, I don't seen any icon when I run the code on mac osx
10.4.11.
require 'rubygems'
require 'wx'
class IconFrame < Wx::Frame
def initialize
super(nil, -1, "Changing Icons", Wx::DEFAULT_POSITION,
Wx::Size.new(300, 200)
)
set_icon(Wx::Icon.new("./icons/DataHD.png"))
show
end
end
class MinimalApp < Wx::App
def on_init
IconFrame.new
end
end
MinimalApp.new.main_loop
I also tried using some .ico files in set_icon(), but I don't see them
anywhere.
--
Posted via
http://www.ruby-...
.
2 Answers
Alex Fenton
3/24/2009 11:45:00 AM
0
7stud -- wrote:
> The following is a simplified example from the wxRuby wiki here:
>
>
http://wxruby.rubyforge.org/wiki/wiki....
(Part_1)
>
> It's the second example in the wxRuby tutorial entitled "Getting
> Started". However, I don't seen any icon when I run the code on mac osx
> 10.4.11.
Frames in the OS X desktop don't have icons - not in the same way as
Windows has per-frame icons in the top-left corner.
If you want to set an application-wide icon to appear in the Dock, use
Wx::TaskBarIcon. There's an example of this in the bigdemo.rb sample
that comes with wxRuby.
PS - wxRuby questions are better on the wxruby-users mailing list:
http://wxruby.rubyforge.org/wiki/wiki.pl?Ma...
http://www.ruby-forum.co...
a
7stud --
3/24/2009 12:07:00 PM
0
Alex Fenton wrote:
> 7stud -- wrote:
>> The following is a simplified example from the wxRuby wiki here:
>>
>>
http://wxruby.rubyforge.org/wiki/wiki....
(Part_1)
>>
>> It's the second example in the wxRuby tutorial entitled "Getting
>> Started". However, I don't seen any icon when I run the code on mac osx
>> 10.4.11.
>
> Frames in the OS X desktop don't have icons - not in the same way as
> Windows has per-frame icons in the top-left corner.
>
> If you want to set an application-wide icon to appear in the Dock, use
> Wx::TaskBarIcon. There's an example of this in the bigdemo.rb sample
> that comes with wxRuby.
>
> PS - wxRuby questions are better on the wxruby-users mailing list:
>
>
http://wxruby.rubyforge.org/wiki/wiki.pl?Ma...
>
http://www.ruby-forum.co...
>
Thanks for the response. Ok. Maybe the wiki should mention that?
By the way, did you see my results here:
http://www.ruby-...
topic/...
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
wxRuby setting the Frame's icon - getting started example
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password