I have a frame box next to some text (Komentar:), and I would like to stretch it so it fills up the page. I've done this using the calc package by subtracting \widthof{Komentar: } from \hsize (or \textwidth or \linewidth).
Komentar: \fbox{
\newlength\mylength
\setlength\mylength{\hsize - \widthof{Komentar: }}
\begin{minipage}[t]{\mylength}
\hfill
\vspace{8cm}
\end{minipage}
}
However, this stretches the box beyond what seems to be the right margin: I have two pieces of text with \hfill in between, and the box seems to go beyond that. In fact, it looks like the values returned by \hsize, \textwidth and \linewidth are wider than what \hfill makes it out to be. Here's a picture of what I mean:

So, either I'm not getting the page width correctly, or I'm doing the \hfill thing wrong. Either way, help is appreciated.
P.S. I also get a warning that the \hbox in paragraph at lines 84–92 is 17.89452pt too wide.
EDIT: Here's an MWE. You get the custom document class I'm using here.
\documentclass[a4paper, 12pt, master]{etf}
\usepackage{calc}
\begin{document}
{\setlength\parindent{0pt}
Komentar: \fbox{
\newlength\mylength
\setlength\mylength{\hsize - \widthof{Komentar: }}
\begin{minipage}[t]{\mylength}
\hfill
\vspace{8cm}
\end{minipage}
}
Datum odbrane: \underline{\hspace{7em}} \hfill
Ocena: \underline{\hspace{6em}} (\underline{\hspace{2em}})
}
\end{document}
\fboxseplength, which is small, but noticable and indicates the separation between the frame and the content? There is also the\fboxrulelength, indicating the width of the frame rules. – Apr 23 '14 at 15:08\documentclass{...}and ending with\end{document}. – Apr 23 '14 at 15:09