[erlang-questions] OS X gs windows display only after selecting

Vance Shipley vances@REDACTED
Mon Dec 24 04:32:14 CET 2007


Folks,

I'm happy to report that this problem seems to have dissappeared
(after several years) with the introduction of Tcl/Tk version 8.5.0
released a couple days ago.  I installed ActiveTcl's binary package
for OS X and it all works perfectly (ASFAIK).

On Mon, Nov 26, 2007 at 12:53:05PM -0400, Vance Shipley wrote:
}  Is anyone else using gs applications such as the debugger or et
}  on OS X (native not X11) and do you notice that certain windows 
}  do not display until you select them?  It's becoming annoying 
}  enough that I'm going to have to track down what is wrong but I 
}  thought I'd ask first in case anyone else has tried.

Once I started delving into this I realized I had tried to tackle
this once before back in 2004 on a different machine with an earlier
version of the OS (Panther):

http://www1.erlang.org/pipermail/erlang-questions/2004-February/011483.html

Just for the record, to help any future googlers, here is what I 
found.  I enabled DEBUG tracing in the gs port driver:

   $ erlc -DDEBUG -I lib/erlang/lib/gs-1.5.7/src gstk_port_handler.erl

In the trace you can see that the aplication requests configuration
events with "bind .w1 <Configure>".  These will cause the driver to
send {80,"co",[Width,Height,X,Y]} to the port.

With Tcl/Tk v8.4.7 (native OS X Tiger):

   DBG: OUTPUT[port]: erlexec {toplevel .w1 -cur top_left_arrow;bind .w1 <Destroy> {if {"%W"==".w1"} {erlsend #80 d}};wm withdraw .w1;wm title .w1 "APPMON: Overview on nonode@REDACTED";update idletasks;wm ge .w1 520x170;update idletasks;;bind .w1 <Configure> {if {"%W"==".w1"} {erlsend #80 co %w %h %x %y}}}
   DBG: idle
   DBG: OUTPUT[port]: erlcall {so_create canvas .w1.c1}
   DBG: idle
   DBG: INPUT[port]: \001#80 co 1 1 65 105
   DBG: Event = {80,"co",[1,1,65,105]}
   DBG: idle
   DBG: INPUT[port]: \002.w1.c1
   DBG: idle
   DBG: call reply: ".w1.c1"

We receive a configuration event with Width=1 and Height=1.  Not good.

With Tcl/Tk v8.5.0:

   DBG: OUTPUT[port]: erlexec {toplevel .w1 -cur top_left_arrow;bind .w1
   <Destroy> {if {"%W"==".w1"} {erlsend #80 d}};wm withdraw .w1;wm title
   .w1 "APPMON: Overview on nonode@REDACTED";update idletasks;wm ge .w1
   520x170;update idletasks;;bind .w1 <Configure> {if {"%W"==".w1"}
   {erlsend #80 co %w %h %x %y}}}
   DBG: idle
   DBG: OUTPUT[port]: erlcall {so_create canvas .w1.c1}
   DBG: idle
   DBG: INPUT[port]: \001#80 co 1 1 35 123
   DBG: Event = {80,"co",[1,1,35,123]}
   DBG: idle
   DBG: INPUT[port]: \001#80 co 520 170 35 123
   DBG: Event = {80,"co",[520,170,35,123]}
   DBG: idle
   DBG: INPUT[port]: \002.w1.c1
   DBG: idle
   DBG: call reply: ".w1.c1"

With the newer version of Tcl/Tk we received the same lame configuration
event however it is immediately followed by a correct one.  Much better,
now our window is displayed properly.

	-Vance





More information about the erlang-questions mailing list