1. GUI Guidance for Linux
- Posted by Anthill Nov 28, 2010
- 1466 views
Any ideas where to best start for writing GUI applications on Linux with Euphoria? I would prefer to write graphics applications that are cross platform but if not at least for Linux.
I see that there is wxEuphoria (http://sourceforge.net/projects/wxeuphoria/) and EuGTK (http://sourceforge.net/projects/eugtk/). What I want to do is write an application that draws text (preferably with access to font metrics), points, lines and polygons and have access to some basic widgets such as buttons and scrollbars. Is there a way to do this with Euphoria and are there any tutorials that might help.
Thanks for any help...
2. Re: GUI Guidance for Linux
- Posted by menno Nov 29, 2010
- 1329 views
There is a small graph. application with works in linux and windows . see : http://www.rapideuphoria.com/cgi-bin/asearch.exu?lnx=on&gen=on&keywords=graphapp
This is about 600kb with examples .
3. Re: GUI Guidance for Linux
- Posted by ChrisB (moderator) Nov 29, 2010
- 1265 views
Hi
Don't forget IUP
http://jeremy.cowgar.com/euiup/
Chris
4. Re: GUI Guidance for Linux
- Posted by irv Nov 29, 2010
- 1277 views
EuGTK does that quite easily. Here's a snippet from test38.ex (included with EuGTK) which draws the primitives:
switch whichbutton do case CLEAR then clear(canvas) case BKGND then set(drawable,"modify bg",0,rcolor) case LINES then draw_line(canvas,gc,x1,y1,x2,y2) case RECTS then draw_rectangle(canvas,gc,TRUE,x1,y1,w,h) case ARCS then draw_arc(canvas,gc,TRUE,x1,y1,w,h,a1,a2) case PIX then draw_pixbuf(canvas,gc,img,0,0,w,h,dim[1],dim[2]) case STR then draw_string(canvas, pangofont("Courier 18"),gc,0,0,"Hello World!") end switch
Setting up a 'canvas' to draw upon is just 4 lines of code:
constant drawable = create(GtkDrawingArea) constant style = get(drawable,"style"), canvas = peek4u(drawable + 52), gc = peek4u(style + 540)
5. Re: GUI Guidance for Linux
- Posted by mattlewis (admin) Nov 29, 2010
- 1217 views
What I want to do is write an application that draws text (preferably with access to font metrics), points, lines and polygons and have access to some basic widgets such as buttons and scrollbars. Is there a way to do this with Euphoria and are there any tutorials that might help.
Take a look at the wxEuphoria demo bench_draw.exw. It draws polygons, lines and points. There's also the hexes.exw and triangles.exw demos, which basically draw polygons on the screen and allow some user interaction with them.
There are several functions for dealing with font information as well.
Matt