News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.


Post Reply  Post Thread 
screen corruption issue
Author Message
roydobbins
Junior Member
**


Posts: 7
Group: Registered
Joined: Nov 2010
Status: Offline
Reputation: 0
Post: #1
screen corruption issue

i have the following test case which either illustrates a screen corruption issue, or i am doing something wrong:

testindex.lua to launch the script
testadmin.lua shows screen corruption when you click on one of the
entries in the (left) list box; -but- uncommenting the last two lines:-
--window:show()
--Fl:run()

then works fine!


here are the code snippets

any comments, or pointers to the problem would be appreciated

regards,
--roy dobbins


-- testindex.lua

local window = fltk:Fl_Double_Window(366, 500,"MurgaLua Test Manager")

local button=fltk:Fl_Button(50,27,24,24)
button:callback(function()
require "testadmin"
testadmin.window:show()
end)

window:show()
Fl:run()

-- testadmin.lua

module("testadmin", package.seeall)

local ww=400 --window width
local wh=350 --window height
local col=ww/4
local col2=ww-col -- column widths
local b
local br_two

function list_callback(w)
local colnames={'a','b','c','d','e','f'}
local colcount = # colnames
local colwidths = {}
for i=1,colcount do colwidths[i] = string.len(colnames[i]) * b:labelsize() end
table.insert(colwidths,0)

b:clear()
b:column_widths(colwidths)
b:column_char(string.byte('|'))

local header=""
for i=1,colcount do
if i> 1 then header=header.."|" end
header=header.."@B12@C7@b@."..colnames[i]
end
b:add(header)

for r=1,2500 do
local data=""
for i=1,colcount do
if i> 1 then data=data.."|" end
data=data..string.format("rc%d %d", r,i)
end
b:add(data)
end

window:redraw()
end

window = fltk:Fl_Double_Window(ww, wh, "test admin")

local nameedit = fltk:Fl_Input(200,0,100,25,'Name of this view...........:')
br_two=fltk:Fl_Hold_Browser(0,50,col,wh-75,"Fl_Hold_Browser")
br_two:add('1')
br_two:add('2')
br_two:add('3')
br_two:callback(list_callback)

b = fltk:Fl_Hold_Browser(col,50,col2,wh-75,"Table Browser")

fltk:Fl_End() -- end of window

--following two lines are significant to the problem!
--window:show()
--Fl:run()

-- if above two lines commented out, problem shows up
--otherwise works ok

07-29-2011 04:12 AM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Messages In This Thread
screen corruption issue - roydobbins - 07-29-2011 04:12 AM
RE: screen corruption issue - mikshaw - 07-30-2011, 12:10 AM
RE: screen corruption issue - roydobbins - 07-30-2011, 07:52 AM
RE: screen corruption issue - mikshaw - 07-31-2011, 12:40 AM
RE: screen corruption issue - roydobbins - 07-31-2011, 04:43 AM
RE: screen corruption issue - mikshaw - 07-31-2011, 10:26 AM
RE: screen corruption issue - mikshaw - 07-31-2011, 10:46 AM
RE: screen corruption issue - roydobbins - 07-31-2011, 12:06 PM
RE: screen corruption issue - mikshaw - 07-31-2011, 01:40 PM
RE: screen corruption issue - roydobbins - 08-02-2011, 12:22 PM

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: