Hi,

I am working on a C plugins which needs to set a css declaration, like
this:
This works:

cssDecl->SetProperty(NS_LITERAL_STRING("width"),
NS_LITERAL_STRING("200px"), EmptyString());

But can you please tell me what can I do to pass in a char[] instead
of hard code 200px?

Both these won't compile:
char csswidth[5];
        memset (csswidth, '\0', 20);
        sprintf(csswidth, "%dpx",  newWidth );

        cssDecl->SetProperty(NS_LITERAL_STRING("width"), csswidth,
EmptyString());
        cssDecl->SetProperty(NS_LITERAL_STRING("width"),
NS_LITERAL_STRING(csswidth)  EmptyString());

Thank you for any help.

_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout

Reply via email to