Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=gfwsyscfg.git;a=commitdiff;h=1c39d451197066ba32be149aa397388c4a7c2277
commit 1c39d451197066ba32be149aa397388c4a7c2277 Author: James Buren <r...@frugalware.org> Date: Fri Dec 12 14:26:28 2008 -0600 gfwsyscfg.lua/gfwsyscfg.glade * move parts of code to glade, implement module loading prototype diff --git a/src/gfwsyscfg.glade b/src/gfwsyscfg.glade index 91e16ab..33c55be 100644 --- a/src/gfwsyscfg.glade +++ b/src/gfwsyscfg.glade @@ -1,8 +1,11 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd"> -<!--Generated with glade3 3.4.5 on Fri Dec 12 13:27:39 2008 --> +<!--Generated with glade3 3.4.5 on Fri Dec 12 14:01:31 2008 --> <glade-interface> <widget class="GtkWindow" id="mainwindow"> + <property name="width_request">300</property> + <property name="height_request">300</property> + <property name="title" translatable="yes">gfwsyscfg</property> <child> <widget class="GtkVBox" id="vbox"> <property name="visible">True</property> diff --git a/src/gfwsyscfg.lua b/src/gfwsyscfg.lua index 9cb5379..5e0fd6d 100755 --- a/src/gfwsyscfg.lua +++ b/src/gfwsyscfg.lua @@ -4,6 +4,7 @@ -- the pieces. require("lgui") +require("lfs") function quit() lgui.quit() @@ -11,11 +12,25 @@ end function init() local app = {} + local dir = "../modules/" app.glade = lgui.Glade.new("gfwsyscfg.glade") app.win = app.glade:getWidget("mainwindow") app.closebutton = app.glade:getWidget("closebutton") app.closebutton:connect("clicked",quit) - app.win:set("title","gfwsyscfg","width-request",300,"height-request",300) + app.notebook = app.glade:getWidget("notebook") + for file in lfs.dir(dir) do + if file ~= "." and file ~= ".." then + local file = dir..file + if string.find(file,"^.*.lua$") then + local success,widget,label = pcall(loadfile(file)) + if success then + if widget and label then + app.notebook:insertPage(widget,label) + end + end + end + end + end app.win:connect("delete-event",quit) app.win:showAll() lgui.main() _______________________________________________ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git