Joshua Phillips <jp.sittingd...@gmail.com> wrote: (01/04/2009 10:56)
>Hello. > >- As far as I know, wxWidgets is exclusively a C++ library. Tcc is a C >compiler. So tcc won't work with wxWidgets. The usual example of a C widget >library is GTK+. > That had crossed my mind.. :) Thanks, confirmation is useful. Even if TCC isn't expanded to do C++, I'm ok with it, I like it small and neat as I find it now. (Will likely use wxDev-C++ when I want C++, as I'll want the wxWidgets too now I'm getting used to them). >- I am unaware of wxWidgets doing garbage collection, but this doesn't make it >very clear: http://wapedia.mobi/en/wxWidgets#3. > >- You speak of GDI resources, which is a Windows concept. If you're dealing >with GDI resources yourself, then no, they will not get garbage-collected. > >- There is no garbage collection in C. Having said that, there's libgc - the >Boehm Garbage Collector, which works with C. >http://en.wikipedia.org/wiki/Boehm_garbage_collector > Ok. Garbage collection is an almost strange concept to me anyway in code. I know Lua does it, but I don't know if other systems need to. My main concern is avoiding loss of GDI resources. GC is incidental to this. >> I ask because in wxLua, every colour, every pen and brush, is a DC that >> must be deleted the instant no longer required, yet the single GUI example >> supplied with TCC has a colour (COLORREF) for text colour that does not >> appear to have a specific deletion following it. > >Firstly, you can keep objects you don't need any more for as long as you want, >before deleting them. This might make sense if you don't know you're not >going to need an object again until you run a certain procedure. > Only true up to a point. :) For example, I'm making a GPS track log display. It shows at a glance the speed at any point on the track by using the decomal colour code (as with resistors, capacitors and such). There could be a hundred thousand points on that track. Every one of them needs a defined pen and colour, as described in wxLua. In W98 it is better to make, use, and delete these every turn of a 100,000 turn loop rather than let them sit around till the track is drawn. GDI resource recovery is extremely crucial, speed of exucution is second to this, every time. This at least is the advice I've been given, the wxLua examples make heavy weather of this issue. :) >Secondly. the only GUI example I can find in the TCC repository is an X11 one. >Maybe I'm not looking in the right place. If there is a GDK example, it is >probably very simple, and doesn't bother deleting the GDK objects, because >they'll be deleted when the program exits. I don't advocate such programming >style. > I never saw that one. :) I was just going on the small "hello_win" example supplied with TCC. It is very simple (not that C is EVER simple to me), so maybe as you say, the colour is specified and not deleted because the only thing a person can then do with the example is exit it, edit it, rerun, etc.. But I do need to be sure if correct practise in C as written for TCC is the same as in wxLua: delete all such things as pens, colours, the instant their use is done. I agree with you, leaving it to clutter is bad form, but I can't be sure here because I have no idea if TCC is built with awareness of this and compiles code that always deletes such things to free resources anyway. I'd bet this is something I have to do though, but if this is true, it suggests an error in the supplied example code. I want to learn from things that are correct when I get them, if possible. >Hope this helps. > It does. :) It helps me to think. Any other ideas welcome... _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/tinycc-devel