Sorry Stefan_K, i've closed the post (edited now) but i've been a little blind : the code works well for all pages but not for the last page of the chapter just before a new part

where the number printed is the number of the first page of the first chapter of the new part.
To be clear : with the code below, the page (not blank) before the second part is numbered "I : 1.2 / 2.1" but the correct numbering is "I : 1.2 / 1.2"
Code: Select all
\documentclass{memoir}
\usepackage{chappg}
%
\let\memclearforchapter\clearforchapter%
\renewcommand*{\clearforchapter}{\label{\thechapter}\memclearforchapter}%
\newcommand*{\numpage}{\thepart : \thepage\ / \pageref{\thechapter}}%
%
\makepagestyle{myheadings}%
\makeevenfoot{myheadings}{\numpage}{}{ }%
\makeoddfoot{myheadings}{ \numpage }{}{}%
%
\begin{document}
\pagestyle{myheadings}%
%
\part{F}
\chapter{curse one}
blablabla
\newpage
blobloblo
\part{G}
\chapter{curse one}
\end{document}
It works like if \part acts after the corresponding page is created (so it's a chapter page and not a part page when the \pageref is computed).
I tried very boldly some things :
\patchcommand{\part}{\clearforchapter}{}
to simulate a new chapter and stop the numbering for exemple but it doesn't work (some conditionals too with respect to the sectioning degree).
I tried to understand what happens : it seems to me that the state of the page ("chapter" and not "part") is not good or the effect of the cross-reference come too soon.
But i see truly that i don't understand nothing : i read that the \pageref print the number of the page where the \label command appears so the \label is processed at the end of the building of the chapter and not at the first page of the chapter ? or
\chapter
(or
\clearforchapter
) is processed on each page of the current chapter ?
There would be someone to bring me light ?
Thanks for any help (and for the past help).