Re: Initilize a filter

2006-03-22 Thread Stefan Kost
Hi,

this is what I do:

GtkListStore *store;
GtkTreeModel *filtered_store;

...

// create a filterd model
filtered_store=gtk_tree_model_filter_new(GTK_TREE_MODEL(store),NULL);
gtk_tree_model_filter_set_visible_func(GTK_TREE_MODEL_FILTER(filtered_store),visible_filter,(gpointer)self,NULL);
// active model
gtk_tree_view_set_model(tree_view,filtered_store);

Stefan

Am Mittwoch, den 22.03.2006, 11:20 +0100 schrieb Bellicano Pascal:
 Here is my code :
 
 GtkTreeModel *filter_model;
 filter_model=gtk_tree_model_filter_new 
 (GTK_TREE_MODEL(store_ori),
  NULL);

 GtkTreeModelFilter *filter;
 gtk_tree_model_filter_clear_cache(filter);

  gtk_tree_view_set_model (GTK_TREE_VIEW(tree_view),
 GTK_TREE_MODEL (filter_model));
 
   ...
 
  gtk_tree_model_filter_set_visible_column 
 (GTK_TREE_MODEL_FILTER(filter),7);
 
   ..
 
 (store_ori is a liststore)
 
 gcc complains about filter not initialised.. ok but how to initialize it ?
 
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

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


GTK Wizard using Notebook

2006-03-22 Thread 3saul

Hi,

I'm new to programing, especially gtk. I'm wanting to create a gtk wizard
(without a dependency on Gnome - I'm aware of the druid). I thought the best
way might be to create a notebook and have forward and back buttons cycle
through the tabs. My question iscan someone give me some pointers on how
to best cycle through the tabs??

Thanks
--
View this message in context: 
http://www.nabble.com/GTK-Wizard-using-Notebook-t1323551.html#a3531163
Sent from the Gtk+ - Apps Dev forum at Nabble.com.

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


Re: GTK Wizard using Notebook

2006-03-22 Thread Vivien Malerba
On 3/22/06, 3saul [EMAIL PROTECTED] wrote:

 Hi,

 I'm new to programing, especially gtk. I'm wanting to create a gtk wizard
 (without a dependency on Gnome - I'm aware of the druid). I thought the best
 way might be to create a notebook and have forward and back buttons cycle
 through the tabs. My question iscan someone give me some pointers on how
 to best cycle through the tabs??


You can also have a look at the GtkAssistant widget part of the Ridley
project. See
http://cvs.gnome.org/viewcvs/gtk%2B/gtk/gtkassistant.h?view=markup

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


Re: GThread and GCond

2006-03-22 Thread Tristan Van Berkom

Fernando ApesteguĂ­a wrote:

Hi,

I hope you can help me ;)

I'm working with two threads. One of them is running in an infinite loop
(well, it finishes under certain conditions)
What I want to do is that the infinite loop pauses some times. So I create a
GCond, but I think I didn't understand how it works.
I do something like this:

Thread 1:

for (;;){
  g_mutex_lock(my_mutex);
  g_cond_wait(my_cond,mi_mutex);
  do_some_work_here
  g_mutex_unlock(mi_mutex);
}

The Thread 2 asynchronously toggles the value of a variable between 0 and 1.
When the value is 1, I want the loop runs continuously, but when it is 0,
the loop stops.

if (value==0){
value=1;
g_cond_signal(my_cond);
}
else
value=0;

I've read this:
http://developer.gnome.org/doc/API/2.0/glib/glib-Threads.html#g-thread-create
The 
GCondhttp://developer.gnome.org/doc/API/2.0/glib/glib-Threads.html#GCondstruct
is an opaque data structure to represent a condition

So, the GCond represents the condition, and are not the condition itself...
So when I use g_cond_signal I think I'm telling the condition is true,
unlock. But in the next iteration, the loop locks again.

How can I tell The condition is STILL true...?


The condition is just a thing you can wait on untill its signalled,
thats all... there is no relation between your 'value' variable
and the condition.

in this small example; the musicplayer frontend pauses the worker
thread (that usually loops in a read/write loop):

Player worker thread:


/* This code is at the beginning of the loop (before writing
 * the next chunk of song data
 */
mp_mutex_lock(mp-paused_mutex);
while (mp-paused) {
 g_cond_wait(mp-paused_cond, mp-paused_mutex);
}
mp_mutex_unlock(mp-paused_mutex);


Musicplayer frontend thread:
===

To pause the player thread:
mp-paused = TRUE;

To unpause the player thread:
mp-paused = FALSE;
g_cond_signal (mp-paused_cond);

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