Re: Problem: hiding window

2006-04-15 Thread Daniel Pekelharing
On Fri, 2006-04-14 at 21:21 -0700, Deependra Shekhawat wrote:
 void on_butt_close_clicked(GtkButton *button,gpointer
 user_data)
 {
gtk_widget_hide((GtkWidget *)user_data);
 }

I may be wrong about this, but I think you want to write this function
like:

gint on_butt_close_clicked(GtkButton *button, gpointer user_data)
{
gtk_widget_hide((GtkWidget *)user_data);
return TRUE;
}

Returning TRUE will prevent the window from being destroyed..

Hope this helps..

-- 
Daniel Pekelharing
[EMAIL PROTECTED]

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


Re: Problem: hiding window

2006-04-15 Thread Chris Vine
On Saturday 15 April 2006 05:21, Deependra Shekhawat wrote:
 Hello friends,

 I want to hide a window when user clicks either on the
 close button or press the close (CROSS) on the
 top-right of every window.
 Here is my code:

 GtkWidget *window1;
 GtkWidget *butt_close;

 g_signal_connect((gpointer)butt_close,clicked,
 G_CALLBACK (on_butt_close_clicked),   (gpointer)
 window1);

 g_signal_connect ((gpointer) window1, destroy,
   G_CALLBACK (on_butt_close_clicked), (gpointer)
 window1);

 void on_butt_close_clicked(GtkButton *button,gpointer
 user_data)
 {
gtk_widget_hide((GtkWidget *)user_data);
 }

 The window hides up when I click the close button but
 when I try and hide it through clicking the close
 button on the top right of the window it gives the
 following error:

[snip]

You cannot call gtk_widget_hide() on a widget when it is destroyed (its 
GdkWindow has gone).  You probably meant to connect to the delete-event 
signal.  That is what is emitted when you click the top right button you 
refer to.

Chris

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


Xlib: unexpected async reply

2006-04-15 Thread Fernando ApesteguĂ­a
Hi list!

I get this error when runing my GTK application:

Xlib: unexpected async reply (sequence 0xdfd)!
(Te sequence number varies.)


A little explanation about the application:

It runs two threads. One of them is runing inside the gtk_main() loop.
The other one, periodically reads from different files and updates the
labels in the window. I use gdk_threads_enter() and gdk_threads_leave() to
block the other thread.

The aplication has a Tabbed Pane. Each tab shows information from a
different file.

Now, I get this error when I try to see the information showed by the last
tab I added. Basically, the cycle I implement is (pseudocode):

infinite_loop{
  ...
  if tab1_is_visible{
update_tab
  }
  ...
 pause;
}

and update_tab performs:

read_value_from_file();

gdk_threads_enter();
  update_labels();
gdk_threads_leave();

Since the error is realted to Xlib, I think I'm doing something wrong about
multi-threading, but I can't find what.
I'm doing as I did with the other tabs and I hadn't any errors like this

I've read http://mail.gnome.org/archives/gtk-list/1999-July/msg00438.htmlbut
I think this does not match my problem. I'm not calling to gtk
functions
from callbacks or signal handlers.

Any suggestions?

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


Xlib: unexpected async reply

2006-04-15 Thread Fernando ApesteguĂ­a
Hi, it's me again... now a bit embarrassed

I found the problem after more and more debugging.
The read_data_from_file() function was a function with variable number of
parameters implemented with va_list...
Due to a stupid mistake this function did not return when a certain number
of parameters was passed and then the function run into an infinite loop.

So I suppose that the message queue of Xlib was overflowed in some way.

Well, I hope this is helpful for someone with a similar problem :)

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


Re: selected text is PRIMARY?

2006-04-15 Thread Yevgen Muntyan

Xavier Bestel wrote:


It does not cause any problem. Just some people want to switch from a
well-defined behavior (one PRIMARY per DISPLAY) 


Noone wants to change *this*.


to a fuzzy one: you want
to have several selections, but how many ?
- One selection per application ?
- One selection per window ?
- One selection per widget ?
 


