Re: New widgets and Glade

2004-05-04 Thread Krzysztof Garus
On Fri, Apr 30, 2004 at 12:00:17PM +0200, Diego Zuccato wrote:
 Hello all.
 
 Just a quick question: is it possible to use Glade2 when new widgets
 (from 2.4) are needed?

BTW, don't you think Glade should support plugins? Then
gtk-gl/gtkext/gtkwhatever - programmers would provide .xml files
describing custom widgets

bajcik
-- 
Krzysztof Garus [EMAIL PROTECTED]
  Stronka: http://kolos.math.uni.lodz.pl/~bajcik/
   Serwis: http://gielda.linux.pl/
___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: glib API for iterating the g_hash_table

2004-01-14 Thread Krzysztof Garus
On Wed, Jan 14, 2004 at 10:02:54PM +0800, Tony Yat-Tung Cheung wrote:
 Hi,
 
 Is there any API for iterating GHashTable?
 
 I only see the the g_hash_table_foreach() here. But sometimes people may
 like to iterate through a hash table and stop the iteration when certain
 conditions are met.
 
 Currently, there is g_hash_table_size(), we could easily add iteration
 by providing the following two new APIs,
 
 gconstpointer g_hash_table_get_key(GHashTable *hash_table, int pos);
 gconspointer g_hash_table_get_value(GHashTable *hash_table, int pos);
 
 The two APIs allows one to iterate the hash table, for example,
 
 for (i = 0; i  g_hash_table_size(hash_table); i++) {
  gconstpointer value = g_hash_table_get_value(hash_table, i);
 
  /* Do some processing here */
  if (is_match(value))
return TRUE;
 }
 
 Should we add the APIs?


I made something similar, but for GData:


typedef struct _GQDPair GQDPair;
struct _GQDPair
{
GQuarkquark;
gpointer  data;
};

GArray * g_datalist_pairs(GArray *a, GData **dl);

#define GQDq(qp, i) g_array_index(qp, GQDPair, i).quark
#define GQDd(qp, i) g_array_index(qp, GQDPair, i).data



/* GQuark/gpointer pairs from GDataList  */

void
on_keyval2GArray(GQuark key, gpointer *data, GArray *a)
{
GQDPair p;

p.quark = key;
p.data = data;
g_array_append_val(a, p);
}

GArray *
g_datalist_pairs(GArray *a, GData **dl)
{
if (a)
{
g_array_set_size(a, 0);
}
else
a = g_array_new(TRUE, FALSE, sizeof(GQDPair));

g_datalist_foreach(dl, (GDataForeachFunc)on_keyval2GArray, a);

return a;
}


bajcik
-- 
Krzysztof Garus [EMAIL PROTECTED]Linux User 171721
  Stronka: http://kolos.math.uni.lodz.pl/~bajcik/
  Polecam: http://kolos.math.uni.lodz.pl/~bajcik/duskc.html
___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


strange error

2002-11-22 Thread Krzysztof Garus
hello,

(Propably) normal call to gtk_label_set_text failed:


