R
Rich
I'm wanting to not get the error - 'SystemStackError' ...
Here's my code:
require 'fox'
include Fox
theApp=FXApp.new
mainwin=FXMainWindow.new(theApp, "My
X.N.",nil,nil,DECOR_ALL,10,10,600,600,0,4,0,4)
mb=FXMenubar.new(mainwin,LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_FILL_X,0,0,0,0,0,0,0,
0)
fm=FXMenuPane.new(mb)
FXMenuCommand.new(fm,"&Quit\tCtl-Q",nil,theApp,FXApp::ID_QUIT);
FXMenuTitle.new(mb,"&File",nil,fm);
hf=FXHorizontalFrame.new(mainwin,LAYOUT_SIDE_TOP|FRAME_NONE|LAYOUT_FILL_X|LA
YOUT_FILL_Y|PACK_UNIFORM_WIDTH)
$tl=FXTreeList.new(hf,1,nil,0,LAYOUT_FILL_X|LAYOUT_FILL_Y|TREELIST_SHOWS_LIN
ES|TREELIST_SHOWS_BOXES|TREELIST_ROOT_BOXES)
$x=File.open("002.xml")
def populateDisplay(pi)
if(!$x.eof)
l=$x.gets.strip
if(l=="" || l.include?("<!")) then l="<WHITESPACE/>" end
c=$tl.addItemLast(pi,l)
if(l.index("</")==0 || l=="<WHITESPACE/>") then c.text="" end
if(!l.include?("/"))
populateDisplay(c)
else
if(l.strip.index("</")==0)
if(c.parent!=nil) then populateDisplay(c.parent.parent) end
else
populateDisplay(c.parent)
end
end
end
end
c=$tl.addItemLast(nil,$x.gets.strip)
begin # I don't want to have to put this in
populateDisplay(c)
rescue SystemStackError # I don't want to have to put this in
end # I don't want to have to put this in
FXTooltip.new(theApp)
theApp.create
mainwin.show(PLACEMENT_SCREEN)
theApp.run
Suggestions? (Remember - I'm a hobbyist programmer, so please be nice...
)
-Rich
Here's my code:
require 'fox'
include Fox
theApp=FXApp.new
mainwin=FXMainWindow.new(theApp, "My
X.N.",nil,nil,DECOR_ALL,10,10,600,600,0,4,0,4)
mb=FXMenubar.new(mainwin,LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_FILL_X,0,0,0,0,0,0,0,
0)
fm=FXMenuPane.new(mb)
FXMenuCommand.new(fm,"&Quit\tCtl-Q",nil,theApp,FXApp::ID_QUIT);
FXMenuTitle.new(mb,"&File",nil,fm);
hf=FXHorizontalFrame.new(mainwin,LAYOUT_SIDE_TOP|FRAME_NONE|LAYOUT_FILL_X|LA
YOUT_FILL_Y|PACK_UNIFORM_WIDTH)
$tl=FXTreeList.new(hf,1,nil,0,LAYOUT_FILL_X|LAYOUT_FILL_Y|TREELIST_SHOWS_LIN
ES|TREELIST_SHOWS_BOXES|TREELIST_ROOT_BOXES)
$x=File.open("002.xml")
def populateDisplay(pi)
if(!$x.eof)
l=$x.gets.strip
if(l=="" || l.include?("<!")) then l="<WHITESPACE/>" end
c=$tl.addItemLast(pi,l)
if(l.index("</")==0 || l=="<WHITESPACE/>") then c.text="" end
if(!l.include?("/"))
populateDisplay(c)
else
if(l.strip.index("</")==0)
if(c.parent!=nil) then populateDisplay(c.parent.parent) end
else
populateDisplay(c.parent)
end
end
end
end
c=$tl.addItemLast(nil,$x.gets.strip)
begin # I don't want to have to put this in
populateDisplay(c)
rescue SystemStackError # I don't want to have to put this in
end # I don't want to have to put this in
FXTooltip.new(theApp)
theApp.create
mainwin.show(PLACEMENT_SCREEN)
theApp.run
Suggestions? (Remember - I'm a hobbyist programmer, so please be nice...
)
-Rich