Re: GTK3 - GtkExpander problem, bug ?

2018-03-07 Thread Daniel Boles
On 6 March 2018 at 18:26,  wrote:

> Message: 1
> Date: Wed, 13 Dec 2017 03:16:59 +0100
> From: S?bastien Le Roux 
> To: gtk-app-devel-l...@gnome.org, gtk-devel-list@gnome.org
> Subject: GTK3 - GtkExpander problem, bug ?
> Message-ID: <7a7f900f-a7e5-8ed3-3fa8-867568087...@ipcms.unistra.fr>
> Content-Type: text/plain; charset="utf-8"; Format="flowed"
>
> Dear all thanks in advance for reading this,
>
> I wrote a piece of code in GTK3, and I might have found an issue with
> the GtkExpander widget,
> shorter than a long text explanation, I attach to this email a screen
> capture from a window from my program.
> This window contains a bunch of GtkExpander, inside each a
> GtkScrolledWindow that contains a GtkFixed,
> each GtkFixed contains a series of GtkToggleButtons. (I can have a lot
> of buttons piled up in there).
> I tried several container widget other than the ScrolledWindow, but it
> is the only one that offers to browse
> the entire button list that my program will create.
>
> The first time, I open/close one of the GtkExpander (1) everything works
> fine, the button are working fine,
> then if I open/close another GtkExpander (2) and re-open the first one I
> lose information regarding the buttons,
> some stop to function, for other the pointers for the callback are
> damaged and the function will not work properly afterwards.
> I noticed that I could even recall buttons located in the other expander
> (2), basically at the location they were
> appearing on the window before having expander (2) closed, like if the
> two sets of buttons from the 2 expanders
>  ?were overlapping/sharing positions somehow.
>
> So there is no GTK signal used in all this window excepted for the
> buttons, and a simple 'play' with the expanders
> is messing everything up ... GDB and VALGRIND are not giving me any
> error so ...
> I figured that this was out of my skill range, hence this email.
>
>
> I also attach to this message a piece of code to illustrate how I
> generate the window from my picture, the part
> the generate the button is missing but that it too big to included in
> this message.
>
> Finally I want to add that the almost the exact same code works just
> fine with GTK2 ... if that helps.
>
> Thanks in advance for you help.
>
> Best regards.
>
> --
> ===
> Dr. S?bastien Le Roux
>


Please always mention your GTK+ exact version when reporting bugs. This
sounds like a problem or two that I fixed a few point releases ago,
probably 3.22.25 or so. What version is yours?
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: GTK3 - GtkExpander problem, bug ?

2018-03-06 Thread Tilo Villwock
Hello Sébastien,

attaching images isn't allowed on here. Have you created a minimal
working example that reproduces the bug? Otherwise it'll be hard to
help you.

Cheers,

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


Re: GTK3 - GtkExpander problem, bug ?

2018-03-06 Thread Sébastien Le Roux

Dear Eric,
thanks for your answer, and yes it is pretty much the same, the 
differences in my case,

are: I use toggle buttons and I do not use  a grid.

Thanks you for providing me with this nice working example, I played 
with it to illustrate the
bug because it happens with your code too, check the new 'test.c' file 
attached !


I simply added a third expander and a third set of buttons, I invite you 
to compile the code attached,
and play with it you will see, that at same point even it stops to 
function properly.


To start to have errors you can follow the following sequence:
1) open the first expander
2) open the second
3) open the third
4) close the second
5) starting clicking on the second expander location (without buttons 
visible) and it starts.


I can only guess that the more expander you use the more messy it will 
get ... hence the problems

with my program that uses 10.

Just so you know I overcame the issue using a TreeView in a 
ScrolledWindow instead of a bunch of Expander + ScrolledWindow,

I do not think that it is as nice visually but it works smoothly.

Best regards

Sébastien Le Roux
--

===
Dr. Sébastien Le Roux
Ingénieur de Recherche CNRS
Institut de Physique et Chimie des Matériaux de Strasbourg
Département des Matériaux Organiques
23, rue du Loess
BP 43
F-67034 Strasbourg Cedex 2, France
E-mail: sebastien.ler...@ipcms.unistra.fr
Webpage: http://www-ipcms.u-strasbg.fr/spip.php?article1771
RINGS project: http://rings-code.sourceforge.net/
ISAACS project: http://isaacs.sourceforge.net/
Fax:   +33 3 88 10 72 46
Phone: +33 3 88 10 71 62
===

