[fxruby-users] foxGUIb and the displaying of a dialogbox

dave L dglnz at yahoo.com
Mon Jul 13 21:31:45 EDT 2009


Hi Meinrad,

Yes it's not shown here but i did try that too.

The errors where reduced to 1 or 2 lines.
I will when i get home tonight do this excercise again and post the error/s generated but still reflects 
the fact that i'm not doing something right because it points to the @topwin, :@topwin,mainWindow.topwin as being an undefined method.

I noticed in the example 7 code that the creation of the dialog object points to the class but when i tried that i again got errors so thought best to post what i did looking for someone to say ....

Oh ya yo've gotta do @dailogbox = Fox::fxdialog.new(....)

as said will post in another email further code and the errors i get and hopefully it'll be an light turning on for someone who can then show me my error.

cheers,

Dave.

 
--- On Tue, 14/7/09, Meinrad Recheis <meinrad.recheis at gmail.com> wrote:

> From: Meinrad Recheis <meinrad.recheis at gmail.com>
> Subject: Re: [fxruby-users] foxGUIb and the displaying of a dialogbox
> To: fxruby-users at rubyforge.org
> Received: Tuesday, 14 July, 2009, 5:31 AM
> On Mon, Jul 13,
> 2009 at 11:34 AM, dave L <dglnz at yahoo.com>
> wrote:
> 
> Hi folks,
> 
> Using foxGUI for the graphical layout of my user screen.
> 
> And have another file for the event handling.
> 
> I am very new to FXRuby and have asked Meinrad for advise
> off list but so far i've failed to grasp things.
> 
> below is a snippet of code from my event handling file and
> would like advice as to fixing the current errors for that.
> 
> 
> I have read but don't full understand the code for
> example 7 - dialogbox in so far as how it links to mine.
> 
> 
> 
> require 'sqlite3_calls.rb'
> require 'monitordxlog'
> require 'monitorscreen'
> 
> 
> class Fxwindow_code < MainWindow
> 
> def initialize(parent)    
>     super    
> 
> # the 3 lines below i saw in Meinrads code for docman.rb so
> thought to try it out.
>     @parent=DialogBox.topwin
>    
>  @Dialog=DialogBox.new @parent
>     @Dialog.create
>     @mydb = Dbase.new
>     
> end
> 
>   def init
>            # sample code given to me by Meinrad as
> being possibly correct
>            # I've tried both variants -
> Fox::FX....  and FX::D... both failing to display the
> 
>            # dialogbox.
>      #dialog = Fox::FxDialogBox.new( :@topwin) # or
> FX::DialogBox.new(mainwindow)
>     @textfield1.connect(Fox::SEL_KEYRELEASE){     
> 
>       if @textfield1.text.length == 2
> then          
> 
>          
>  @Dialog.show(FOX::PLACEMENT_DEFAULT)
>           @text2.text = '10 max chars
> only!!!'
>        end
>        
> errors are 
> 
> >ruby mymainwin.rb
> C:/Ruby1.8/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/kwargs.rb:647:in
> `old_initialize': No matching function for overloaded
> 'new_FXDialogBox' (ArgumentError)
> 
>     from
> C:/Ruby1.8/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/kwargs.rb:647:in
> `initialize'
>     from
> C:/Ruby1.8/lib/ruby/site_ruby/1.8/libGUIb16.rb:446:in
> `initialize'
>     from ./monitordxlog.rb:11:in `new'
> 
>     from ./monitordxlog.rb:11:in
> `construct_widget_tree'
>     from ./monitordxlog.rb:5:in `initialize'
>     from mymainwin.rb:10:in `new'
>     from mymainwin.rb:10:in
>  `initialize'
>     from mymainwin.rb:53:in `new'
>     from mymainwin.rb:53
> >Exit code: 1
> 
> it should be @topwin (a foxguib generated
> instance variale pointing to the top most widget of a
> foxguib class), not :@topwin which is simply a symbol.
> 
> -- henon
> 
> -----Inline Attachment Follows-----
> 
> _______________________________________________
> fxruby-users mailing list
> fxruby-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/fxruby-users


      


More information about the fxruby-users mailing list