Archive for June, 2006

06/11 Erlang/gs progress

I solved most of my problems with listboxes and grids. I should probably add a couple of other elements, like the editor [aka EditField]. But now is the time to turn to linking the existing elements to events inside an event loop, which looks like this:

loop() ->
    receive
        {gs,_Win,destroy,_Data,_Args} -> bye;
        {gs,_Gridline,click,_Data,[Col,Row,Text|_]} ->
            io:format("Click at col:~p row:~p text:~p~n",[Col,Row,Text]),
            loop();
        Msg ->
            io:format("Got ~p~n",[Msg]),
            loop()
    end.

You set up a receiver and match messages following this pattern: {gs, IdOrName, EventType, Data, Args}

The original in RB’s IDE

The end result in X11

Erlang

06/10 Messing with Erlang/gs

Building GUI apps in Erlang is pretty primitive. And it’s text-only work. As in, you have to hard code GUI elements into a text editor.

W_Window1 = gs:create(window, gs:start(), [{width,789}, {height,544}, {x,100}, {y,100}, {title,"First Try"}]),
CV_Canvas1 = gs:create(canvas, W_Window1, [{y,14}, {x,20}, {width,483}, {height,483}]),
CVP_Canvas1 = gs:create(image, CV_Canvas1, [{'load_gif', "tiger.gif"}]),

Blech…

So I am working on a GUI editor for Erlang, but with a twist I had used before for Python: I am using RB’s own GUI editor to build a nice window, and then I make a call in the window’s Open() event to a library I wrote that outputs Erlang/gs code for said window. The app runs, produces the code, and quits. It’s far from complete, and I am having difficulties with gs grids, aka multiple-column listboxes. But it is already enough to easily produce some skeletton code, and I hope I can then move on to linking GUI elements to code managing events. Like when a pushbutton is clicked, provide basic code to handle this.

More later… But see this already:

The original in RB

The end result in gs/X11

Erlang

06/06 Places

I’ll add a few in a month or so, but inbetween here goes:

Places I have been to

HK and Macau were not available separately, I did the painting myself. As for the US, I’ve only been to New York and Hawai’i, so a little editing was in order too. Available from here, via JY. Though I seem to remember I did this before…

06/06 Les dérives Sarkozystes de Ségolène

Avec ou sans vaseline, Nico ?

APRÈS la sécurité, les 35 heures : pour Ségolène Royal, le débat est sans tabou. La présidentiable favorite des sondages a de nouveau créé l’événement en critiquant ce qui fut la mesure sociale phare du gouvernement de Lionel Jospin entre 1997 et 2002. Cette critique est à lire sur son site Désirs d’avenir, dans le deuxième chapitre du livre qu’elle publie progressivement sur Internet. Ségolène Royal y reproche aux 35 heures d’avoir engendré «une dégradation de la situation des plus fragiles».

C’est marrant comme les “jeunes” y z’ont faim et veulent se démarquer des erreurs de leurs anciens. En tout cas, j’aime bien la photo publiée [sans le cartouche BD :-D ] dans le Figaro : elle semble bien vouloir refléter ce que la Miss Royal a en stock pour le Sarkoko [et je serais lui je me laisserais faire… Enfin au propre, car au figuré, je pense pas qu’il va laisser une soc-dem lui piquer le terrain de l’anti-socialisme, mwahahahah]

06/05 Unvoluntary 吏讀

Yesterday I was watching 도전 골든벨, a quizz show featuring a bunch of high school kids being eliminated question after question until only one remains. Of course, Korea being Korea it’s all about rote memory and cramming as much useless data as possible into their little brains – doesn’t mean they know shit about life, but the crap they remember sometimes is astounding…

Anyways, yesterday, they were asked to write down 불사조 — 죽지 않는 새 — in sinograms. 13 or so were kicked out after this question, which, well, figures, considering the state of sinograms teaching in Korea [and let’s not get started on things like 베이징 instead of 北京/북경]. I did catch one funny – albeit wrong – answer:

火死鳥

Considering that 火 is [불] 화, this is extremely funny, since that girl had meaning and pronunciation confused. It looked like some old Korean vernacular text written in 吏讀 [이두], where sinograms where sometimes used for their actual pronunciation, and sometimes for their vernacular reading.

Needless to say, I was the only one at home to see this [somehow my family has a tendency to watch TV without really watching, and I am guessing here that it’s not just them… Of course, had I had control over the remote control – firmly held by the head of the family :-( – I would never had watched this show, ㅋㅋㅋ], and the only one I could tell the story without writing it down – like now – was Oranckay