Overview

The GTKWD addon is a wd (window driver) emulator using gtk api. It allows running legacy J6 gui code within JGTK. Its main purpose is to ease porting of wd to native gtk api. Translation of wd to jgtk can be done piece by piece and less daunting. It does not encourage writing new production applications using this emulator.

Usages

Just add a require before running wd command.

require 'gtkwd'

DO NOT use load

load 'gtkwd'   NB. never use 'load' unless you are debugging gtkwd itself.

J602's base library since 6.02.061 will ignore gtkwd for load or require, so it is harmless to include a require 'gtkwd' if you want the script to run under both J602 and J701.

Migration from J602 to J701

Many packages inside J602 base library have been moved to addons. To make it run on both,

require 'font print'

will become

if. IFJ6 do.
  require 'font print'
else.
  require 'general/misc/font print'
end.

Project manager is completely different, but usually it just needs a new simple project file in the new .jproj format and a new init.ijs. for initislization.

NB. init

3 : 0''
if. IFJ6 do.
  script_z_ jpath '~system/classes/plot/afm.ijs'
  script_z_ jpath '~system/packages/graphics/bmp.ijs'
  script_z_ jpath '~system/packages/color/colortab.ijs'
  script_z_ jpath '~system/main/dll.ijs'
  script_z_ jpath '~system/main/files.ijs'
  script_z_ jpath '~system/packages/misc/font.ijs'
  script_z_ jpath '~system/main/gl2.ijs'
  script_z_ jpath '~system/classes/plot/jzplot.ijs'
  script_z_ jpath '~system/main/numeric.ijs'
  script_z_ jpath '~system/classes/plot/plot.ijs'
  script_z_ jpath '~system/main/regex.ijs'
  script_z_ jpath '~system/main/strings.ijs'
  script_z_ jpath '~system/main/trig.ijs'
else.
  require 'afm bmp colortab dll files general/misc/font gl2 jzplot numeric plot regex strings trig'
end.
''
)

coclass 'ppublish'

GTKWD under jconsole

Running gtkwd applications under jconsole requires a gtk message loop. A utility verb evtloop is provided. Run it after the main program, eg,

... 
wd 'pshow'
evtloop^:(-.IFJ6)''
...

The program flow will stop at evtloop and the jconsole will freeze as well until the last window created by GTKWD is closed. Note that if there are other sentences to be run after pshow, the poistion of evtloop should be moved accordingly.

evtloop has no effect under GTKIDE or if a gtk message loop is already running.

Incompatible Changes

...
wd^:(-.IFJ6) 'pshow;pshow sw_hide'  NB. add this line
g=. '' conew 'jzgrid'
...
wd 'pshow'                          NB. original pshow

Symbol    J602 value
------------------------
kbBS      08 backspace
kbENTER   13 CR
kbPUP     16 pageup
kbPDOWN   17 pagedn
kbEND     18 end
kbHOME    19 home
kbLEFT    20 left arrow
kbUP      21 up arrow
kbRIGHT   22 right arrow
kbDOWN    23 down arrow
kbESC     27 escape
kbINS     28 insert
kbDEL     29 delete

Limitation

Un-implemented wd Comamnds

The following commands are not or will not be implemented.

 smcolor smkeywords smsetlog sminputlog
 sminputlog

 oleget olegetlic oleinfo
 oledlg oleenable oleid oleload olemethod olemethodx oleocx olerelease olesave oleset olesetlic

 qhinst qhwndx qkeystate qrtf
 clipcopyx clippastex pcolor security setbkgnd setcolor setcolwidth setpclip setupdate settabstops tnomsgs wait

Un-implemented gl2 Comamnds

The following commands are not implemented.

glcapture
glemfclose
glemfopen
glemfplay
glfile
glroundr

Demos

Demos are available in addons

All of the above demos can be run from demos/wd.

load 'demos/wd/demos'

Or add the following line to launchpad and then run from launchpad.

wd;~Demos/wd/demos.ijs

Some demos may require other addons packages.

Dependency

Obviously, GTKWD requires gui/gtk for working. It also depends on the addon graphics/gl2 for isigraph and gl2 functions.

TODO

Bugs

Please report bugs with information such as GTKVER and testing platform. Provide a simple script to reproduce the bug if applicable.



Contributed by BillLam

Addons/gui/gtkwd (last edited 2012-03-18 05:01:05 by BillLam)