Paul Carvalho
2010-Mar-23 03:36 UTC
[fxruby-users] foxGUIb - how do you insert a title bar icon?
I''ve been guessing at this for a few hours now with no luck. Using FoxGUIb, how do you add an icon/image to the title bar of the MainWindow? I know a few ways to do this using FXRuby, but I can''t get it with the FoxGUIb-generated UI. TIA. Paul. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/fxruby-users/attachments/20100322/ca7a4ce7/attachment.html>
Meinrad Recheis
2010-Mar-23 09:44 UTC
[fxruby-users] foxGUIb - how do you insert a title bar icon?
Hi Paul, Just, do it as you would do it with FXRuby using the instance of the FXRuby mainwindow. IIRC a variable called @topwin is generated by foxguib where you can access it. -- henon On Tue, Mar 23, 2010 at 4:36 AM, Paul Carvalho <tester.paul at gmail.com>wrote:> I''ve been guessing at this for a few hours now with no luck. > > Using FoxGUIb, how do you add an icon/image to the title bar of the > MainWindow? > > I know a few ways to do this using FXRuby, but I can''t get it with the > FoxGUIb-generated UI. > > TIA. Paul. > > > _______________________________________________ > 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/d7aa8122/attachment-0001.html>
Paul Carvalho
2010-Mar-23 14:19 UTC
[fxruby-users] foxGUIb - how do you insert a title bar icon?
On 23 March 2010 05:44, Meinrad Recheis wrote:> Hi Paul, > Just, do it as you would do it with FXRuby using the instance of the FXRuby > mainwindow. IIRC a variable called @topwin is generated by foxguib where you > can access it. > -- henon >umm, I''m afraid I don''t understand this advice. I tried modifying the construct_widget_tree method to include a "w.icon" property for the mainwindow, but it didn''t work. (I guessed, oh well.) I tried adding "setIcon()" in the initialize and init methods but just got different errors. Can you give an example in a line or two of how you can do this? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/fxruby-users/attachments/20100323/d1f4ea7e/attachment.html>
Meinrad Recheis
2010-Mar-23 15:27 UTC
[fxruby-users] foxGUIb - how do you insert a title bar icon?
Ah, I see, you expect foxguib to generate the right code for you ;) ... I am afraid that isn''t so easy, and I have forgotten about foxguib''s internals totally. I was talking about setting the icon later in your hand coded extensions to the generated code. hth, -- henon On Tue, Mar 23, 2010 at 3:19 PM, Paul Carvalho <tester.paul at gmail.com>wrote:> On 23 March 2010 05:44, Meinrad Recheis wrote: > >> Hi Paul, >> Just, do it as you would do it with FXRuby using the instance of the >> FXRuby mainwindow. IIRC a variable called @topwin is generated by foxguib >> where you can access it. >> -- henon >> > > umm, I''m afraid I don''t understand this advice. > > I tried modifying the construct_widget_tree method to include a "w.icon" > property for the mainwindow, but it didn''t work. (I guessed, oh well.) I > tried adding "setIcon()" in the initialize and init methods but just got > different errors. > > Can you give an example in a line or two of how you can do this? > > Thanks. > > > _______________________________________________ > 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/16980295/attachment.html>
Meinrad Recheis
2010-Mar-23 15:33 UTC
[fxruby-users] foxGUIb - how do you insert a title bar icon?
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 On Tue, Mar 23, 2010 at 4:27 PM, Meinrad Recheis <meinrad.recheis at gmail.com>wrote:> Ah, I see, you expect foxguib to generate the right code for you ;) ... I > am afraid that isn''t so easy, and I have forgotten about foxguib''s internals > totally. > > I was talking about setting the icon later in your hand coded extensions to > the generated code. > > hth, > -- henon > > On Tue, Mar 23, 2010 at 3:19 PM, Paul Carvalho <tester.paul at gmail.com>wrote: > >> On 23 March 2010 05:44, Meinrad Recheis wrote: >> >>> Hi Paul, >>> Just, do it as you would do it with FXRuby using the instance of the >>> FXRuby mainwindow. IIRC a variable called @topwin is generated by foxguib >>> where you can access it. >>> -- henon >>> >> >> umm, I''m afraid I don''t understand this advice. >> >> I tried modifying the construct_widget_tree method to include a "w.icon" >> property for the mainwindow, but it didn''t work. (I guessed, oh well.) I >> tried adding "setIcon()" in the initialize and init methods but just got >> different errors. >> >> Can you give an example in a line or two of how you can do this? >> >> Thanks. >> >> >> _______________________________________________ >> 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/31665415/attachment.html>
Paul Carvalho
2010-Mar-23 16:01 UTC
[fxruby-users] foxGUIb - how do you insert a title bar icon?
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 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/fxruby-users/attachments/20100323/9ec43205/attachment.html>
Meinrad Recheis
2010-Mar-23 20:52 UTC
[fxruby-users] foxGUIb - how do you insert a title bar icon?
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>
Paul Carvalho
2010-Mar-23 21:15 UTC
[fxruby-users] foxGUIb - how do you insert a title bar icon?
That''s awesome! Totally helps. Thanks! I love how you can associate a large and small icon with the app at the same time. Didn''t know that. Cool! Cheers! Paul. On 23 March 2010 16:52, Meinrad Recheis wrote:> 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 >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/fxruby-users/attachments/20100323/4316dd69/attachment-0001.html>