I'm 28 (oops, 29 now) and I want to be C literate by the time I'm 30. That's two (one) years to become competent at something I've been wanting to do nearly my whole life. No pressure.
Monday, June 20, 2011
PE7 WIP code
It only pops up the GUI, but the last part SHOULD be pretty straightforward. I copied over the prime finder from PE3 and it sits in a separate .c file. I'm glad I was able to combine my two learning projects: GTK and PE.
EDIT: I don't think it will be long before I'm going to force myself to learn Glade so that I don't have to code the GUI by hand. That was super tedious and there are only six widgets involved!
So the typedef for the struct is because in my callback function I needed to initialize a pointer to the widget data structure to the gpointer passed to the function. Just saying "struct Widgets *widgets" wasn't working so then I put in the typedef part. THEN I learned that a type defined in main doesn't carry over to functions that main calls so I tossed it outside of main. I don't know if making it typedef or putting it outside of main is what let me define a pointer to it but it doesn't matter. I'm really close to putting it into a header file to clean things up a bit.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment