Scrolling problem

2008-09-21 Thread Dupuit Cyril
Hello,

I am building a widget used to draw curves using Gdk under WinXp.

It works fine but I have a problem with the scroll bar.

When I move the scroll bar cursor, the widget is not immediately redrawn
and some bad lines appear before the good redraw (old lines with an
offset corresponding with the scroll bar cursor move). This is an
example : 

  before moving   during move
After moving
 ___   ___
___ 
|   | |   |
|   |
|   .   | |   .   |
|.  |
|   |   | | | |
||  |
|   \   | |  \|
|\  |
|\  | |\  |
| \ |
| \ | |  \|
|  \|
  


The lines moves with before redraw.



The main of my application is something like that :

void AppCreate(void)
{
...
pScroll = gtk_scrolled_window_new(NULL, NULL);
gtk_scrolled_window_set_placement(GTK_SCROLLED_WINDOW(pScroll),
GTK_CORNER_TOP_LEFT);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(pScroll),
GTK_POLICY_ALWAYS, GTK_POLICY_ALWAYS);

gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(pScroll),
GTK_SHADOW_IN);

pArea-pPlot = mywidget_new();
gtk_container_add(GTK_CONTAINER(pScroll), pArea-pPlot);
...
gtk_widget_show_all(pApp-pNotebook);
}

I think that all is correct at this level.

To draw curves (the maximum is 4000 points), I use gdk_draw_segments()
and gdk_draw_arc().

But when there is a low number of points (about 100), all works without
a strange behavior and when I draw 4000 points, the strange behaviour
appears.

In the scroll bar management callback (value_changed signal), I have
the following code :

{
  mywidget* pPlot = (mywidget*) (data);
  gdouble value;
  gint dx;

  value = pH-value;
  dx = (gint)(value - pPlot-Range.MinX);
  pPlot-Range.MinX = value;

  if (GTK_WIDGET_DRAWABLE (pPlot))
{
GdkRectangle Rect = pPlot-widget.allocation;

Rect.x = 0;
Rect.y = 0;

gdk_window_invalidate_rect(pPlot-widget.window, Rect, FALSE);
  gdk_window_scroll (pPlot-widget.window, dx, 0);
}
}

I use the gdk_window_invalidate_rect() function to be sure that the
widget is redrawn.

If it is not clear, I can explain better this problem.

Thank you for any response,

Cyril


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


Packing a button in a GtkCellRenderer

2008-09-21 Thread Andrew Smith

Hi

I have a GtkTreeView with one column, and two renderers - a pixbuf and a 
string. It looks like this:


ICON SomeRandomString

That part works fine. What I'd like to add is 2 or 3 buttons to each 
row, so it'd look like this:


ICON SomeRandomString Button1 Button2

Ideally I'd like to be able to put an image in each button, but plain 
text would get me started. I also need to modify the text in the buttons 
and conneced to their 'clicked' signals.


Could someone recommend something please? I can't figure out what I'm 
supposed to be looking for.


A custom cell renderer (as in 
http://scentric.net/tutorial/sec-custom-cell-renderers.html ) seems to 
be a lot of work, apparently I have to render the button myself.. but I 
may be misunderstanding.


Could someone give some advice please?

Thanks in advance,

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


Re: Help with the GTKFileChooser in Windows

2008-09-21 Thread Mackram Raydan
 I was wondering if someone can help point me out to the reason that I
 can not get the GTK File Chooser Dialog (or widget for that matter) to
 work in Windows XP.

Does the same code work for you on Unix and X11, then?

Yes it does

Please show us (preferrably by pointing to a web location) a minimal
but complete sample program that exhibits the problem. Or open a bug
report, attach the sample program there, and refer to that in mail to
this list.

If you would like to check the issue I submitted a buy and attached to it
the smallest possible sample program to show the error. It can be found at
http://bugzilla.gnome.org/show_bug.cgi?id=553182

And thanks in advance for any help you can provide.

 Mackram Raydan
An invasion of armies can be resisted, but not an idea whose time has
come.---Victor Hugo


On Sun, Sep 21, 2008 at 4:30 AM, Tor Lillqvist [EMAIL PROTECTED] wrote:

  I was wondering if someone can help point me out to the reason that I
  can not get the GTK File Chooser Dialog (or widget for that matter) to
  work in Windows XP.

 Does the same code work for you on Unix and X11, then?

 Please show us (preferrably by pointing to a web location) a minimal
 but complete sample program that exhibits the problem. Or open a bug
 report, attach the sample program there, and refer to that in mail to
 this list.

 --tml

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


Re: Packing a button in a GtkCellRenderer

2008-09-21 Thread Emmanuele Bassi
On Sun, 2008-09-21 at 17:57 -0400, Andrew Smith wrote:

 A custom cell renderer (as in 
 http://scentric.net/tutorial/sec-custom-cell-renderers.html ) seems to 
 be a lot of work, apparently I have to render the button myself.. but I 
 may be misunderstanding.

no, you understood correctly: you need to write a custom cell renderer
that draws a button.

ciao,
 Emmanuele.

-- 
Emmanuele Bassi,
W: http://www.emmanuelebassi.net
B: http://log.emmanuelebassi.net

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


Re: [win32] Spawning process : Invalid argument

2008-09-21 Thread gege2061
2008/9/19 Tor Lillqvist [EMAIL PROTECTED]

 Do you have gspawn-win32-helper.exe and
 gspawn-win32-helper-console.exe in your PATH, or in the bin folder
 under your GLib installation directory?


No, now, it's works fine.


 There is little reason to insist on using the g_spawn*() API in cases
 where a standard system() should work just as well, and be simpler.


In the vala language, I don't have system function. And g_spawn* is simpler
for get the output of a program.

Thank's.

-- 
Nicolas Joseph

Responsable de la rubrique GTK+ de developpez.com /
In charge of the GTK+ section on developpez.com

http://nicolasj.developpez.com
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Packing a button in a GtkCellRenderer

2008-09-21 Thread Andrew Smith

Emmanuele Bassi a écrit :

On Sun, 2008-09-21 at 17:57 -0400, Andrew Smith wrote:

A custom cell renderer (as in 
http://scentric.net/tutorial/sec-custom-cell-renderers.html ) seems to 
be a lot of work, apparently I have to render the button myself.. but I 
may be misunderstanding.


no, you understood correctly: you need to write a custom cell renderer
that draws a button.

ciao,
 Emmanuele.

Ok, so does that mean I'll have to reimplement GtkButton? That's why I 
say it seems to be a lot of work.


Or can I use a GtkButton in a cell renderer?

Is there a tutorial or some sample code somewhere anyone knows of that 
could help me figure this out?


Thanks

Andrew

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