foxGUIb and the displaying of a dialogbox

View: New views
9 Messages — Rating Filter:   Alert me  

foxGUIb and the displaying of a dialogbox

by dglnz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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


Now I have tried this code

require 'sqlite3_calls.rb'
require 'monitordxlog'
require 'monitorscreen'

class Fxwindow_code < MainWindow

def initialize(parent)   
    super
    @mydb = Dbase.new
   
end

  def init
   
     #dialog = Fox::FxDialogBox.new( :@topwin) # or FX::DialogBox.new(mainwindow)
    @textfield1.connect(Fox::SEL_KEYRELEASE){     
      if @textfield1.text.length == 2 then   
          @parent=Fox::FXDialogBox(:@topwin)
          #@Dialog=DialogBox.new @parent
          #@Dialog.create       
          @Dialog.show(FOX::PLACEMENT_DEFAULT)
          @text2.text = '10 max chars only!!!'
       end

but know that i'm not the class isn't being called in properly as I've had the same error before and know that that was the cause then so will be now.

here are the errors for above code snippet.

>ruby mymainwin.rb
mymainwin.rb:18:in `init': undefined method `FXDialogBox' for Fox:Module (NoMethodError)
    from C:/Ruby1.8/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/responder2.rb:55:in `call'
    from C:/Ruby1.8/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/responder2.rb:55:in `onHandleMsg'
    from mymainwin.rb:56:in `run'
    from mymainwin.rb:56
>Exit code: 1

For this "VERSION" i get the GUI appear and things are okay until the 2nd character is entered then it crashes with the error code above.

I would like to keep on using foxGUI as it's good for graphically placing widgets on the window.

rgds,

dave.

Email slow, clunky, unreliable? Switch to Yahoo!Xtra Mail, New Zealand's new email address.
_______________________________________________
fxruby-users mailing list
fxruby-users@...
http://rubyforge.org/mailman/listinfo/fxruby-users

Re: foxGUIb and the displaying of a dialogbox

by Meinrad Recheis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Jul 13, 2009 at 11:34 AM, dave L <dglnz@...> 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

_______________________________________________
fxruby-users mailing list
fxruby-users@...
http://rubyforge.org/mailman/listinfo/fxruby-users

Parent Message unknown Re: foxGUIb and the displaying of a dialogbox

by dglnz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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@...> wrote:

> From: Meinrad Recheis <meinrad.recheis@...>
> Subject: Re: [fxruby-users] foxGUIb and the displaying of a dialogbox
> To: fxruby-users@...
> Received: Tuesday, 14 July, 2009, 5:31 AM
> On Mon, Jul 13,
> 2009 at 11:34 AM, dave L <dglnz@...>
> 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@...
> http://rubyforge.org/mailman/listinfo/fxruby-users


     
_______________________________________________
fxruby-users mailing list
fxruby-users@...
http://rubyforge.org/mailman/listinfo/fxruby-users

Parent Message unknown Re: foxGUIb and the displaying of a dialogbox

by dglnz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Okay so i've done a number of test and have found that this code snippet will give me a blank window in the top left of the screen.

  def init
   
     #dialog = Fox::FxDialogBox.new( :@topwin) # or FX::DialogBox.new(mainwindow)
    @textfield1.connect(Fox::SEL_KEYRELEASE){     
      if @textfield1.text.length == 2 then   
          @Dialog = FX::DialogBox.new @topwin
          @Dialog.create       
          @Dialog.show(FOX::PLACEMENT_DEFAULT)
          @text2.text = '10 max chars only!!!'
       end

  def init
   
     #dialog = Fox::FxDialogBox.new( :@topwin) # or FX::DialogBox.new(mainwindow)
    @textfield1.connect(Fox::SEL_KEYRELEASE){     
      if @textfield1.text.length == 2 then   
          @Dialog = FX::DialogBox.new @topwin
          @Dialog.create       
          @Dialog.show #(FOX::PLACEMENT_DEFAULT)
          @text2.text = '10 max chars only!!!'
       end

gives me a blank window no widgits visible!!!
if the comment (FOX::PLACEMENT_DEFAULT) is removed i get an error
referring to FOX then if i remove FOX:: i get an error referring to
PLACEMENT_DEFAULT.

so i am able to get A window opened with title for the window title.

Now i do have this code file called monitordxlogsel_seq and it differs only in the fact that it has no class OR module definition.

So i could just paste it directly into my event code and call it as part of the code OR try to LOAD it into the code so it would be treated as virtual code but I am being out smarted anyone able to give better pointers on correcting the problems and perhaps highlight any short comings of either approach?

# source generated by foxGUIb 1.0.0

FX::DialogBox.new(parent){|w|
    @dialogBox=w
    w.wdg_name='dialogBox'
    w.packingHints=98304
    w.width=356
    w.shown=true
    w.y=149
    w.height=238
    w.decorations=3276800
    w.layoutHints=3
    w.x=261

snippet ends*****

I have tried to do this....

require 'sqlite3_calls.rb'
require 'monitordxlogsel_seq'
require 'monitorscreen'

class Fxwindow_code < MainWindow

def initialize(parent)   
    super   
    @mydb = Dbase.new
   
end
#dialog = FOX::FXDialogBox.new( mainwindow) # or FX::DialogBox.new(mainwindow)
  def init
   
     #dialog = Fox::FxDialogBox.new( :@topwin) # or FX::DialogBox.new(mainwindow)
    @textfield1.connect(Fox::SEL_KEYRELEASE){     
      if @textfield1.text.length == 2 then   
          @Dialog = load do monitordxlogsel_seq end
          @Dialog.create       
          @Dialog.show
          @text2.text = '10 max chars only!!!'
       end
errors here are...

>ruby mymainwin.rb
./monitordxlogsel_seq.rb:3: uninitialized constant FX (NameError)
    from C:/Ruby1.8/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from C:/Ruby1.8/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from mymainwin.rb:2
>Exit code: 1

My aim was to try and pull the code from monitordxlogsel_seq into mymainwin code.
in fact i've just done this...

17      if @textfield1.text.length == 2 then   
18          @Dialog < class Monitordxlogsel_seq {load Monitordxlogsel_seq } end
19         @Dialog.create

and got these errors so must be getting closer to a solution.

>ruby mymainwin.rb
mymainwin.rb:18: syntax error, unexpected kEND, expecting tCOLON2 or '[' or '.'
>Exit code: 1

change line 18 to  @Dialog < class Monitordxlogsel_seq {load Monitordxlogsel_seq}

gives this error

>ruby mymainwin.rb
mymainwin.rb:18: syntax error, unexpected '\n', expecting tCOLON2 or '[' or '.'
>Exit code: 1

coding example would be great help too.

thanks

dave.

Reading this email at work? Make a change with Yahoo!Xtra Jobs
_______________________________________________
fxruby-users mailing list
fxruby-users@...
http://rubyforge.org/mailman/listinfo/fxruby-users

Re: foxGUIb and the displaying of a dialogbox

by Meinrad Recheis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Jul 14, 2009 at 11:19 AM, dave L <dglnz@...> wrote:
Okay so i've done a number of test and have found that this code snippet will give me a blank window in the top left of the screen.

  def init

   
     #dialog = Fox::FxDialogBox.new( :@topwin) # or FX::DialogBox.new(mainwindow)
    @textfield1.connect(Fox::SEL_KEYRELEASE){     
      if @textfield1.text.length == 2 then   
          @Dialog = FX::DialogBox.new @topwin
          @Dialog.create       
          @Dialog.show(FOX::PLACEMENT_DEFAULT)
          @text2.text = '10 max chars only!!!'
       end

  def init

   
     #dialog = Fox::FxDialogBox.new( :@topwin) # or FX::DialogBox.new(mainwindow)
    @textfield1.connect(Fox::SEL_KEYRELEASE){     
      if @textfield1.text.length == 2 then   
          @Dialog = FX::DialogBox.new @topwin
          @Dialog.create       
          @Dialog.show #(FOX::PLACEMENT_DEFAULT)
          @text2.text = '10 max chars only!!!'
       end

gives me a blank window no widgits visible!!!

of course it is blank, you haven't linked any widgets in. the label @text2 you might expect to be shown is not created with @Dialog as parent! build a dialog in foxguib how you want it to be and have a look, how *exactly* foxguib constructs the widget tree in the generated code. i have currently no time to look at the other problems you got. maybe later.
-- henon


_______________________________________________
fxruby-users mailing list
fxruby-users@...
http://rubyforge.org/mailman/listinfo/fxruby-users

Parent Message unknown Re: foxGUIb and the displaying of a dialogbox

by dglnz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


that is the thing!!!

I have done that - created a foxGUI and want to call that DialogBox as it is!

Namely 1 label with text put in it by me.
A button that does nothing - want to get one thing done at a time - gewt the dialogbox to appear.

Was thinking maybe I should do what i have for the MainWindow and mymainwin for the DialogBox ...

1. Got the foxGUI generated code in the file monitordxlog.rb this is CLASS based
code not a Sequence selected and generated code.

2. should I have a subclass file called sub_monitordxlog.rb this being the class I call and refer to in mymainwin code?

thinking about it i will try it out at home tonight.

anyone else on list able to help me out?

dave.

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

> From: Meinrad Recheis <meinrad.recheis@...>
> Subject: Re: [fxruby-users] foxGUIb and the displaying of a dialogbox
> To: fxruby-users@...
> Received: Tuesday, 14 July, 2009, 10:52 PM
> On Tue, Jul
> 14, 2009 at 11:19 AM, dave L <dglnz@...>
> wrote:
>
> Okay so i've done a number of test
> and have found that this code snippet will give me a blank
> window in the top left of the screen.
>
>
>   def init
>    
>      #dialog = Fox::FxDialogBox.new( :@topwin) # or
> FX::DialogBox.new(mainwindow)
>     @textfield1.connect(Fox::SEL_KEYRELEASE){     
>
>       if @textfield1.text.length == 2 then   
>
>           @Dialog = FX::DialogBox.new
> @topwin
>           @Dialog.create       
>          
> @Dialog.show(FOX::PLACEMENT_DEFAULT)
>           @text2.text = '10 max chars
>  only!!!'
>        end
>
>   def init
>    
>      #dialog = Fox::FxDialogBox.new( :@topwin) # or
> FX::DialogBox.new(mainwindow)
>     @textfield1.connect(Fox::SEL_KEYRELEASE){     
>
>       if @textfield1.text.length == 2 then   
>
>           @Dialog = FX::DialogBox.new
> @topwin
>           @Dialog.create       
>           @Dialog.show
> #(FOX::PLACEMENT_DEFAULT)
>           @text2.text = '10 max chars
> only!!!'
>        end
>
>
> gives me a blank window no widgits
> visible!!!
> of course it is blank, you haven't linked
> any widgets in. the label @text2 you might expect to be
> shown is not created with @Dialog as parent! build a dialog
> in foxguib how you want it to be and have a look, how
> *exactly* foxguib constructs the widget tree in the
> generated code. i have currently no time to look at the
> other problems you got. maybe later.
> -- henon
> Git# -->
> Git for .NET
>
>
> -----Inline Attachment Follows-----
>
> _______________________________________________
> fxruby-users mailing list
> fxruby-users@...
> http://rubyforge.org/mailman/listinfo/fxruby-users


     
_______________________________________________
fxruby-users mailing list
fxruby-users@...
http://rubyforge.org/mailman/listinfo/fxruby-users

Re: foxGUIb and the displaying of a dialogbox

by dglnz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Okay,

After some snooping and trails i have got
                - 1 file containing the foxGUI code in it.
                - 1 file with event handling code in it.

they are listed below.

# source generated by foxGUIb 1.0.0

class DialogBox
    def initialize( parent)
        construct_widget_tree( parent)
        init if respond_to? 'init'
    end
   
    def construct_widget_tree( parent)
        @topwin=
        FX::DialogBox.new(parent){|w|
            @dialogBox=w
            w.wdg_name='dialogBox'
            w.packingHints=98304
            w.width=380
            w.shown=true
            w.y=217
            w.height=366
            w.decorations=3276800
            w.title="test dialogBox"
            w.layoutHints=3
            w.x=220
            FX::Label.new(@dialogBox){|w|
                @label1=w
                w.wdg_name='label1'
                w.width=40
                w.height=21
            }
            FX::Button.new(@dialogBox){|w|
                @button1=w
                w.wdg_name='button1'
                w.width=40
                w.y=25
                w.height=21
            }
        }
    end
    attr_reader :topwin
    attr_reader :dialogBox
    attr_reader :label5
    attr_reader :button5
end


my event code  below

require 'monitordxlog'

class Mondialog < DialogBox

  def initialize(parent)   
    super
  end

  def init

        @button5.connect(Fox::SEL_COMMAND){
          ID_QUIT
         }
  end
 
 
end


#unit test
if __FILE__==$0
    require 'libGUIb16'
    app=FX::App.new
    w=DialogBox.new app
    w.topwin.show(Fox::PLACEMENT_SCREEN)
    app.create
    app.run
end

now running my event code WILL display a dialogbox BUT nothing happens when the button is clicked!!!

I have compared the code to my other one - mymainwin and to me they are the same in so far as the require dosen't have a .rb in it.

in the initialize i have parent as a parameter and super as a reference to the foxGUI code.

what am i missing? - Lye you able to help me on this?

is what i get after clicking on the X - close button on the title bar.

>ruby monitordxlog_evnts.rb
>Exit code: -1073741510

1 step closer to intergrating the dialogbox with my mainwindow program (I think)

Email slow, clunky, unreliable? Switch to Yahoo!Xtra Mail, New Zealand's new email address.
_______________________________________________
fxruby-users mailing list
fxruby-users@...
http://rubyforge.org/mailman/listinfo/fxruby-users

Re: foxGUIb and the displaying of a dialogbox

by dglnz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dam please note i have fixed an error in the code - button5 should be button1
and also the unit test within the foxGUI was leftout as it is the same as that in my event handling file - saving some lines of code too.

dave.

--- On Wed, 15/7/09, dave L <dglnz@...> wrote:

From: dave L <dglnz@...>
Subject: Re: [fxruby-users] foxGUIb and the displaying of a dialogbox
To: fxruby-users@...
Received: Wednesday, 15 July, 2009, 10:24 PM

Okay,

After some snooping and trails i have got
                - 1 file containing the foxGUI code in it.
                - 1 file with event handling code in it.

they are listed below.

# source generated by foxGUIb 1.0.0

class DialogBox
    def initialize( parent)
        construct_widget_tree( parent)
        init if respond_to? 'init'
    end
   
    def construct_widget_tree( parent)
        @topwin=
        FX::DialogBox.new(parent){|w|
            @dialogBox=w
            w.wdg_name='dialogBox'
            w.packingHints=98304
            w.width=380
            w.shown=true
            w.y=217
            w.height=366
            w.decorations=3276800
            w.title="test dialogBox"
            w.layoutHints=3
            w.x=220
            FX::Label.new(@dialogBox){|w|
                @label1=w
                w.wdg_name='label1'
                w.width=40
                w.height=21
            }
            FX::Button.new(@dialogBox){|w|
                @button1=w
                w.wdg_name='button1'
                w.width=40
                w.y=25
                w.height=21
            }
        }
    end
    attr_reader :topwin
    attr_reader :dialogBox
    attr_reader :label5
    attr_reader :button5
end


my event code  below

require 'monitordxlog'

class Mondialog < DialogBox

  def initialize(parent)   
    super
  end

  def init

        @button1.connect(Fox::SEL_COMMAND){
          ID_QUIT
         }
  end
 
 
end


#unit test
if __FILE__==$0
    require 'libGUIb16'
    app=FX::App.new
    w=DialogBox.new app
    w.topwin.show(Fox::PLACEMENT_SCREEN)
    app.create
    app.run
end

now running my event code WILL display a dialogbox BUT nothing happens when the button is clicked!!!

I have compared the code to my other one - mymainwin and to me they are the same in so far as the require dosen't have a .rb in it.

in the initialize i have parent as a parameter and super as a reference to the foxGUI code.

what am i missing? - Lye you able to help me on this?

is what i get after clicking on the X - close button on the title bar.

>ruby monitordxlog_evnts.rb
>Exit code: -1073741510

1 step closer to intergrating the dialogbox with my mainwindow program (I think)

Email slow, clunky, unreliable? Switch to Yahoo!Xtra Mail, New Zealand's new email address.

-----Inline Attachment Follows-----

_______________________________________________
fxruby-users mailing list
fxruby-users@...
http://rubyforge.org/mailman/listinfo/fxruby-users

Reading this email at work? Make a change with Yahoo!Xtra Jobs
_______________________________________________
fxruby-users mailing list
fxruby-users@...
http://rubyforge.org/mailman/listinfo/fxruby-users

Re: foxGUIb and the displaying of a dialogbox

by Meinrad Recheis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

def init
        @button5.connect(Fox::SEL_COMMAND){ # or @button1 as you said in the next mail
          @dialogBox.close
         }
  end

-- hth henon

On Wed, Jul 15, 2009 at 12:24 PM, dave L <dglnz@...> wrote:
Okay,

After some snooping and trails i have got
                - 1 file containing the foxGUI code in it.
                - 1 file with event handling code in it.

they are listed below.


# source generated by foxGUIb 1.0.0

class DialogBox
    def initialize( parent)
        construct_widget_tree( parent)
        init if respond_to? 'init'
    end
   
    def construct_widget_tree( parent)
        @topwin=

        FX::DialogBox.new(parent){|w|
            @dialogBox=w
            w.wdg_name='dialogBox'
            w.packingHints=98304
            w.width=380
            w.shown=true
            w.y=217
            w.height=366
            w.decorations=3276800
            w.title="test dialogBox"
            w.layoutHints=3
            w.x=220
            FX::Label.new(@dialogBox){|w|
                @label1=w
                w.wdg_name='label1'
                w.width=40
                w.height=21
            }
            FX::Button.new(@dialogBox){|w|
                @button1=w
                w.wdg_name='button1'
                w.width=40
                w.y=25
                w.height=21
            }
        }
    end
    attr_reader :topwin
    attr_reader :dialogBox
    attr_reader :label5
    attr_reader :button5
end


my event code  below

require 'monitordxlog'

class Mondialog < DialogBox

  def initialize(parent)   
    super
  end

  def init

        @button5.connect(Fox::SEL_COMMAND){
          ID_QUIT
         }
  end
 
 
end


#unit test
if __FILE__==$0
    require 'libGUIb16'
    app=FX::App.new
    w=DialogBox.new app
    w.topwin.show(Fox::PLACEMENT_SCREEN)
    app.create
    app.run
end

now running my event code WILL display a dialogbox BUT nothing happens when the button is clicked!!!

I have compared the code to my other one - mymainwin and to me they are the same in so far as the require dosen't have a .rb in it.

in the initialize i have parent as a parameter and super as a reference to the foxGUI code.

what am i missing? - Lye you able to help me on this?

is what i get after clicking on the X - close button on the title bar.

>ruby monitordxlog_evnts.rb
>Exit code: -1073741510

1 step closer to intergrating the dialogbox with my mainwindow program (I think)

Email slow, clunky, unreliable? Switch to Yahoo!Xtra Mail, New Zealand's new email address.

_______________________________________________
fxruby-users mailing list
fxruby-users@...
http://rubyforge.org/mailman/listinfo/fxruby-users


_______________________________________________
fxruby-users mailing list
fxruby-users@...
http://rubyforge.org/mailman/listinfo/fxruby-users