/*
   gcc -Wall buttons1.c -o buttons1 `pkg-config --cflags --libs gtk+-3.0`
   Tested with GTK3.18 on Ubuntu16.04
*/
#include

static void button_clicked1(GtkWidget *button, gpointer user_data)
  {
g_print("1 %s\n", gtk_button_get_label(GTK_BUTTON(button)));
  }
static void button_clicked2(GtkWidget *button, gpointer user_data)
  {
g_print("2 %s\n", gtk_button_get_label(GTK_BUTTON(button)));
  }
static void button_clicked3(GtkWidget *button, gpointer user_data)
  {
g_print("3 %s\n", gtk_button_get_label(GTK_BUTTON(button)));
  }
int main(int argc, char *argv[])
  {
gtk_init (, );

GtkWidget *window=gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(window), "Buttons");
gtk_window_set_default_size(GTK_WINDOW(window), 400, 400);
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL);

gint i=0;
gint j=0;
GtkWidget *buttons1[100];
GtkWidget *buttons2[100];
GtkWidget *buttons3[100];

//First set of buttons.
for(i=0;i<100;i++)
  {
gchar *string=g_strdup_printf("button%i", i);
buttons1[i]=gtk_button_new_with_label(string);
g_free(string);
  }

GtkWidget *grid1=gtk_grid_new();
for(i=0;i<10;i++)
  {
for(j=0;j<10;j++)
  {
gtk_grid_attach(GTK_GRID(grid1), buttons1[i*10+j], j, i, 1, 1);
g_signal_connect(buttons1[i*10+j], "clicked", G_CALLBACK(button_clicked1), NULL);
  }
  }

//Second set of buttons.
for(i=0;i<100;i++)
  {
gchar *string=g_strdup_printf("button%i", i);
buttons2[i]=gtk_button_new_with_label(string);
g_free(string);
  }

GtkWidget *grid2=gtk_grid_new();
for(i=0;i<10;i++)
  {
for(j=0;j<10;j++)
  {
gtk_grid_attach(GTK_GRID(grid2), buttons2[i*10+j], j, i, 1, 1);
g_signal_connect(buttons2[i*10+j], "clicked", G_CALLBACK(button_clicked2), NULL);
  }
  }

   //Third set of buttons.
for(i=0;i<100;i++)
  {
gchar *string=g_strdup_printf("button%i", i);
buttons3[i]=gtk_button_new_with_label(string);
g_free(string);
  }

GtkWidget *grid3=gtk_grid_new();
for(i=0;i<10;i++)
  {
for(j=0;j<10;j++)
  {
gtk_grid_attach(GTK_GRID(grid3), buttons3[i*10+j], j, i, 1, 1);
g_signal_connect(buttons3[i*10+j], "clicked", G_CALLBACK(button_clicked3), NULL);
  }
  }  


GtkWidget *scroll1=gtk_scrolled_window_new(NULL, NULL);
gtk_widget_set_vexpand(scroll1, TRUE);
gtk_widget_set_hexpand(scroll1, TRUE);
gtk_container_add(GTK_CONTAINER(scroll1), grid1);

GtkWidget *scroll2=gtk_scrolled_window_new(NULL, NULL);
gtk_widget_set_vexpand(scroll2, TRUE);
gtk_widget_set_hexpand(scroll2, TRUE);
gtk_container_add(GTK_CONTAINER(scroll2), grid2);

GtkWidget *scroll3=gtk_scrolled_window_new(NULL, NULL);
gtk_widget_set_vexpand(scroll3, TRUE);
gtk_widget_set_hexpand(scroll3, TRUE);
gtk_container_add(GTK_CONTAINER(scroll3), grid3);

GtkWidget *expander1=gtk_expander_new("buttons1");
gtk_container_add(GTK_CONTAINER(expander1), scroll1);

GtkWidget 

Re: GTK3 - GtkExpander problem, bug ?

2017-12-15 Thread Eric Cashon via gtk-app-devel-list

 
Thanks Matthias. I probably should have checked bugzilla first. Just rebuilt 
GTK to version 3.22.26 and it works fine. There is no click through after 
closing the expander.

