gtk2 problems



Hello,

I've ported my video player program to gtk2 (http://sinek.sf.net).
Porting was easy but i have encountered a few problems:

1. I add a "add all files" button to gtk file selection dialog.
When it is clicked following code is executed:

sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(fs->file_list));
gtk_tree_selection_select_all(sel);
files = gtk_file_selection_get_selections(fs);
if(files) { /* files are added to playlist here */ g_strfreev(files); }
gtk_tree_selection_unselect_all(sel);

I get a crash if i click that button after opening the dialog.
But if a select an entry before, it works ok. Backtrace is:

#0  0x40500630 in strcmp () from /lib/libc.so.6
#1  0x400f49c5 in gtk_file_selection_get_select_multiple ()
   from /usr/lib/libgtk-x11-2.0.so.0
#2  0x40385fd6 in g_cclosure_marshal_VOID__VOID ()
   from /usr/lib/libgobject-2.0.so.0
#3  0x40370fab in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#4  0x403851d3 in g_signal_emit_by_name () from /usr/lib/libgobject-2.0.so.0
#5  0x403839ea in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#6  0x40383c95 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#7  0x401b1624 in gtk_tree_selection_select_all ()
   from /usr/lib/libgtk-x11-2.0.so.0
#8  0x08057d36 in freq_add_all (w=0x89d39c8, fs=0x89d0a48) at utility.c:512

#8 is my function and it crashes in gtk_tree_selection_select_all()
so i think this can be a gtk bug? i'm using libgtk2.0.5.


2. My popup menu works on normal gtk windows, but doesn't pop up on
non-gtk windows. My app's video output window is created with direct
X calls (this is the only way for allowing to show it on some other
display than gui, and simplifies using video output code which uses
xshm and Xv calls). If I get an right click event, I call
gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, 0, time)
code, but nothing happens, it was working with gtk1.2.


3. How can I right justify the text in an GtkEntry widget?


Apart from these small problems, gtk2 rocks! Thanks for everyone contributed.


-- 
Gurer Ozen



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]