Re: Golly 3.3b2
Posted: July 17th, 2019, 3:32 pm
wow thanks
I rebuilt Golly with wxWidgets 3.0.4. It doesn't seem to have made much difference. The borders around the cell icons are all fine and the cell state selector scroll bar still looks the same. My libgtk2 version is 2.24.30 and libGL is provided by nvidia-384.130Andrew wrote:I got my version number wrong -- I use Ubuntu 12. I think the wx developers are overly optimistic about the reliability of wx 3.1! It would be worth rebuilding Golly using the latest stable version (3.0.4) to see if that fixes the various problems you've found. Unfortunately Ubuntu seems to be the flakiest flavor of Linux when it comes to writing wxGTK apps. Of the three flavors I've tried (Fedora, Mint, Ubuntu) Mint seems the most reliable.wildmyron wrote:I don't see this specific issue in my build. Built from commit c76d5f, wxWidgets v3.1.2, also 64-bit Ubuntu 16.04.
This suggestion didn't help, and I've since discovered that the same hang occurs on opening the "Set Rule" dialog. I also experience the issue relating to "Could not set current working directory (error 2: No such file or directory)" mentioned here: viewtopic.php?f=4&t=2897&start=0 and haven't been able to resolve it by moving the golly binary into the right directory or running make install (with appropriate --prefix specified to ./configure) as suggested by marioxcc. To be honest I'm not inclined to pursue these issues much further because I don't use Golly on Linux myself, but I did want to provide this info for completeness sake. On the other hand I am willing to test any modifications suggested.Andrew wrote:Sounds like there is a wx 3.1 bug in the handling of the GIF animation. Try editing Help/about.html and delete the img link to images/about.gif to see if that avoids the problem.A separate issue I have with the Linux build is that Golly hangs when I open the About Window. A Help window pops up, titled "About Golly", but it is completely blank. Golly is using about 50% of one CPU. ...
Thanks for trying.wildmyron wrote:I rebuilt Golly with wxWidgets 3.0.4. It doesn't seem to have made much difference.
I just remembered that this problem (which affects all modal dialogs, like Set Rule) is somehow caused by Ubuntu's global menu bar. To disable the global menu bar on my Ubuntu 12.04 system I used the following command (then rebooted):A separate issue I have with the Linux build is that Golly hangs when I open the About Window. A Help window pops up, titled "About Golly", but it is completely blank. Golly is using about 50% of one CPU. ...
Code: Select all
sudo apt-get remove appmenu-gtk appmenu-gtk3 appmenu-qt
This one has me stumped. I think it might have something to do with using the configure method to build Golly. That stuff was implemented by Maks Verver and I don't really understand the details. I prefer to use makefile-gtk included in the gui-wx folder. Very easy to use (assuming you've already built and installed wxWidgets as described in docs/Build.html):I also experience the issue relating to "Could not set current working directory (error 2: No such file or directory)" ...
Code: Select all
cd /path/to/golly/gui-wx
make -f makefile-gtk clean (probably best to do this to remove any configure stuff)
make -f makefile-gtk
../golly
Thanks for reminding me - I've seen this mentioned several times but forgot about it. Disabling the global menu bar for golly prevents the hang from occurring when I open modal dialogs.Andrew wrote:I just remembered that this problem (which affects all modal dialogs, like Set Rule) is somehow caused by Ubuntu's global menu bar. ...wildmyron wrote:A separate issue I have with the Linux build is that Golly hangs when I open the About Window. A Help window pops up, titled "About Golly", but it is completely blank. Golly is using about 50% of one CPU. ...
OK. I rebuilt with this method and no longer see the "Could not set working directory ..." error message. Thanks for the tip. All the graphical issues are (unsurprisingly) unchanged from the previous build.Andrew wrote:This one has me stumped. I think it might have something to do with using the configure method to build Golly. That stuff was implemented by Maks Verver and I don't really understand the details. I prefer to use makefile-gtk included in the gui-wx folder. Very easy to use (assuming you've already built and installed wxWidgets as described in docs/Build.html):wildmyron wrote:I also experience the issue relating to "Could not set current working directory (error 2: No such file or directory)" ...
Code: Select all
cd /path/to/golly/gui-wx make -f makefile-gtk clean (probably best to do this to remove any configure stuff) make -f makefile-gtk ../golly
Excellent -- thanks!wildmyron wrote:I rebuilt with this method and no longer see the "Could not set working directory ..." error message.
For the edit bar's scroll bar issue I'm wondering if the bar needs to be wider so we see the thumb box etc. Find this line (308) in wxedit.cpp:All the graphical issues are (unsurprisingly) unchanged from the previous build.
Code: Select all
int scrollbarwd = 100;
There does seem to be a known issue with wxGTK and overlay scrollbars. So far the only solution is to disable them. It looks like you can do this globally or just for golly:wildmyron wrote:Changing the scrollbar width had no effect on the issue. ... As far as I can work out this has something to do with Ubuntu's use of GTK's overlay scrollbars.
Thank you Andrew.Andrew wrote:There does seem to be a known issue with wxGTK and overlay scrollbars. So far the only solution is to disable them. It looks like you can do this globally or just for golly:wildmyron wrote:Changing the scrollbar width had no effect on the issue. ... As far as I can work out this has something to do with Ubuntu's use of GTK's overlay scrollbars.
https://askubuntu.com/questions/34214/h ... scrollbars
https://askubuntu.com/questions/36448/i ... y-scrollba
Let me know if you manage to find a fix.
Code: Select all
alias golly="UBUNTU_MENUPROXY=0 LIBOVERLAY_SCROLLBAR=0 ./golly"Much thanks! This looks to be the neatest and least-intrusive solution so I've added it to the section on Linux problems in Help > Known Problems.wildmyron wrote:I now use the following alias to run my locally built gollyCode: Select all
alias golly="UBUNTU_MENUPROXY=0 LIBOVERLAY_SCROLLBAR=0 ./golly"
See previous response.muzik wrote:... how would I get my updated RainbowASO mashup rule included?
Code: Select all
-- toChangeState.lua, version 1.0
-- adapted in August 2019 from change-state.py by Andrew Trevorrow,
-- and toChangeColors.py by Dave Greene
-- Switch all cells of a clicked-on color in the selected pattern to the current brush color
local g = golly()
local gp = require "gplus"
local split = gp.split
local oldsecs
local newsecs
local oldeditbar = g.setoption("showeditbar",1)
local function savestate(filename, state)
local f = io.open(filename, "w")
if f then
f:write(state)
f:close()
else
g.warn("Can't save target state in filename:\n"..filename)
end
end
local ChangeStateINIFileName = g.getdir("data").."changestate.ini"
local targetstate = "0"
local f = io.open(ChangeStateINIFileName, "r")
if f then
targetstate = f:read("*l") or ""
f:close()
end
if targetstate==nil then
targetstate = "0"
savestate(ChangeStateINIFileName, targetstate)
end
limits = "selection"
seltype = " selected"
r = g.getselrect()
if #r==0 then
limits = "pattern's bounding box"
seltype = ""
r = g.getrect()
if #r==0 then
g.exit("No pattern to change.")
end
end
-- set fill limits to the chosen rectangle
minx, miny, sizex, sizey = table.unpack(r)
maxx = minx + sizex - 1
maxy = miny + sizey - 1
area = g.getcells(r)
if g.numstates() == 2 then
g.exit("Rule must be multistate. Use 'Clear' editing tools and invert.lua for cell changes in two-state patterns.")
end
saveoldstate = g.setoption("drawingstate",targetstate)
newstate = targetstate
oldstate = newstate
-- wait for user to click a cell
g.show("Click a cell to change all" .. seltype .. " cells of that type to target state "..newstate..
". Change drawing state on Edit toolbar to adjust target state. Esc to cancel.")
while true do
event = g.getevent()
-- user may change drawing state at any time
newstate = g.getoption("drawingstate")
if newstate ~= oldstate then
g.show("Click a cell to change all" .. seltype .. " cells of that type to target state "..newstate..
". Change drawing state on Edit toolbar to adjust target state. Esc to cancel.")
oldstate = newstate
savestate(ChangeStateINIFileName, newstate)
end
if event:sub(1,5)==("click") then
-- event is a string like "click 10 20 left none"
evt, xstr, ystr, button, mods = split(event)
x = tonumber(xstr)
y = tonumber(ystr)
if x < minx or x > maxx or y < miny or y > maxy then
g.warn("Click inside the "..limits..". To change the region affected by the script, hit Esc to cancel, then adjust the selection.")
else
oldstate = g.getcell(x, y)
if oldstate == newstate then
g.warn("The clicked cell must have a different state\n"
.."from the current drawing state, "..newstate..".")
else
break
end
end
else
g.doevent(event)
end
end
-- tell Golly to handle all further keyboard/mouse events
g.getevent(false)
if oldstate == 0 then
-- special handling for state-0 cells, which don't show up in cell lists
-- so they must be tested individually by scanning the entire bounding box
changed = 0
total = sizex * sizey
oldsecs = os.clock()
for row = miny, maxy do
-- might be large pattern so show percentage done each second
newsecs = os.clock()
if newsecs - oldsecs >= 1.0 then
oldsecs = newsecs
g.show("Changing cell states: "..string.format("%.1f", 100 * (row - miny) * sizex / total).."%")
g.update()
end
-- allow keyboard interaction
g.doevent( g.getevent() )
for col = minx, maxx do
if g.getcell(col, row) == oldstate then
g.setcell(col, row, newstate)
end
changed = changed + 1
end
end
g.show("Changed "..changed.." state "..oldstate.." cells to state "..newstate..".")
else
-- faster handling for changing nonzero states to another state (including zero)
oldsecs = os.clock()
numcellsx3 = #area
count = 0
for i=1, numcellsx3-2, 3 do
-- might be large pattern so show percentage done each second
newsecs = os.clock()
if newsecs - oldsecs >= 1.0 then
oldsecs = newsecs
g.show("Changing cell states: "..string.format("%.1f",100 * i / numcellsx3).."%")
g.update()
end
-- allow keyboard interaction
g.doevent( g.getevent() )
if area[i+2]==oldstate then
g.setcell(area[i],area[i+1],newstate)
count = count + 1
end
end
g.show("Changed "..count.." state "..oldstate.." cells to state "..newstate..".")
end
-- return to previous Edit Bar setting
g.setoption("showeditbar", oldeditbar)