Eric

 


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


Re: GTK3 - GtkExpander problem, bug ?

2017-12-15 Thread Eric Cashon via gtk-devel-list

 
Thanks Matthias. I probably should have checked bugzilla first. Just rebuilt 
GTK to version 3.22.26 and it works fine. There is no click through after 
closing the expander.

Eric

 


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


Re: GTK3 - GtkExpander problem, bug ?

2017-12-15 Thread Matthias Clasen
On Thu, Dec 14, 2017 at 7:58 PM, Sébastien Le Roux <
sebastien.ler...@ipcms.unistra.fr> wrote:

> Dear Eric,
> thanks for your answer, and yes it is pretty much the same, the
> differences in my case,
> are: I use toggle buttons and I do not use  a grid.
>
> Thanks you for providing me with this nice working example, I played with
> it to illustrate the
> bug because it happens with your code too, check the new 'test.c' file
> attached !
>
> I simply added a third expander and a third set of buttons, I invite you
> to compile the code attached,
> and play with it you will see, that at same point even it stops to
> function properly.
>
> To start to have errors you can follow the following sequence:
> 1) open the first expander
> 2) open the second
> 3) open the third
> 4) close the second
> 5) starting clicking on the second expander location (without buttons
> visible) and it starts.
>
> I can only guess that the more expander you use the more messy it will get
> ... hence the problems
> with my program that uses 10.
>
>
I can't be too sure since you don't say which version of gtk this is with,
exactly, and it doesn't reproduce on my
system (and the example only has 2 expandes, not 3...), but it sounds like
you might be seeing a symptom of
https://bugzilla.gnome.org/show_bug.cgi?id=774134
which is fixed in current releases of gtk 3.22.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: GTK3 - GtkExpander problem, bug ?

2017-12-15 Thread Matthias Clasen
On Thu, Dec 14, 2017 at 7:58 PM, Sébastien Le Roux <
sebastien.ler...@ipcms.unistra.fr> wrote:

> Dear Eric,
> thanks for your answer, and yes it is pretty much the same, the
> differences in my case,
> are: I use toggle buttons and I do not use  a grid.
>
> Thanks you for providing me with this nice working example, I played with
> it to illustrate the
> bug because it happens with your code too, check the new 'test.c' file
> attached !
>
> I simply added a third expander and a third set of buttons, I invite you
> to compile the code attached,
> and play with it you will see, that at same point even it stops to
> function properly.
>
> To start to have errors you can follow the following sequence:
> 1) open the first expander
> 2) open the second
> 3) open the third
> 4) close the second
> 5) starting clicking on the second expander location (without buttons
> visible) and it starts.
>
> I can only guess that the more expander you use the more messy it will get
> ... hence the problems
> with my program that uses 10.
>
>
I can't be too sure since you don't say which version of gtk this is with,
exactly, and it doesn't reproduce on my
system (and the example only has 2 expandes, not 3...), but it sounds like
you might be seeing a symptom of
https://bugzilla.gnome.org/show_bug.cgi?id=774134
which is fixed in current releases of gtk 3.22.
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: GTK3 - GtkExpander problem, bug ?

2017-12-15 Thread Sébastien Le Roux

Dear Eric,
thanks for your answer, and yes it is pretty much the same, the 
differences in my case,

are: I use toggle buttons and I do not use  a grid.

Thanks you for providing me with this nice working example, I played 
with it to illustrate the
bug because it happens with your code too, check the new 'test.c' file 
attached !


I simply added a third expander and a third set of buttons, I invite you 
to compile the code attached,
and play with it you will see, that at same point even it stops to 
function properly.


To start to have errors you can follow the following sequence:
1) open the first expander
2) open the second
3) open the third
4) close the second
5) starting clicking on the second expander location (without buttons 
visible) and it starts.


I can only guess that the more expander you use the more messy it will 
get ... hence the problems

with my program that uses 10.

Just so you know I overcame the issue using a TreeView in a 
ScrolledWindow instead of a bunch of Expander + ScrolledWindow,

I do not think that it is as nice visually but it works smoothly.

Best regards

Sébastien Le Roux
--

