php-gtk3
php-gtk3 copied to clipboard
GtkNotebook signals
Could somebody check following signals:
select-pagefocus-tab
Because I can interact with switch-page only, other not tested yet
https://docs.gtk.org/gtk3/class.Notebook.html
what is the problem with this signals? can you provide a minimal working code of problem?
Just this construction not reacts (ignores events) when I replacing it with signals above. So using current one.
Thought maybe PHP-GTK issue, if not - please close this issue.
You linked to set_scrollable
this works fine
What this is related to signals? do you want to trigger one signal?
Sorry, I have updated repository yesterday, the line have been switched to 122
Just meant this construction there
$this->tabs->connect(
'switch-page', // select-page, focus-tab - no reaction
function ($tabs, $child, $position)
...
This works fine
<?php
Gtk::init();
$window = new GtkWindow();
$window->set_size_request(500, 500);
$window->set_title("PHP-GTK");
// create the notebook
$notebook = new GtkNotebook();
$window->add($notebook);
$notebook->set_scrollable(true);
// add page
$notebook->append_page(GtkButton::new_with_label("Container 1"), new GtkLabel("Page 1"));
$notebook->append_page(GtkButton::new_with_label("Container 2"), new GtkLabel("Page 2"));
$notebook->append_page(GtkButton::new_with_label("Container 3"), new GtkLabel("Page 3"));
$notebook->connect("switch-page", function($notebook, $page, $num){
var_dump("Page " . $num);
});
// connect to signal that close program
$window->connect("destroy", function() {
Gtk::main_quit();
});
// show all and start
$window->show_all();
Gtk::main();
switch-page works, select-page, focus-tab nope
select-page
https://stackoverflow.com/a/18352428/1935882
There is no descriptions available like select-page on doc
switch-page might handle all the cases, but if you really want use focus, you can use focus-in-event