what's the logic behind the calculator widget. i want to build it in gtk+.
First, don't listen to anyone who says that this is trivial.
Second, I'm going to assume that you really mean something like "How do I convert the user input to an internal expression structure which I can use to calculate the answer?". Well, Wikipedia has a good article (here) on converting infix (human readable) notation, which is what most modern calculators use (e.g you can write 1 + 2 instead of + 1 2), to the more computer appropriate polish (prefix) notation.
Third, if you don't know GTK+ yet, start here.
Hope this helps.
精彩评论