===
Dr. Sébastien Le Roux
Ingénieur de Recherche CNRS
Institut de Physique et Chimie des Matériaux de Strasbourg
Département des Matériaux Organiques
23, rue du Loess
BP 43
F-67034 Strasbourg Cedex 2, France
E-mail: sebastien.ler...@ipcms.unistra.fr
Webpage: http://www-ipcms.u-strasbg.fr/spip.php?article1771
RINGS project: http://rings-code.sourceforge.net/
ISAACS project: http://isaacs.sourceforge.net/
Fax:   +33 3 88 10 72 46
Phone: +33 3 88 10 71 62
===

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

Re: GTK3 - GtkExpander problem, bug ?

2017-12-14 Thread Eric Cashon via gtk-app-devel-list


 
Hi Sébastien,

An out of sync reply. I must have accidently deleted your last response after I 
read it. Also I didn't notice there were two mailing lists referenced. Probably 
just need the app dev list.

It looks like it is a bug that has been recently introduced. If I test, test.c 
with three expanders, on GTK3.18 it works fine. No problems. If I test on 
GTK3.22, after I close any expander the buttons can still be clicked even 
though they aren't showing. This is also the case with only 2 expanders in the 
original test code.



It sounds like the treeview work around is the way to go in this case.


Eric



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

Re: GTK3 - GtkExpander problem, bug ?

2017-12-14 Thread Eric Cashon via gtk-devel-list

 
Hi Sébastien,

If I try some test code... it should work. The code uses a grid instead of a 
fixed container. Is this similar to what you have tried?

Eric

/*
   gcc -Wall buttons1.c -o buttons1 `pkg-config --cflags --libs gtk+-3.0`
   Tested with GTK3.18 on Ubuntu16.04
*/
#include

static void button_clicked1(GtkWidget *button, gpointer user_data)
  {
g_print("1 %s\n", gtk_button_get_label(GTK_BUTTON(button)));
  }
static void button_clicked2(GtkWidget *button, gpointer user_data)
  {
g_print("2 %s\n", gtk_button_get_label(GTK_BUTTON(button)));
  }
int main(int argc, char *argv[])
  {
gtk_init (, );

GtkWidget *window=gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(window), "Buttons");
gtk_window_set_default_size(GTK_WINDOW(window), 400, 400);
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL);

gint i=0;
gint j=0;
GtkWidget *buttons1[100];
GtkWidget *buttons2[100];

//First set of buttons.
for(i=0;i<100;i++)
  {
gchar *string=g_strdup_printf("button%i", i);
buttons1[i]=gtk_button_new_with_label(string);
g_free(string);
  }

GtkWidget *grid1=gtk_grid_new();
for(i=0;i<10;i++)
  {
for(j=0;j<10;j++)
  {
gtk_grid_attach(GTK_GRID(grid1), buttons1[i*10+j], j, i, 1, 1);
g_signal_connect(buttons1[i*10+j], "clicked", 
G_CALLBACK(button_clicked1), NULL);
  }
  } 

//Second set of buttons.
for(i=0;i<100;i++)
  {
gchar *string=g_strdup_printf("button%i", i);
buttons2[i]=gtk_button_new_with_label(string);
g_free(string);
  }

GtkWidget *grid2=gtk_grid_new();
for(i=0;i<10;i++)
  {
for(j=0;j<10;j++)
  {
gtk_grid_attach(GTK_GRID(grid2), buttons2[i*10+j], j, i, 1, 1);
g_signal_connect(buttons2[i*10+j], "clicked", 
G_CALLBACK(button_clicked2), NULL);
  }
  }   

GtkWidget *scroll1=gtk_scrolled_window_new(NULL, NULL);
gtk_widget_set_vexpand(scroll1, TRUE);
gtk_widget_set_hexpand(scroll1, TRUE);
gtk_container_add(GTK_CONTAINER(scroll1), grid1);

GtkWidget *scroll2=gtk_scrolled_window_new(NULL, NULL);
gtk_widget_set_vexpand(scroll2, TRUE);
gtk_widget_set_hexpand(scroll2, TRUE);
gtk_container_add(GTK_CONTAINER(scroll2), grid2);

GtkWidget *expander1=gtk_expander_new("buttons1");
gtk_container_add(GTK_CONTAINER(expander1), scroll1);

GtkWidget *expander2=gtk_expander_new("buttons2");
gtk_container_add(GTK_CONTAINER(expander2), scroll2);

