9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Skip Tavakkolian <skip.tavakkolian@gmail.com>
To: 9fans <9fans@9fans.net>
Subject: Re: [9fans] a simple graphical application in Go?
Date: Sat, 4 Apr 2020 21:37:18 -0700	[thread overview]
Message-ID: <CAJSxfmLL8TTw0bo1AOmLR_tNnEZwGwVAz-BdDH=L=MBeRozmdg@mail.gmail.com> (raw)
In-Reply-To: <CAA2CNPaWOKky07cy4Vch_9e_ngSip8sSqDhq3b=DyjH8JUiG9A@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2574 bytes --]

Cool! Thank you.

On Sat, Apr 4, 2020, 9:17 PM Fazlul Shahriar <fshahriar@gmail.com> wrote:

> There is a PR open with Plan 9 devdraw support to 9fans.net/go/draw:
> https://github.com/9fans/go/pull/28
> It at least works with the Go acme port Edwood last I tested.
>
> On Sat, Apr 4, 2020 at 4:33 PM Jeremy Jackins <jeremyjackins@gmail.com>
> wrote:
>
>> Well, you need a Go draw package in place of the C library. There is a
>> draw package in github.com/9fans/go/ but unfortunately I think it only
>> supports plan9port devdraw, rather than the native Plan 9 draw device.
>> So there is some library work to be done first. Since the Go standard
>> library also contains the most important drawing primitives
>> implemented by the Plan 9 draw device (with the exception of font
>> rendering, but there is golang.org/x/image/font), you may be able to
>> ignore a lot of functionality provided by the Plan 9 draw library and
>> focus on a few things like loading pixel data directly to the draw
>> device.
>>
>> See: http://man.cat-v.org/plan_9/3/draw
>>
>> Jeremy
>>
>> On Sat, 4 Apr 2020 at 06:55, Kim Lassila <kim.lassila@gmail.com> wrote:
>> >
>> > Has anyone written a graphical application in Go on Plan 9? How would
>> the Go equivalent of black.c (thank you fgb) look like?
>> >
>> > - - - clip - - -
>> >
>> > #include <u.h>
>> > #include <libc.h>
>> > #include <draw.h>
>> >
>> > void
>> > main(int, char *argv[])
>> > {
>> > Rectangle rect;
>> > Image *black;
>> >
>> > fmtinstall('R', Rfmt);
>> > if(initdraw(nil, nil, argv[0]) < 0)
>> > sysfatal("initdraw: %r");
>> > rect = screen->r;
>> > black = display->black;
>> > draw(screen, rect, black, nil, ZP);
>> > flushimage(display, 1);
>> > sleep(5 * 1000);
>> > closedisplay(display);
>> > print("rectangle was %R\n", rect);
>> > exits(nil);
>> > }
>> >
>> > 9fans / 9fans / see discussions + participants + delivery options
>> Permalink
>>
>> ------------------------------------------
>> 9fans: 9fans
>> Permalink:
>> https://9fans.topicbox.com/groups/9fans/T0d490c91935dc74b-M08178595d1453fd46812690c
>> Delivery options: https://9fans.topicbox.com/groups/9fans/subscription
>>
> *9fans <https://9fans.topicbox.com/latest>* / 9fans / see discussions
> <https://9fans.topicbox.com/groups/9fans> + participants
> <https://9fans.topicbox.com/groups/9fans/members> + delivery options
> <https://9fans.topicbox.com/groups/9fans/subscription> Permalink
> <https://9fans.topicbox.com/groups/9fans/T0d490c91935dc74b-Mfd4090e269de1d17fc3df91d>
>

[-- Attachment #2: Type: text/html, Size: 4532 bytes --]

  reply	other threads:[~2020-04-05  4:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-04 13:54 Kim Lassila
2020-04-04 20:32 ` [9fans] " Jeremy Jackins
2020-04-04 21:50   ` Skip Tavakkolian
2020-04-05  4:15   ` Fazlul Shahriar
2020-04-05  4:37     ` Skip Tavakkolian [this message]
2020-04-06  9:58     ` Lucio De Re
2020-04-04 21:37 ` Chris McGee
2020-04-05  0:40   ` ori
2020-04-05  4:11   ` Kim Lassila

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJSxfmLL8TTw0bo1AOmLR_tNnEZwGwVAz-BdDH=L=MBeRozmdg@mail.gmail.com' \
    --to=skip.tavakkolian@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).