Re: GTK3 + gnuplot

2018-09-18 Thread Eric Cashon via gtk-app-devel-list
 Hi Arkkimede,

With gnuplot you can output to a file and then open the file with GTK+.

https://gitlab.com/cecashon/OrderedSetVelociRaptor/blob/master/Misc/Pipes/gnuplot5.c

At one time gnuplot could directly write to GTK but that was a possible 
security problem so it no longer works to do this.

Gnuplot has 3d graphing plots and I think that it does this with cairo. You can 
graph in 3d with cairo but you need to do a few extra calculations before 
drawing with cairo. The Graphene library has a number of functions that are 
very helpful for drawing in 3d. It is part of GTK4 but you can use it in GTK3.

https://developer.gnome.org/graphene/stable/ch01.html

Another option is to write your own helper functions for drawing with cairo in 
3d.

https://gitlab.com/cecashon/OrderedSetVelociRaptor/blob/master/Misc/cairo_drawings/perspective3.c
https://gitlab.com/cecashon/OrderedSetVelociRaptor/blob/master/Misc/cairo_drawings/perspective4.c
https://gitlab.com/cecashon/OrderedSetVelociRaptor/blob/master/Misc/cairo_drawings/shadow1.c
https://gitlab.com/cecashon/OrderedSetVelociRaptor/blob/master/Misc/cairo_drawings/shadow2.c
https://gitlab.com/cecashon/OrderedSetVelociRaptor/blob/master/Misc/cairo_drawings/spring2.c

So options abound for putting together a 3d plotting widget in GTK.

Eric
 
 
-Original Message-
From: arkkimede via gtk-app-devel-list 
To: gtk-app-devel-list list 
Sent: Tue, Sep 18, 2018 9:20 am
Subject: GTK3 + gnuplot

Hi!
I've developed an application in c to make measurements, with a GUI that
manage the inputs and it is able to produce graphical results in terms of
2d plots, realized by mean of the library Cairo.

Now I have the necessity to produce 3d plots (3d radiation pattern of
antennas).

To realize 3d plots by mean of a 2d library, is not impossible but very
hard.
A solution could be using gnuplot that I'he yet used to produce high
quality 3d plots.

The question now is: "How to embed a gnuplot graphic in gtk3?
Could you say, please, where to find a simple example, just to undestand
how it is possible to do that?

Thank you
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: GTK3 + gnuplot

2018-09-18 Thread Allin Cottrell

On Tue, 18 Sep 2018, arkkimede via gtk-app-devel-list wrote:


The question now is: "How to embed a gnuplot graphic in gtk3?
Could you say, please, where to find a simple example, just to undestand
how it is possible to do that?


Get gnuplot to produce a PNG file, load the PNG into a GdkPixbuf, then
stick the GdkPixbuf onto a cairo surface.

You could take a look at
https://sourceforge.net/p/gretl/git/ci/master/tree/gui/gpt_control.c
in particular the function render_pngfile().

--
Allin Cottrell
Department of Economics
Wake Forest University, NC

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: GTK3 + gnuplot

2018-09-18 Thread Chris Moller
That would be awkward in gnuplot--you'd have to create the plot and then 
load it as a pixmap or some such.  But there's a utility call plplot 
that's designed to be embedded in other applications and it might work 
better.


https://tschoonj.github.io/blog/2015/07/05/embedding-plplot-in-gtk-drawingareas/

and

https://sourceforge.net/p/plplot/mailman/message/26169132/

might help.

On 18/09/18 12:19, arkkimede via gtk-app-devel-list wrote:

Hi!
I've developed an application in c to make measurements, with a GUI that
manage the inputs and it is able to produce graphical results in terms of
2d plots, realized by mean of the library Cairo.

Now I have the necessity to produce 3d plots (3d radiation pattern of
antennas).

To realize 3d plots by mean of a 2d library, is not impossible but very
hard.
A solution could be using gnuplot that I'he yet used to produce high
quality 3d plots.

The question now is: "How to embed a gnuplot graphic in gtk3?
Could you say, please, where to find a simple example, just to undestand
how it is possible to do that?

Thank you
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

State actions and Glade

2018-09-18 Thread Mitko Haralanov via gtk-app-devel-list
I am trying to write an application using Glade where the tool bar contains
a set of radio tool buttons. Those radio tool buttons should not perform an
action when activated but rather just change the associated action's state.

For that I've set the 'Action Name' property for the tool buttons in Glade
as 'win.radio-state(0)' and 'win.radio-state(1)'.

Since the only thing that I am after is the action's state, I don't even
need a 'chage_state' handler in the action definition. Therefore, the
GActionEntry for the radio buttons is defined as:
{"radio-state", NULL, "i", "0", NULL}

However, no matter what I do, the tool radio buttons are never 'sensitive'
and I can never click on them.

How should I be using state actions with Glade? It seems that I am doing
things as described by https://wiki.gnome.org/HowDoI/GAction but it still
does not work.

Thank you for your help.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


GTK3 + gnuplot

2018-09-18 Thread arkkimede via gtk-app-devel-list
Hi!
I've developed an application in c to make measurements, with a GUI that
manage the inputs and it is able to produce graphical results in terms of
2d plots, realized by mean of the library Cairo.

Now I have the necessity to produce 3d plots (3d radiation pattern of
antennas).

To realize 3d plots by mean of a 2d library, is not impossible but very
hard.
A solution could be using gnuplot that I'he yet used to produce high
quality 3d plots.

The question now is: "How to embed a gnuplot graphic in gtk3?
Could you say, please, where to find a simple example, just to undestand
how it is possible to do that?

Thank you
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list