[fxruby-users] foxGUIb - how do you insert a title bar icon?

Meinrad Recheis meinrad.recheis at gmail.com
Tue Mar 23 16:52:24 EDT 2010


hi,
I just looked up the code in an old project of mine. this is the code I used
to configure the main window icons:

        @topwin.icon = loadImage "appicon32.png"
        @topwin.miniIcon = loadImage "appicon.png"

loadImage is defined in libguib16 afaik.

-- henon

On Tue, Mar 23, 2010 at 5:01 PM, Paul Carvalho <tester.paul at gmail.com>wrote:

> On 23 March 2010 11:33, Meinrad Recheis wrote:
>
>> Wait, maybe I got you wrong.
>> Mind this: foxguib is generating FXRuby code so why should you not be able
>> to set the icon as you said you know how to do it using plain FXRuby. Maybe
>> this is a problem about calling the icon's "create" method at the wrong time
>> or not at all?
>>
>> I am afraid without detailed error messages I can not help out here.
>>
>> -- henon
>>
>>
> Since I don't know where & how to set the icon with the FoxGUIb code, I
> don't know which error messages you would be interested in.  All you have to
> do is generate a quick window and try to set the image.
>
> Here's a sample window.  How would you display an icon in the title bar?
>
> # source generated by foxGUIb 1.0.0
>
> class MainWindow
>     def initialize( parent)
>         construct_widget_tree( parent)
>         init if respond_to? 'init'
>     end
>
>     def construct_widget_tree( parent)
>         @topwin=
>         FX::MainWindow.new(parent){|w|
>             @mainWindow=w
>             w.wdg_name='mainWindow'
>             w.width=336
>             w.shown=true
>             w.y=265
>             w.height=183
>             w.title="show title bar image"
>             w.x=47
>         }
>     end
>     attr_reader :topwin
>     attr_reader :mainWindow
> end
>
> #unit test
> if __FILE__==$0
>     require 'libGUIb16'
>     app=FX::App.new
>     w=MainWindow.new app
>     w.topwin.show(Fox::PLACEMENT_SCREEN)
>     app.create
>     app.run
> end
>
>
>
>
> _______________________________________________
> fxruby-users mailing list
> fxruby-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/fxruby-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/fxruby-users/attachments/20100323/fd170ded/attachment.html>


More information about the fxruby-users mailing list