Closed EdoardoLaGreca closed 4 years ago
Can you provide a complete, runnable testcase to reproduce the problem?
Also this looks more like a GTK question than something related to the bindings, for which https://discourse.gnome.org would be a better place to ask.
I tried to make a runnable testcase to reproduce the problem but this time it shows errors (instead of just nothing, like it did before).
**
Gtk:ERROR:../gtk/gtk/gtknotebook.c:1400:gtk_notebook_buildable_add_child: assertion failed: (page != NULL)
Bail out! Gtk:ERROR:../gtk/gtk/gtknotebook.c:1400:gtk_notebook_buildable_add_child: assertion failed: (page != NULL)
zsh: abort (core dumped) cargo run
Here attached there is the full thing runnable-testcase-notebook.zip
One thing first, in src/gui/events.rs
you don't really need the Arc
/ Mutex
. a) this is all single-threaded so Rc
and RefCell
would also do, and b) you can just clone the notebook itself (all widgets use reference counting internally).
The error above comes from Builder
when parsing your .glade
file. I think a better place for discussing this would be https://discourse.gnome.org .
I tried in many ways to add a new tab in a GtkNotebook widget through code, without success. The closure (defined as an argument of
btn_new_file.connect_clicked()
) gets called but nothing happens.This is my code, by pressing
btn_new_file
, GtkNotebook should (but doesn't) append a new tab. Maybe I'm missing something...