Re: repaint on resize
"Luis A. Montes" <[email protected]> Mon, 31 Oct 2011 17:23:02 -0700
| Newsgroups | gmane.comp.scigraphica.gtkextra |
|---|---|
| Organization | Quantum Design |
| Message-ID | <1320106982.21084.1574.camel@firmware> |
On Mon, 2011-10-31 at 19:49 +0100, Fredy Paquet wrote: > While debugging the MinGW problem last saturday, i found out that > the cairo drawing functions get called, with arguments looking good to me. > > Does the plot really show up when you hide and expose it ? > (it doesn't with my installation here on WinXP/Gtk 2.24.4, testgtkplot.exe > shows only 3 lines, 1 black and 2 grey.) No, I'm sorry, I meant on my own program it does show after hiding/exposing, but that's still using GtkExtra 2.* > > I can select each of the two plots and drag it around, the drag rectangle > appears. Yes, same behavior on testgtkplot.exe using Gtk 2.22.0 on WinXP > > To get over the SEGV, you could try to switch the plot invisible an back > visible again, > which causes a complete redraw... but this wouldn't solve the underlying > problem. I found that I was using a Gtk+/GtkExtra/MyProgram combination that was linked against different MSVC runtimes (for my own program I'm using MSVC 2005) That was the source of the SEGV (or access violation, as it is called on the MS world). So I recompiled it using MSVC 2005 and now it doesn't segfaults and I can use: gtk_plot_canvas_paint( GTK_PLOT_CANVAS(pImpl->m_canvas) ); on my overloaded on_size_allocate to regenerate my plot nicely. > > The strange thing is, that it all works fine on Linux and Solaris, so > where's the difference? I wonder if the problem is related. When I compile with MinGW, dependency walker (ldd for windows) shows it linking against MSVCRT.dll. My program, on the other hand, links against one of the MSVCR80.DLL in the windows side by side directory. > fp > > > --On Monday, October 31, 2011 10:29:32 AM -0700 "Luis A. Montes" > <[email protected]> wrote: > > > 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(); > > } > > > > bool GtkPlotWrapper::on_idle() > > { > > if (pImpl){ > > if ((pImpl->m_resized)&&(clock()-pImpl->m_resized_time_stamp>500)) > > send_expose((GdkEvent *)&pImpl->m_event); > > pImpl->m_resized = false; > > } > > return true; > > } > > > > If I change the send_expose with a gtk_plot_paint it segfaults. > > > > Thanks again, > > > > Luis > > > > > > ------------------------------------------------------------------------- > > ----- Get your Android app more play: Bring it to the BlackBerry PlayBook > > in minutes. BlackBerry App World™ now supports Android™ Apps > > for the BlackBerry® PlayBook™. Discover just how easy and simple > > it is! http://p.sf.net/sfu/android-dev2dev > > _______________________________________________ > > Scigraphica-gtkextra mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/scigraphica-gtkextra > > > > > ------------------------------------------------------------------------------ RSA® Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1