Program received signal SIGSEGV, Segmentation fault.
0x001fd401 in gtk_widget_queue_clear_area () from /usr/X11R6/lib/libgtk-1.2.so.0
(gdb) bt
#0  0x001fd401 in gtk_widget_queue_clear_area () from /usr/X11R6/lib/libgtk-1.2.so.0
#1  0x001fd65d in gtk_widget_queue_clear () from /usr/X11R6/lib/libgtk-1.2.so.0
#2  0x001fdf69 in gtk_widget_queue_resize () from /usr/X11R6/lib/libgtk-1.2.so.0
#3  0x001a9246 in gtk_label_set_text () from /usr/X11R6/lib/libgtk-1.2.so.0
#4  0x08069ca4 in rmInvocation (r=0x80f7b08) at remove.c:121
#5  0x005144c2 in RPMLremove (op=1, r=0x80f7b08, data=0x0) at rpm-system.c:329
#6  0x08052755 in on_btnRemove_clicked (button=0x80da9b0, user_data=0x0) at 
callbacks.c:306
#7  0x001b29db in gtk_marshal_NONE__NONE () from /usr/X11R6/lib/libgtk-1.2.so.0
#8  0x001d6648 in gtk_signal_remove_emission_hook () from 
/usr/X11R6/lib/libgtk-1.2.so.0
#9  0x001d5d6f in gtk_signal_set_funcs () from /usr/X11R6/lib/libgtk-1.2.so.0
#10 0x001d472a in gtk_signal_emit () from /usr/X11R6/lib/libgtk-1.2.so.0
#11 0x0015b1b0 in gtk_accel_group_activate () from /usr/X11R6/lib/libgtk-1.2.so.0
#12 0x0015b215 in gtk_accel_groups_activate () from /usr/X11R6/lib/libgtk-1.2.so.0
#13 0x002040df in gtk_window_set_default_size () from /usr/X11R6/lib/libgtk-1.2.so.0
#14 0x001b25c7 in gtk_marshal_BOOL__POINTER () from /usr/X11R6/lib/libgtk-1.2.so.0
#15 0x001d5dad in gtk_signal_set_funcs () from /usr/X11R6/lib/libgtk-1.2.so.0
#16 0x001d472a in gtk_signal_emit () from /usr/X11R6/lib/libgtk-1.2.so.0
#17 0x001fedec in gtk_widget_event () from /usr/X11R6/lib/libgtk-1.2.so.0
#18 0x001b2485 in gtk_propagate_event () from /usr/X11R6/lib/libgtk-1.2.so.0
#19 0x001b180e in gtk_main_do_event () from /usr/X11R6/lib/libgtk-1.2.so.0
#20 0x00231010 in gdk_wm_protocols_filter () from /usr/X11R6/lib/libgdk-1.2.so.0
#21 0x003907d6 in g_get_current_time () from /usr/lib/libglib-1.2.so.0
#22 0x00390de3 in g_get_current_time () from /usr/lib/libglib-1.2.so.0
#23 0x00390f8c in g_main_run () from /usr/lib/libglib-1.2.so.0
#24 0x001b1119 in gtk_main () from /usr/X11R6/lib/libgtk-1.2.so.0
#25 0x080689e1 in main (argc=2, argv=0xb864) at main.c:140
#26 0x003c27c6 in __libc_start_main () from /lib/libc.so.6
(gdb) frame 3
#3  0x001a9246 in gtk_label_set_text () from /usr/X11R6/lib/libgtk-1.2.so.0
(gdb) frame 4
#4  0x08069ca4 in rmInvocation (r=0x80f7b08) at remove.c:121
121 gtk_label_set_text(GTK_LABEL(r-lblQuestion), msg);
(gdb) list
116 msg = g_strdup_printf(_(Do you want to delete \%s\?),
117 directoryEnt(r-dir, r-namev[0])-name);
118 else
119 msg = g_strdup_printf(_(Do you want to delete %d entries?), 
r-namec);
120 
121 gtk_label_set_text(GTK_LABEL(r-lblQuestion), msg);
122 rmSetButtons(r, REMOVE_BTN_REMOVE|REMOVE_BTN_CANCEL, 
REMOVE_BTN_REMOVE);
123 g_free(msg);
124 }
125 
(gdb) p msg
$1 = 0x8112a08 Chcesz skasowa 2 pozycji?
(gdb) p *r-lblQuestion 
$2 = {object = {klass = 0x80ceb90, flags = 67560, ref_count = 2, object_data = 
0x80e5ec8}, private_flags = 0, 
  state = 0 '\000', saved_state = 0 '\000', name = 0x0, style = 0x80df2c0, requisition 
= {width = 47, 
height = 16}, allocation = {x = 4, y = 4, width = 259, height = 16}, window = 
0x8111b30, parent = 0x81108f0}
(gdb) p *r-lblQuestion-object-klass
$3 = {type = 42261, signals = 0x0, nsignals = 0, n_args = 4, construct_args = 0x0, 
  set_arg = 0x1a8f4c gtk_label_get_type+284, get_arg = 0x1a8fd8 
gtk_label_get_type+424, 
  shutdown = 0x201340 gtk_widget_get_default_visual+52, 
  destroy = 0x2013e4 gtk_widget_get_default_visual+216, finalize = 0x1a9364 
gtk_label_get+20}
(gdb)

window created, showed() but not showed

gtk+-1.2.10-3 with ThinIce theme (only colors, libthinice.so not found : )

bajcik
-- 
.- Krzysztof Garus - http://kolos.math.uni.lodz.pl/~bajcik/ --.
| http://kolos.math.uni.lodz.pl/~bajcik/duskc/ - prosz o krytyk :)  |
___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list