GTK4: notebook callback after page(tab) switched

Hi everyone,

is there a way to get callback after GtkNotebook page is totally switched?

“switch-page” callback is not usefull to remove focus|selection (it seems returned after this callback),
other notebook signals are not too descriptive in docs (i.e. “No description available”) to get around it.

p.s. gtk_widget_set_can_focus(child, false) allows to avoid getting unwanted focus at page switching, but anyway there’s no switch-page-finish to return it back

notify::page is likely what you’re looking for.

Thanks for suggestion, but result is the same as with “switch-page”:
it seems that unselection in “notify::page” callback is resetted further after this callback too

Have you tried scheduling an idle callback to carry out whatever focus handling you want?

It’s a good suggestion and certainly works, but there’s two “no” to this workaround, first one is acceptable and the second is not:

  • scheduling needs extra resources (it’s acceptable comparing it to all used resources of a graphic app) plus unpredictable timing for that idle (suppose it’s ~1sec or a bit less, dozens msec are not enough for this idle)
  • blinking at switching, it’s too bright to not be spotted (for example in my env it’s orange selection is on black background)

Actually now I use another one workaround: putting on permanent basis gtk_widget_set_can_focus(, false) on child widgets in tabpages (it’s listboxes in my case). Cons of this workaround: rows are not selectable by keyboard (but still selectable by mouse).

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.