[erlang-questions] wxErlang question 4

Joe Armstrong <>
Tue Jul 11 16:39:13 CEST 2017


It didn't work for me - how did you launch this?

I did erl -pa ebin in the root directory (gx-master)
gx:config works and I see a window

but gx:idx() crashes with a badmatch
in line 37 of gx_ui_filetree.erl the line saying

 directory = path:type(Path),

I think this is returning undefined -

Do I have to set some environment variables or something?

./Joe



On Tue, Jul 11, 2017 at 1:22 PM, Steve Davis
<> wrote:
> 1) One of those projects that I haven’t had time for. If there was interest,
> it may rekindle my interest in moving it along. Looking back, with the
> second prototype I diverged too far from the GS way of doing this as I got
> focused on XML definitions and so the interactive REPL part suffered. it’s
> really code in mid-flight.
>
> 2) However, the code still seems to work under R20 - See console session
> below:
>
> Erlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:4:4] [ds:4:4:10]
> [async-threads:10] [hipe] [kernel-poll:false]
>
> Eshell V9.0  (abort with ^G)
> 1> gx:start().
> [<0.63.0> gx_driver:150] "/opt/local/lib/erlang/lib/wx-1.8.1/priv"
> [<0.63.0> gx_driver:124] info_got_wx_consts
> [<0.63.0> gx_driver:134] {handle_info,
>                              {wxe_driver,open_file,"/Users/stevedavis"}}
> {ok,<0.62.0>}
> 2> rr(gx).
> [aui,bitmapbutton,box,button,calendar,checkbox,checklist,
>  choice,combo,control,date,dialog,editor,evh,filetree,font,
>  frame,g,grid,gs,gs_font,gui,gx,gx_cache,gx_ui,gx_wx,image,
>  input,line|...]
> 3> F = #frame{id=window, size={400,200}}.
> #frame{id = window,ref = undefined,label = undefined,
>        pos = {-1,-1},
>        size = {400,200},
>        callbacks = [],icon = undefined,title = <<"Untitled">>,
>        show = true,virtual = false,content = []}
> 4> gx:create(F).
> [#gx_ui{id = window,
>         ref = #wx_ref{ref = 37,type = wxFrame,state = []},
>         parent = #wx_ref{ref = 0,type = wx,state = []},
>         module = gx_ui_frame}]
> 5> gx:names().
> [window]
> 6> gx:config(window, size, {800, 400}).
> [<0.60.0> gx_ui:59] {{g,<0.62.0>,#Port<0.3025>,undefined,<0.64.0>,gx},
>                      window,
>                      [{size,{800,400}}]}
> [ok]
> 7> gx:ide().
> [<0.95.0> gx_ui:59] {{g,<0.93.0>,#Port<0.3158>,undefined,<0.94.0>,ide},
>                      log,
>                      [{append,<<"$
> {init,{gx,ide,{wx_ref,0,wx,[]},gx,start,[],[]},[{resources,undefined}]}\n">>}]}
> {ok,<0.93.0>}
>
>
>
>
> On Jul 11, 2017, at 2:48 AM, Joe Armstrong <> wrote:
>
> Wow - lot's of code for me to stare at - thanks
>
> A couple of questions:
>
> 1) I downloaded the gx project and saw that there had been no
>    commits since Jul 13 2014 - is this totally dead?
>
> 2) How do I run your gx code? - what's a top level command to create a
> window???
>
> Cheers
>
> /Joe
>
>
> On Tue, Jul 11, 2017 at 1:07 AM, Steve Davis
> <> wrote:
>
> Sizers are crazy. A while back I had a decent go at making a hand-written
> version of wx interfacing directly to the erlang driver and trying to make
> it sensible as an API like GS. I think it should still work.
>
> The following code was the result of a lot of reading the WxWidgets C++ API
> docs and translating into what I felt was sensible to get to a single
> interface module that resembled GS (i.e the module gx.erl).
>
> https://github.com/komone/gx/blob/master/src/ui/gx_ui_sizer.erl
>
> https://github.com/komone/gx/blob/master/src/ui/gx_ui_control.erl
>
> https://github.com/komone/gx/blob/master/src/ui/gx_ui_button.erl
>
>
>


More information about the erlang-questions mailing list