One selection per whatever thing user can select text in.
Just think about select text using mouse and it becomes
pretty simple.
I believe it means one selection per widget in practice,
though there may be crazy widgets which can have multiple
selections as well (maybe some canvas with fancy stuff inside).


(Note that you can have more than one application per window).
 


You do not select text in applications, you select it in windows,
controls, widgets, boxes, etc.


I smell the mess, inconsistent between toolkits and applications.
 


We already have inconsistency between toolkits and applications,
it's not a reason to continue to limit useful functionality.


Keep to well-defined and simple behavior, guys.
 


What exactly in multiple selections business is complicated or not
well-defined? The question how many above is not an answer:
it's the same question as whether given widget should be able to
have selection at all.

Regards,
Yevgen

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


GLib/GModule Memory Leak?

2006-04-15 Thread Nathaniel McCallum
I hope this is the right list to ask this on.  I ran valgrind on an
application I'm developing with glib using gmodule.  Results attached.
Am I just worried about something that's not a big deal or is this a bug
I should file?

Thanks,
Nathaniel
==26126== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 45 from 1)
==26126== malloc/free: in use at exit: 1,896,158 bytes in 5,100 blocks.
==26126== malloc/free: 875,754 allocs, 870,654 frees, 23,190,938 bytes 
allocated.
==26126== For counts of detected errors, rerun with: -v
==26126== searching for pointers to 5,100 not-freed blocks.
==26126== checked 1,820,892 bytes.
==26126==
==26126== 20 bytes in 1 blocks are still reachable in loss record 1 of 6
==26126==at 0x40045EB: calloc (vg_replace_malloc.c:279)
==26126==by 0xD5A45D: _dlerror_run (in /lib/libdl-2.4.so)
==26126==by 0xD59D48: dlopen@@GLIBC_2.1 (in /lib/libdl-2.4.so)
==26126==by 0xDD5568: g_module_open (in /usr/lib/libgmodule-2.0.so.0.1000.1)
==26126==by 0x80499A1: nw_plugin_load (plugin.c:107)
==26126==by 0x8049A65: nw_plugin_load (plugin.c:135)
==26126==by 0x80495D0: main (noweb.c:29)
==26126==
==26126==
==26126== 30 bytes in 2 blocks are still reachable in loss record 2 of 6
==26126==at 0x40051F9: malloc (vg_replace_malloc.c:149)
==26126==by 0x99D665: g_malloc (in /usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0x9B0538: g_strdup (in /usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0x9BA341: g_get_charset (in /usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0x99F2CC: g_printerr (in /usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0x40117B3: ???
==26126==by 0x80494F3: log_request_factory (logger.c:13)
==26126==by 0x804973E: main (noweb.c:65)
==26126==
==26126==
==26126== 144 bytes in 3 blocks are still reachable in loss record 3 of 6
==26126==at 0x40051F9: malloc (vg_replace_malloc.c:149)
==26126==by 0x4005271: realloc (vg_replace_malloc.c:306)
==26126==by 0x99D52A: g_realloc (in /usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0x97E220: (within /usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0x97E5A3: g_array_set_size (in /usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0x9B429C: g_static_private_set (in 
/usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0xDD5089: g_module_supported (in 
/usr/lib/libgmodule-2.0.so.0.1000.1)
==26126==by 0x80498B9: nw_plugin_init (plugin.c:73)
==26126==by 0x80495A4: main (noweb.c:25)
==26126==
==26126==
==26126== 2,776 bytes in 5 blocks are possibly lost in loss record 4 of 6
==26126==at 0x40044B3: memalign (vg_replace_malloc.c:332)
==26126==by 0x4004509: posix_memalign (vg_replace_malloc.c:384)
==26126==by 0x9AC3A8: (within /usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0x9AD65B: g_slice_alloc (in /usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0x97E688: g_array_sized_new (in 
/usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0x97E796: g_array_new (in /usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0x9B42C2: g_static_private_set (in 
/usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0xDD5089: g_module_supported (in 
/usr/lib/libgmodule-2.0.so.0.1000.1)
==26126==by 0x80498B9: nw_plugin_init (plugin.c:73)
==26126==by 0x80495A4: main (noweb.c:25)
==26126==
==26126==
==26126== 3,612 bytes in 6 blocks are still reachable in loss record 5 of 6
==26126==at 0x40045EB: calloc (vg_replace_malloc.c:279)
==26126==by 0x99D5CD: g_malloc0 (in /usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0x9B339B: g_thread_self (in /usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0x9B413E: g_static_private_set (in 
/usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0xDD5089: g_module_supported (in 
/usr/lib/libgmodule-2.0.so.0.1000.1)
==26126==by 0x80498B9: nw_plugin_init (plugin.c:73)
==26126==by 0x80495A4: main (noweb.c:25)
==26126==
==26126==
==26126== 1,889,576 bytes in 5,083 blocks are still reachable in loss record 6 
of 6
==26126==at 0x40044B3: memalign (vg_replace_malloc.c:332)
==26126==by 0x4004509: posix_memalign (vg_replace_malloc.c:384)
==26126==by 0x9AC3A8: (within /usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0x9AD637: g_slice_alloc (in /usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0x97E688: g_array_sized_new (in 
/usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0x97E796: g_array_new (in /usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0x9B42C2: g_static_private_set (in 
/usr/lib/libglib-2.0.so.0.1000.1)
==26126==by 0xDD5089: g_module_supported (in 
/usr/lib/libgmodule-2.0.so.0.1000.1)
==26126==by 0x80498B9: nw_plugin_init (plugin.c:73)
==26126==by 0x80495A4: main (noweb.c:25)
==26126==
==26126== LEAK SUMMARY:
==26126==definitely lost: 0 bytes in 0 blocks.
==26126==  possibly lost: 2,776 bytes in 5 blocks.
==26126==still reachable: 1,893,382 bytes in 5,095 blocks.
==26126== suppressed: 0 bytes in 0 blocks.
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org

clipboard debugging tool?

2006-04-15 Thread Robert Roebling

  Hi,

is there something like a clipboard debugging
tool (showing all available formats, th data
length, contents, maybe encoding etc.)? There
are such tools for Win and Mac, but I haven't
found any for X11 or (GTK+).

  Robert

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


Small app for previewing gtk widgets

2006-04-15 Thread Christophe Dehais
hello everyone,It seem that there exists a small app that shows all the main GTK+ widgetsin a single window, but I can't find it and none of my google searches helped.Is anyone as a link for this ?
thanks,Christophe
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Small app for previewing gtk widgets

2006-04-15 Thread Michael Ott
Hello Christophe!

 It seem that there exists a small app that shows all the main GTK+ widgets
 in a single window, but I can't find it and none of my google searches helped.
Use glade. This is not exact the thing you looking after but it can show
and it can show how work widget which each other and you can resize it.

 Is anyone as a link for this ?
http://glade.gnome.org/

CU
 
  Michael  
  
-- 
,''`.   Michael Ott, e-mail: michael at zolnott dot de
   : :' :   Debian SID on Thinkpad T43: 
   `. `'http://www.zolnott.de/laptop/ibm-t43-uc34nge.html 
 `-


pgp6wjC0d3hRg.pgp
Description: PGP signature
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Small app for previewing gtk widgets

2006-04-15 Thread Luca Cavalli
On Sat, 2006-04-15 at 17:34 +0200, Christophe Dehais wrote:
 hello everyone,
 
 It seem that there exists a small app that shows all the main GTK+
 widgets
 in a single window, but I can't find it and none of my google searches
 helped.
 
 Is anyone as a link for this ?
 
 thanks,
 Christophe


Hi,
maybe it is Widget Factory:
http://www.stellingwerff.com/?p=9


Ciao,

Luca

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


(no subject)

2006-04-15 Thread Adi Roiban
i have to apply some image processing algorithms using gdk. They all involve 
only operation on colormap and not directy on the pixels.
Can you give me some tips about what stuctures should i used.

i tried using a GtkImage whick store information in gdk-pixbuf and then convert 
the pixbuf into pixmap and then set a colormap to the pixmap, but in this way 
modifying the colormad does not modify the pixmap.

GdkPixbuf *pixbuf;
GdkPixmap *pixmap;
GdkColor color;
GdkVisual *visual = gdk_visual_get_best() ;
GdkColormap *colormap =gdk_colormap_new (visual,FALSE);

//image_active is a GtkImage create with gtk_image_new_from_file
pixbuf = gtk_image_get_pixbuf ( GTK_IMAGE(image_active));

for (i=0; i  colormap-size; i++){
if (colormap-colors){
 colormap-colors[i].red=0;

}
}

pixmap = gdk_pixmap_new ( NULL, 
gdk_pixbuf_get_width(pixbuf),
gdk_pixbuf_get_height (pixbuf),
3*gdk_pixbuf_get_bits_per_sample(pixbuf));
gdk_drawable_set_colormap (pixmap, colormap);

gdk_draw_pixbuf ( pixmap, NULL, pixbuf, 0, 0, 0, 0, 
gdk_pixbuf_get_width(pixbuf), gdk_pixbuf_get_height 
(pixbuf),
  GDK_RGB_DITHER_NORMAL,0,0);




gtk_image_set_from_pixmap ( GTK_IMAGE(image_active), pixmap, NULL);
gtk_widget_show (window_colormap);


many thanks
Adi Roiban

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


colormap manipulation

2006-04-15 Thread Adi Roiban
i have to apply some image processing algorithms using gdk. They all involve 
only operation on colormap and not directy on the pixels.
Can you give me some tips about what stuctures should i used.

i tried using a GtkImage whick store information in gdk-pixbuf and then convert 
the pixbuf into pixmap and then set a colormap to the pixmap, but in this way 
modifying the colormad does not modify the pixmap.

GdkPixbuf *pixbuf;
GdkPixmap *pixmap;
GdkColor color;
GdkVisual *visual = gdk_visual_get_best() ;
GdkColormap *colormap =gdk_colormap_new (visual,FALSE);

//image_active is a GtkImage create with gtk_image_new_from_file
pixbuf = gtk_image_get_pixbuf ( GTK_IMAGE(image_active));

for (i=0; i  colormap-size; i++){
if (colormap-colors){
 colormap-colors[i].red=0;

}
}

pixmap = gdk_pixmap_new ( NULL, 
gdk_pixbuf_get_width(pixbuf),
gdk_pixbuf_get_height (pixbuf),
3*gdk_pixbuf_get_bits_per_sample(pixbuf));
gdk_drawable_set_colormap (pixmap, colormap);

gdk_draw_pixbuf ( pixmap, NULL, pixbuf, 0, 0, 0, 0, 
gdk_pixbuf_get_width(pixbuf), gdk_pixbuf_get_height 
(pixbuf),
  GDK_RGB_DITHER_NORMAL,0,0);




gtk_image_set_from_pixmap ( GTK_IMAGE(image_active), pixmap, NULL);
gtk_widget_show (window_colormap);


many thanks
Adi Roiban

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


Re: Small app for previewing gtk widgets

2006-04-15 Thread Paul Davis
On Sat, 2006-04-15 at 17:53 +0200, Luca Cavalli wrote:
 On Sat, 2006-04-15 at 17:34 +0200, Christophe Dehais wrote:
  hello everyone,
  
  It seem that there exists a small app that shows all the main GTK+
  widgets
  in a single window, but I can't find it and none of my google searches
  helped.
  
  Is anyone as a link for this ?

i use gtk-demo, which comes with GTK.

--p


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


Re: custom widgets with glade

2006-04-15 Thread Fabrizio Lanza
Never mind, I found out: http://mail.gnome.org/archives/gtk-perl-list/2003-September/msg00242.html
2006/4/15, Fabrizio Lanza [EMAIL PROTECTED]:


I'm trying convert my application to use HyperTextView.pm, a custom TextView widget.
The problem is I use glade to build the interface for perl.
I used the custom widget in the palette (glade), but then I have no idea how to associate to it the HyperTextView class in my perl code.

Did anybody use custom widgets under Perl and Glade?

Thank you,

Fabrizio Lanza
___
gtk-perl-list mailing list
gtk-perl-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list