James Steward | 13 Oct 05:38 2011
Picon

Stop plots eating events

How do I do this?

I want to receive key press and release events, as well as left button 
(button 1) press and release events.

Once the plot is first displayed I can get key press and release events, 
as well as scroll wheel events.

If I left click inside the plot area, from then on key press events do 
not happen, but key release still gets to my app.

Left click events never get through, but scroll and right or middle 
clicks do.

It seems the plot is swallowing the left click and key press events.

Can I configure it not to?

Regards,
James.

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
James Steward | 13 Oct 05:49 2011
Picon

Re: Stop plots eating events

James Steward wrote:
> How do I do this?
>
> I want to receive key press and release events, as well as left button 
> (button 1) press and release events.
>
> Once the plot is first displayed I can get key press and release events, 
> as well as scroll wheel events.
>
> If I left click inside the plot area, from then on key press events do 
> not happen, but key release still gets to my app.
>
> Left click events never get through, but scroll and right or middle 
> clicks do.
>
> It seems the plot is swallowing the left click and key press events.
>
> Can I configure it not to?
>   

I suppose I could comment out lines in gtkplotcanvas.c;

  widget_class->motion_notify_event = gtk_plot_canvas_motion;
  widget_class->button_press_event = gtk_plot_canvas_button_press;
  widget_class->button_release_event = gtk_plot_canvas_button_release;
  widget_class->key_press_event = gtk_plot_canvas_key_press;

Or set to NULL in my code.

Regards,
(Continue reading)

Luis A. Montes | 27 Oct 22:24 2011

GtkPlot with multiple datasets

I've been trying to use GtkExtra, specifically gtk plot to produce some
simple graphs. I have a single plot on a canvas, and then I add one
dataset. That seems to work. But when I add a second one using:

	pImpl->m_dataset[n] = GTK_PLOT_DATA(gtk_plot_data_new());
	gtk_plot_add_data(GTK_PLOT(pImpl->m_plot), pImpl->m_dataset[n]);

and then I try to set a different symbol for the second one using:

	gtk_plot_data_set_symbol(
		pImpl->m_dataset[n], symbol, GTK_PLOT_SYMBOL_OPAQUE,
		5, 1,
		&pImpl->m_color[color_ndx],&pImpl->m_color[color_ndx]
	);

It ends up using the same symbol for both. The odd part is that the
legend does show different symbols for each data set. It actually seems
as if the two datasets get spliced into one.
Since I was using a sort of an old version, I downloaded the latest
(3.0.1) and compiled it using mingw, but I found out that the tests
(testgtkplot*) don't work any more. I do remember them working before.
The changelog seems to imply that the GtkSheet part is working but the
GtkPlot is not? Is there anybody working on fixing GtkPlot? I could
help, but it'll be a steep learning curve for me.

Thanks

------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
(Continue reading)

James Steward | 27 Oct 23:13 2011
Picon

Re: GtkPlot with multiple datasets

Luis A. Montes wrote:
> I've been trying to use GtkExtra, specifically gtk plot to produce some
> simple graphs. I have a single plot on a canvas, and then I add one
> dataset. That seems to work. But when I add a second one using:
>
> 	pImpl->m_dataset[n] = GTK_PLOT_DATA(gtk_plot_data_new());
> 	gtk_plot_add_data(GTK_PLOT(pImpl->m_plot), pImpl->m_dataset[n]);
>
> and then I try to set a different symbol for the second one using:
>
> 	gtk_plot_data_set_symbol(
> 		pImpl->m_dataset[n], symbol, GTK_PLOT_SYMBOL_OPAQUE,
> 		5, 1,
> 		&pImpl->m_color[color_ndx],&pImpl->m_color[color_ndx]
> 	);
>
> It ends up using the same symbol for both. The odd part is that the
> legend does show different symbols for each data set. It actually seems
> as if the two datasets get spliced into one.

I had a similar, perhaps related problem yesterday.  I had one dataset 
with GTK_PLOT_CONNECT_STRAIGHT, then added a second dataset with 
GTK_PLOT_CONNECT_SPLINE and the second plot went weirdo (technical term 
for FUBAR).

When I set both to SPLINE, I got;

ERROR:gtkplotdata.c:5274:spline_eval: assertion failed: (h > 0.0)

Yay.
(Continue reading)

Luis A. Montes | 28 Oct 21:20 2011

Re: GtkPlot with multiple datasets

Thanks both for your answers,

I did try gtk 3.0.1 under Linux (Ubuntu 10.04) and the tests work. On
Windows pkg-config --modversion gtk+-2.0 reports 2.22.0, on ubuntu I get
2.20.1. What do you get under solaris? I'm going to try installing 2.20
on windows, perhaps that has something to do with the tests not working?
Some deprecated functions might have gotten nuked.

Thanks

Luis

On Fri, 2011-10-28 at 18:53 +0200, Fredy Paquet wrote:
> Hello Luis
> 
> The plot widgets of gtkextra-3 are working properly on Solaris here.
> 
> I did a few tests on MinGW today and can confirm the drawing problem.
> 
> >From gtkextra-2 to gtkextra-3, the drawing base was rewritten to use Cairo.
> The sheet code in gtkextra-3 is still based on GDK and has not yet been 
> rewritten.
> 
> fp
> 
> --On Thursday, October 27, 2011  1:24:03 PM -0700 "Luis A. Montes" 
> <luis <at> qdusa.com> wrote:
> 
> > I've been trying to use GtkExtra, specifically gtk plot to produce some
> > simple graphs. I have a single plot on a canvas, and then I add one
(Continue reading)

Luis A. Montes | 31 Oct 18:29 2011

repaint on resize

Hi,

I've solved my problem with multiple sets, it was actually on my code,
not gtkextra. I'm not using 3.0.1 yet, though. But I want to get it
working with my current version and then I can try to see if I can
figure out why 3.0.1 is not drawing on the canvas under MS windows.
The only thing left before I do that is to repaint the plot after a
window resize. The plot seems to repaint itself on an expose event (that
is, if I cover the window and then uncover it, it repaints) but several
combinations of gtk_plot_paint and/or send_expose on_size_allocate,
on_idle, on_realize either don't do anything or produce a SIGV. Anybody
has some trick that can share?

The last thing I tried involved sending a delayed expose event (I'm
using gtkmm):

void GtkPlotWrapper::on_size_allocate( Gtk::Allocation &allocation )
{
	set_allocation( allocation );
	gtk_plot_canvas_set_size(
		GTK_PLOT_CANVAS(pImpl->m_canvas), 
		allocation.get_width(), 
		allocation.get_height() );
	gtk_widget_set_uposition(
		GTK_WIDGET(pImpl->m_canvas),
		allocation.get_x(),
		allocation.get_y() );
	pImpl->m_resized = true;
	pImpl->m_resized_time_stamp = clock();
}
(Continue reading)


Gmane