problem about SIGSEGV and backtrace

2007-08-05 Thread dashikugua
Hi all:
 
I want to use SIGSEGV and backtrace  to debug my programme. But I do not 
know how to use them. I'm running GTK 2.6.4 and Glib 2.6.4 on a Debian woody.

Could you please guide me and tell where to find what I am looking for?

Any help will be most appreciated. Thanks a lot.
 
 
 
 


你 玩 过 大 富 翁 吗?与 朋 友 网 络 对 战,还 能 一 起 挑 战 GM  ___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Problem with GdkPixbuf

2007-07-04 Thread dashikugua
 

Hi all:
I'm using the Gtkimage and GdkPixbuf to show picture and each time I run 
the program I get the following error:
 
GLib-Gobject-CRITICAL ** : g_object_unref : assertion `G_IS_OBJECT(object)` 
failed
 
I'm running GTK 2.6.4 and Glib 2.6.4 on a Debian woody.Here is the code which 
reproduces the problem:
 
#include gtk/gtk.h

int main( int argc,
  char *argv[] )
{
  GtkWidget *window;
  GtkWidget *image;
  GdkPixbuf *pix1;
  GdkPixbuf *pix2;
  
  gtk_init(argc, argv);

  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  image = gtk_image_new_from_file (1.png);

  gtk_container_set_border_width (GTK_CONTAINER (window), 10);
  gtk_container_add (GTK_CONTAINER (window), image); 

  pix1=gtk_image_get_pixbuf(GTK_IMAGE(image));
  pix2=gdk_pixbuf_scale_simple(pix1,320,160,GDK_INTERP_BILINEAR);
  gtk_image_set_from_pixbuf(GTK_IMAGE(image),pix2);
  g_object_unref(pix1);
  g_object_unref(pix2);  
 
  gtk_widget_show (image);
  gtk_widget_show (window);

  gtk_main ();

  return(0);
}

 
I have no idea how to resolve the problem.Any help will be most 
appreciated.Thanks.
 
 


百 万 玩 家 同 玩 的 乐 园,人 气 爆 发 的 梦 幻 西 游  ___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


how to draw curves

2007-05-28 Thread dashikugua
Hi all:
 
My application is using gtk to design the GUI for an Arbitrary/Function 
Generator. So I need to draw lots of curves, including sine wave, ramp wave, 
pulse wave, noise wave..and their modulation waves, e.g. the AM, FM, PM, 
FSK and so on.
My problem is that I haven't found a good method to draw these waves. I have 
used GDK to draw sine wave on the GtkDrawingArea. But I found this method is a 
little complicated especially when I draw the modulation waves. Is there a good 
way to draw curves ?
Any help would be appreciated.Thanks
 
 


梦幻西游,千万人的选择,你的选择  ___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


the button how to receive key presses

2007-05-14 Thread dashikugua
Hi all :
 
Sorry for my English.
I want to know the GtkButton how to recieve key presses event in my 
application. In my app, there are three GtkEntries in the left part of the 
window and three GtkButtons in the right. I want the buttons to receive only 
the specific alphabetic key (e.g. GDK_a,GDK_b,GDK_c)from the keyboard input and 
activate the corresponding entry in the callbacks function of the button' key 
press event.The entrys receive and show the numeric key and not react to the 
alphabetic key input.  My problem is that when one entry is actived, how can I 
make the button receive the key press event when I input the alphabetic key.For 
example,now the first entry is actived(this entry has text ,e.g.1000 ) . I want 
to press the GDK_b the active the second entry and keep 1000 in the first 
entry. But when I press GDK_b,it's the first entry that receives and shows the 
b not the first button receive the key presees event. I think the reason is 
that it's the entry that is getting  the focus not the button.
I don't know how to solve the problem. Any help will be appreciated. Thanks.
 
 ___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Gtk Curve problem

2007-05-08 Thread dashikugua
Hi all:
I'm using the GtkCurce to draw line and each time I run the program I get 
the following error:
 
GLib-ERROR **: gmem.c: 135: failed to allocate 4294967276 bytes
aborting...
 
I'm running GTK 2.6.4 and Glib 2.6.4 on a Debian woody.Here is the code which 
reproduces the problem:
 
#include gtk/gtk.h

int main( int argc,
  char *argv[] )
{
  GtkWidget *window;
  GtkWidget *curve;
  gfloat points[] = {0, 0,  0.5, 0.5,  1, 1};
  
  gtk_init(argc, argv);

  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  curve = gtk_curve_new ();

  gtk_container_set_border_width (GTK_CONTAINER (window), 10);
  gtk_container_add (GTK_CONTAINER (window), curve); 

  gtk_widget_show (curve);
  gtk_widget_show (window);

  gtk_curve_set_range (GTK_CURVE(curve), 0, 1, 0, 1);
  gtk_curve_set_vector (GTK_CURVE(curve), 3, points);
  gtk_curve_set_curve_type(GTK_CURVE(curve), GTK_CURVE_TYPE_SPLINE);

  gtk_main ();

  return(0);
}

I have no idea how to resolve the problem.Any help will be most 
appreciated.Thanks.
 
 ___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list