tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Newcomer to TCC (and C) with a couple of questions..


From: Joshua Phillips
Subject: Re: [Tinycc-devel] Newcomer to TCC (and C) with a couple of questions..
Date: Wed, 1 Apr 2009 09:56:30 +0000
User-agent: KMail/1.9.10

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+.

- 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

> 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.

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.

Hope this helps.

On Wednesday 01 April 2009 01:27:41 lostgallifreyan wrote:
> Hello. I've found I can start the way I like it, looking at header files to
> see what's defined, and tweaking the Windows example to see what results
> from careful changes. Best way to learn, because manuals won't help until I
> feel like I have a grasp on this. And it means I've seen that most answers
> I need will be to do with C rather than the compiler, but I do have one
> question that you might be answered here faster than any other way I can
> find out:
>
> Can wxWidgets be used with TCC, and if so, can anyone point me to a clear
> guide on how to make them work together? This will be enormously helpful
> for fast development of a GUI-based program.
>
>
>
> One other question, though perhaps this IS something to do with C and not
> the compiler but it's very important so I want to be sure:
>
> Do the required deletions of device contexts (to spare GDI resources) get
> done by code compiled by TCC, or do I have to do this explicitly, as I do
> in wxLua, for example?
>
>
>
> 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. In wxLua, you'd assign the
> created colour to a variable as a handle for its subsequent deletion the
> instant after the variable is read by whatever needs it. If this is a
> matter of C coding I'll trouble you with it no more, but please tell me it
> this IS to do with C coding, or whether the compiled code is such that it's
> done instantly, or by periodic garbage collection, or perhaps not at all
> unless I make it so.
>
> I won't bombard you with questions, I prefer to find my own way, but I just
> asked two that are really important to me if I am to do that effectively,
> and I welcome any good clear help to get me clear on this.
>
> That said, there IS one more small question. :) I asked in a private mail
> which got a reply directing me to this list, so here it is: Any chance TCC
> will be extended to C++, or is that against the spirit of being small and
> neat, as it is now?
>
>
>
> _______________________________________________
> Tinycc-devel mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/tinycc-devel


Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]