[Project_owners] Question: Mozilla Development

Matthew Wilson matthew at mjwilson.demon.co.uk
Thu Mar 24 21:04:37 EST 2005


Pete Collins wrote:
> I have some basic questions regards Mozilla development for Mozdev 
> developers.
> 
> When developing Moz code what editor do you use?

gvim

> What platform do you use for primary development?

Windows XP.

I keep meaning to set up that Linux installation on my secondary drive, 
but I'm always slightly concerned about breaking everything.

> If you are writing some js code let's say this bit below:
> 
> var prefs = Components.classes["@mozilla.org/preferences-service;1"].
>                     getService(Components.interfaces.nsIPrefBranch);
> 
> How would you actually write this code?
> 
> Copy and paste it from somewhere else?

Copy and paste, if I've written something similar before.

Search through lxr, usually, if it's something new.

> Do you type it manually from memory?

Rarely.

> How do you obtain the contractID or interface to use to instantiate a 
> component?
> 
> eg: "@mozilla.org/preferences-service;1",  "nsIPrefBranch"

LXR again.

> How about if you were writing a new XUL file from scratch, how would you 
> do it?
> 
> Let's say you wanted to add the code below, how would you do it?
> 
>   <toolbarbutton type="menu">
>     <menupopup>
>       <menu>
>         <menupopup>
>           <menuitem />
>         </menupopup>
>       </menu>
>     </menupopup>
>   </toolbarbutton>

Not quite sure what you're asking here. If I wanted to add a 
toolbarbutton but couldn't remember the syntax? Copy from existing code 
first, copy from existing Moz/Firefox code second, XULPlanet third.

> Same with css, let's say you wanted to add some style rules to an element:
> 
> #foo
> {
>   -moz-image-region: rect(0, 388px, 20px, 292px);
> }
> 
> Is the rule "-moz-image-region" committed to memory or a search and 
> paste action?

Special -moz rules are copy/paste. Basic CSS is more or less from memory.

Matthew



More information about the Project_owners mailing list