GtkWidget *grid3=gtk_grid_new();
gtk_grid_attach(GTK_GRID(grid3), expander1, 0, 0, 1, 1);
gtk_grid_attach(GTK_GRID(grid3), expander2, 0, 1, 1, 1);

gtk_container_add(GTK_CONTAINER(window), grid3);

gtk_widget_show_all(window);

gtk_main();

return 0;
  }   

 


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


Re: GTK3 - GtkExpander problem, bug ?

2017-12-14 Thread Eric Cashon via gtk-app-devel-list

 
Hi Sébastien,

If I try some test code... it should work. The code uses a grid instead of a 
fixed container. Is this similar to what you have tried?

Eric

/*
   gcc -Wall buttons1.c -o buttons1 `pkg-config --cflags --libs gtk+-3.0`
   Tested with GTK3.18 on Ubuntu16.04
*/
#include

static void button_clicked1(GtkWidget *button, gpointer user_data)
  {
g_print("1 %s\n", gtk_button_get_label(GTK_BUTTON(button)));
  }
static void button_clicked2(GtkWidget *button, gpointer user_data)
  {
g_print("2 %s\n", gtk_button_get_label(GTK_BUTTON(button)));
  }
int main(int argc, char *argv[])
  {
gtk_init (, );

GtkWidget *window=gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(window), "Buttons");
gtk_window_set_default_size(GTK_WINDOW(window), 400, 400);
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL);

gint i=0;
gint j=0;
GtkWidget *buttons1[100];
GtkWidget *buttons2[100];

//First set of buttons.
for(i=0;i<100;i++)
  {
gchar *string=g_strdup_printf("button%i", i);
buttons1[i]=gtk_button_new_with_label(string);
g_free(string);
  }

GtkWidget *grid1=gtk_grid_new();
for(i=0;i<10;i++)
  {
for(j=0;j<10;j++)
  {
gtk_grid_attach(GTK_GRID(grid1), buttons1[i*10+j], j, i, 1, 1);
g_signal_connect(buttons1[i*10+j], "clicked", 
G_CALLBACK(button_clicked1), NULL);
  }
  } 

//Second set of buttons.
for(i=0;i<100;i++)
  {
gchar *string=g_strdup_printf("button%i", i);
buttons2[i]=gtk_button_new_with_label(string);
g_free(string);
  }

GtkWidget *grid2=gtk_grid_new();
for(i=0;i<10;i++)
  {
for(j=0;j<10;j++)
  {
gtk_grid_attach(GTK_GRID(grid2), buttons2[i*10+j], j, i, 1, 1);
g_signal_connect(buttons2[i*10+j], "clicked", 
G_CALLBACK(button_clicked2), NULL);
  }
  }   

GtkWidget *scroll1=gtk_scrolled_window_new(NULL, NULL);
gtk_widget_set_vexpand(scroll1, TRUE);
gtk_widget_set_hexpand(scroll1, TRUE);
gtk_container_add(GTK_CONTAINER(scroll1), grid1);

GtkWidget *scroll2=gtk_scrolled_window_new(NULL, NULL);
gtk_widget_set_vexpand(scroll2, TRUE);
gtk_widget_set_hexpand(scroll2, TRUE);
gtk_container_add(GTK_CONTAINER(scroll2), grid2);

GtkWidget *expander1=gtk_expander_new("buttons1");
gtk_container_add(GTK_CONTAINER(expander1), scroll1);

GtkWidget *expander2=gtk_expander_new("buttons2");
gtk_container_add(GTK_CONTAINER(expander2), scroll2);

GtkWidget *grid3=gtk_grid_new();
gtk_grid_attach(GTK_GRID(grid3), expander1, 0, 0, 1, 1);
gtk_grid_attach(GTK_GRID(grid3), expander2, 0, 1, 1, 1);

gtk_container_add(GTK_CONTAINER(window), grid3);

gtk_widget_show_all(window);

gtk_main();

return 0;
  }   

 


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

Re: GTK3 - GtkExpander problem, bug ?

2017-12-14 Thread Tilo Villwock
Hello Sébastien,

attaching images isn't allowed on here. Have you created a minimal
working example that reproduces the bug? Otherwise it'll be hard to
help you.

Cheers,

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