Hi Meinrad
I have included the call you mentioned in the funcion
connect and i get the error:
@topwin.handle(@button, FXSEL(Fox::SEL_COMMAND,
Fox::FXDialogBox::ID_ACCEPT), nil)
undefined method `FXSEL’ for #DialogBox:0x7f5e230
I have also seen mention of using something like:
getApp().stopModal(@topwin, 1)
@topwin.hide
But didn’t work for me either
I have included all the code created by the FoxGUIb,
hoping it could make things clearer.
Thanks again !
Eduardo
source generated by foxGUIb 0.7.1
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.width=137
w.shown=true
w.y=472
w.height=125
w.title="TrackerPod Data"
w.x=-543
FX::HorizontalFrame.new(@dialogBox){|w|
@horizontalframe3=w
w.wdg_name='horizontalframe3'
w.width=137
w.height=30
w.layoutHints=1536
FX::Label.new(@horizontalframe3){|w|
@label_dialog_title=w
w.wdg_name='label_dialog_title'
w.text="TRACKER POD DATA:"
w.font=FX::Font.new.from_s(‘Tahoma|100|70|5|0|0|0’).to_FXFont
w.width=137
w.y=5
w.height=20
w.layoutHints=40
}
}
FX::HorizontalFrame.new(@dialogBox){|w|
@horizontalframe2=w
w.wdg_name=‘horizontalframe2’
w.width=137
w.y=34
w.height=57
w.layoutHints=1024
FX::VerticalFrame.new(@horizontalframe2){|w|
@verticalframe4=w
w.wdg_name=‘verticalframe4’
w.width=56
w.height=57
FX::Label.new(@verticalframe4){|w|
@label_lat=w
w.wdg_name=‘label_lat’
w.text=“Lat:”
w.width=23
w.height=17
}
FX::Label.new(@verticalframe4){|w|
@label_lon=w
w.wdg_name=‘label_lon’
w.text=“Lon:”
w.width=25
w.y=17
w.height=17
}
FX::Label.new(@verticalframe4){|w|
@label_heading=w
w.wdg_name=‘label_heading’
w.text=“Heading:”
w.width=47
w.y=34
w.height=17
}
}
FX::VerticalFrame.new(@horizontalframe2){|w|
@verticalframe6=w
w.wdg_name=‘verticalframe6’
w.width=81
w.height=57
w.x=56
FX::TextField.new(@verticalframe6){|w|
@textfield_lat=w
w.wdg_name=‘textfield_lat’
w.width=66
w.height=19
w.numColumns=10
}
FX::TextField.new(@verticalframe6){|w|
@textfield_lon=w
w.wdg_name=‘textfield_lon’
w.width=66
w.y=19
w.height=19
w.numColumns=10
}
FX::TextField.new(@verticalframe6){|w|
@textfield_heading=w
w.wdg_name=‘textfield_heading’
w.width=66
w.y=38
w.height=19
w.numColumns=10
}
}
}
FX::HorizontalFrame.new(@dialogBox){|w|
@horizontalframe4=w
w.wdg_name=‘horizontalframe4’
w.width=137
w.y=95
w.height=30
w.layoutHints=3584
FX::VerticalFrame.new(@horizontalframe4){|w|
@verticalframe7=w
w.wdg_name=‘verticalframe7’
w.width=47
w.height=30
FX::Button.new(@verticalframe7){|w|
@button_ok=w
w.wdg_name=‘button_ok’
w.text=“Ok”
w.width=21
w.y=4
w.height=21
w.layoutHints=40
w.x=13
@button_ok.connect(Fox::SEL_COMMAND){
lat = textfield_lat.text
lon = textfield_lon.text
heading = textfield_heading.text
#No idea how to close the window. something
about ID_ACCEPT
#@topwin.handle(nil,MKUINT(w::ID_ACCEPT,SEL_COMMAND),nil)
#@topwin.handle(@button_ok,
FXINT(Fox::SEL_COMMAND,Fox::FXDialogBox::ID_ACCEPT),
nil)
@topwin.handle(@button_ok,
FXSEL(Fox::SEL_COMMAND,Fox::FXDialogBox::ID_ACCEPT),
nil)
#getApp().stopModal(@topwin, 1)
#@topwin.hide
}
}
}
FX::VerticalFrame.new(@horizontalframe4){|w|
@verticalframe9=w
w.wdg_name='verticalframe9'
w.width=90
w.height=30
w.x=47
FX::Button.new(@verticalframe9){|w|
@button_cancel=w
w.wdg_name='button_cancel'
w.text="Cancel"
w.width=40
w.y=4
w.height=21
w.layoutHints=40
w.x=25
}
}
}
}
end
attr_reader :topwin
attr_reader :dialogBox
attr_reader :horizontalframe3
attr_reader :label_dialog_title
attr_reader :horizontalframe2
attr_reader :verticalframe4
attr_reader :label_lat
attr_reader :label_lon
attr_reader :label_heading
attr_reader :verticalframe6
attr_reader :textfield_lat
attr_reader :textfield_lon
attr_reader :textfield_heading
attr_reader :horizontalframe4
attr_reader :verticalframe7
attr_reader :button_ok
attr_reader :verticalframe9
attr_reader :button_cancel
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
All new Yahoo! Mail “The new Interface is stunning in its simplicity and
ease of use.” - PC Magazine
http://uk.docs.yahoo.com/nowyoucan.html