Small app, like notepad

178 views
Skip to first unread message

Amitabh Arya

unread,
Mar 15, 2012, 1:51:38 PM3/15/12
to golan...@googlegroups.com
Hi,

           Need to develop a small app like notepad, keep reading and show and deleting data. As data is keep adding in source file. Platform in-depended (if possible) otherwise for Windows. 

So, how can I create a window and add a text box in there, which will not be editable. 
How can I keep reading a file at the run time.. and data is keep adding in source file from other other program. Like to read a log file at run time.

Definitely in GO1 :)

André Moraes

unread,
Mar 15, 2012, 1:59:21 PM3/15/12
to golan...@googlegroups.com
Search for "MS Windows" and you will find some wrap libraries.

http://go-lang.cat-v.org/library-bindings

--
André Moraes
http://andredevchannel.blogspot.com/

John Asmuth

unread,
Mar 15, 2012, 1:59:42 PM3/15/12
to golan...@googlegroups.com
Hi Amitabh,

Right now I am not aware of any magic bullet for GUI stuff in Go. There are a few options though:
 - make a cgo wrapper to an existing C toolkit
 - use someone else's cgo wrapper (check the dashboard at http://godashboard.appspot.com/project)
 - if you're html-/js-/css-savvy, make a mini web server for your app

- John

Rémy Oudompheng

unread,
Mar 15, 2012, 1:59:43 PM3/15/12
to Amitabh Arya, golan...@googlegroups.com

There is no standard graphical user interface libraries in Go standard
libary. You should choose an OS-independant toolkit (maybe GTK or Qt)
and find or write Go bindings for it. Another possibility is to write
an HTTP server that does that and view the results in a browser.

Rémy.

Daniel Theophanes

unread,
Mar 15, 2012, 3:13:15 PM3/15/12
to golan...@googlegroups.com
I'd suggest:
and a read-only textbox.

Hotei

unread,
Mar 15, 2012, 4:05:52 PM3/15/12
to golan...@googlegroups.com


On Thursday, March 15, 2012 1:51:38 PM UTC-4, Amitabh Arya wrote:

Hotei

unread,
Mar 15, 2012, 4:17:30 PM3/15/12
to golan...@googlegroups.com
The simplest PORTABLE way is with the http approach. I don't know very many environments without some form of web client. There are even web clients for text only consoles but it's been a while since I last used lynx. The other benefit of the http approach is that it's relatively simple (with Go) - probably less than 100 lines of code including documentation.  I've experimented with running temporary http servers just for viewing output of a long running program and it's not difficult at all - though it will increase your code size by a megabyte and change.


On Thursday, March 15, 2012 1:51:38 PM UTC-4, Amitabh Arya wrote:

Amitabh Arya

unread,
Mar 15, 2012, 7:25:27 PM3/15/12
to golang-nuts
This seems good option, but I afraid of less documentation.

Amitabh Arya

unread,
Mar 15, 2012, 7:28:12 PM3/15/12
to golang-nuts
Okie, so you are saying like a server which will be install at user
system and keep running and as user will open a browser page with
particular url (localhost...) then it will show the all those text and
then after like every 2 sec, auto refresh the page and keep adding new
text.

Right is this what you are suggestion or something else?

On Mar 15, 1:59 pm, Rémy Oudompheng <remyoudomph...@gmail.com> wrote:

Rémy Oudompheng

unread,
Mar 15, 2012, 7:41:25 PM3/15/12
to Amitabh Arya, golang-nuts
Le 16 mars 2012 00:28, Amitabh Arya <amitab...@gmail.com> a écrit :
> Okie, so you are saying like a server which will be install at user
> system and keep running and as user will open a browser page with
> particular url (localhost...) then it will show the all those text and
> then after like every 2 sec, auto refresh the page and keep adding new
> text.
>
> Right is this what you are suggestion or something else?

Modern Web technologies allows you to dynamically update the contents
of a page without fully reloading it. For example, latest versions of
Firefox and Chrome support websockets. But it may not suit your
audience.

Rémy.

Hotei

unread,
Mar 15, 2012, 9:31:38 PM3/15/12
to golan...@googlegroups.com
You have it pretty much correct. A point I'd clarify is that the webserver IS the program that's generating the logfile.  It's a single program executing with one goroutine to serve the web and another goroutine to crunch the numbers and generate the log.  The user then opens a URL something like "http://localhost:12345/log"  to view the output.  Auto-refresh is up to you.  In my case I refresh manually but auto-refresh might be useful if you're viewing this without keyboard/mouse handy.  As Rémy pointed out there are other options but you should be prepared to do a bit of HTML5 research first.  And it may - at least in the short term - limit the choice of browsers to those that support HTML5.  I know Chrome does and there may be others by now.

Abiola Ibrahim

unread,
Mar 15, 2012, 9:43:04 PM3/15/12
to golan...@googlegroups.com
You might want to check my calculator example using go-gtk http://abiola89.blogspot.com/2010/06/simple-calculator-using-go-language.html. Though pretty old but could be useful.
Reply all
Reply to author
Forward
0 new messages