Ich bin gerade dabei für mein Programm eine GUI zu bauen und hatte mir den GUIbuilder "foxGUIb" herrunter geladen. Damit habe ich ein MainWindow und eine DialogBox gebaut, nun wollte ich die DialogBox als AboutFenster einbinden. Insofern hat ja alles funktioniert das was mein Problem ist, das beim Schließen der DialogBox mein ganzes Programm abstürtzt.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
|
class DialogBox<MainWindow
def construct_widget_tree( parent) @topwin= FX::DialogBox.new(parent){|d| @dialogBox=d d.wdg_name='dialogBox' d.backColor=Fox::FXRGBA(255,255,255,255) d.enabled=false d.padLeft=5 d.width=140
d.padRight=5 d.shown=true d.y=367 d.height=150
d.padBottom=5 d.decorations=8519680
d.title="\303\234ber..." d.padTop=5 d.layoutHints=768 d.x=337 FX::HorizontalFrame.new(@dialogBox){|d| @horizontalframe1=d d.wdg_name='horizontalframe1' d.enabled=false d.width=132 d.y=5 d.height=113 d.x=5 FX::VerticalFrame.new(@horizontalframe1){|d| @verticalframe1=d d.wdg_name='verticalframe1' d.backColor=Fox::FXRGBA(255,255,255,255) d.width=132 d.height=113 FX::Text.new(@verticalframe1){|d| @text4=d d.wdg_name='text4' d.text=" text" d.enabled=false d.textTextStyle=1048576 d.width=132 d.height=70 } FX::HorizontalFrame.new(@verticalframe1){|d| @horizontalframe6=d d.wdg_name='horizontalframe6' d.backColor=Fox::FXRGBA(255,255,255,255) d.padLeft=40 d.width=132 d.y=70 d.height=43 d.padBottom=5 d.padTop=5 FX::Button.new(@horizontalframe6){|d| @bclose=d d.wdg_name='bclose' d.text="schliessen" d.width=56 d.y=5 d.height=21 d.x=40 @bclose.connect(Fox::SEL_COMMAND){ load Dir.glob("MainWindow.rb").to_s $status=1 exit 1 } } } } } } end attr_reader :topwin attr_reader :dialogBox attr_reader :horizontalframe1 attr_reader :verticalframe1 attr_reader :text4 attr_reader :horizontalframe6 attr_reader :bclose end
if __FILE__==$0 require 'libGUIb16' app=FX::App.new d=DialogBox.new app d.topwin.show(Fox::PLACEMENT_SCREEN) app.create app.run end
|
hier der aufruf der Dialogbox aus dem Hauptfenster:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
FX::MenuTitle.new(@menubar3){|w| @mHelp=w w.wdg_name='mHelp' w.text="Hilfe" w.backColor=Fox::FXRGBA(255,193,37,255) w.width=33 w.selBackColor=Fox::FXRGBA(205,155,29,255) w.y=2 w.height=17 w.x=44 FX::MenuPane.new(@mHelp){|w| @menupane6=w w.wdg_name='menupane6' w.backColor=Fox::FXRGBA(205,155,29,255) w.width=62 w.y=316 w.height=22 w.x=432 FX::MenuCommand.new(@menupane6){|w| @info=w w.wdg_name='info' w.text="Info" w.backColor=Fox::FXRGBA(255,193,37,255) w.width=58 w.y=2 w.height=18 w.x=2 @info.connect(Fox::SEL_COMMAND){ $status=2 load Dir.glob("gui__dialogBox.rb").to_s if $status==2 FX::DialogBox.new(parent){|d| @db=FX::App.new d=DialogBox.new @db d.topwin.show(Fox::PLACEMENT_SCREEN) @db.create
} end } } } }
|
den Fehler den ich beim schliessen bekomme ist
"./gui__dialogBox.rb:75: [BUG] Segmentation fault
ruby 1.8.6 (2007-09-24) [i386-mswin32]"
Es wäre Schön wenn mir jemand helfen könnte. THX schon mal im voraus.