Re: NOTEBOOK
- From: "Germano Rizzo" <manomano ciaoweb it>
- To: Przemysław Lichoń <P Lichon wasko pl>, "gtk-list-angielska" <gtk-list gnome org>
- Subject: Re: NOTEBOOK
- Date: Wed, 21 Mar 2001 14:19:02 +0100
You should keep the current page in another variable... for example:
/* this is the page to unsensitivize */
const gint forbidden_page=1
/* stores the previous page */
gint previous_page=0;
/*say if forbidden_page is sensitive or not */
gboolean is_sensitive
...
void forbide(GtkNotebook *widget; GtkNotebookPage *page, gint page_num,
gpointer data)
{
if(!is_sensitive && (page_num==forbidden_page))
gtk_notebook_set_page(widget,previous_page);
else
previous_page=page_num;
}
...
GtkWidget *my_nbook;
my_nbook=gtk_notebook_new();
gtk_signal_connect(GTK_OBJECT(my_nbook), "switch-page",
GTK_SIGNAL_FUNC(forbide),NULL);
...
of course, this is only an hint, I'm not sure it's correct... you should
still consider all the particular cases, like when the start page isn't the
first, or when the very start page is forbidden, or when you set
unsensitivity while you're in the very forbidden page...
Just my 2 cents!
Mano :)
----- Original Message -----
From: "Przemysław Lichoń" <P Lichon wasko pl>
To: "Germano Rizzo" <manomano ciaoweb it>
Sent: Wednesday, March 21, 2001 12:54 PM
Subject: Re: NOTEBOOK
| Germano Rizzo wrote:
| >
| > Maybe I'm telling nonsense, but... how about monitoring the page_switch
| > signal, and when the page you're trying to switch to is the
'unsensitive'
| > one make the program switch to the previous? This way, you should never
| > access that one... You should keep track also of the index of the
previous,
| > of course. It shouldn't be difficult, maybe a little lack of elegance...
<:)
| > Mano :)
|
| When I switch index of the previous, previous pege is nonactive. Becuse
| when return from function switch-page, alredy sets pege.
|
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]