In the midst of writing a program (a RPN calculator), I came across a bit
of a problem that I haven't figured out how to solve.
I'm using a GtkText widget to represent the stack, and so I want the data
to appear at the bottom of the widget area:
However, I'm not sure how to make that happen. Will I have to break out
the code for the text widget and change it to suit my needs, or is there
some way to do it? Or is there a better way of hadnling this? I've
thought of simply adding enough newlines to the widget to fill the window
when the stack is smaller than the window, but I couldn't figure out how
to figure out the number of lines in the window.
While I'm here, I have another question: To handle shortcut keys (A '+',
or '-' or several other keys that immediately enter the current line and
perform the function), I've made an event handler to catch all the
keystrokes and decide whether to pass them through or act on it. Is that
an acceptable solution, or is there a better way of doing it?
I apologize if the answer's RTFM ... I've tried to do so, but I've never
really done any GTK+ programming (or any GUI stuff at all), and things
definately go over my head on occasion.