Re: Bonobo UI XML



Hi

Here is a small example.


<Root>
	<commands>
		<cmd name="FileExit" _label="E_xit" _tip="Exit the program" pixtype="stock" pixname="Quit" accel="*Control*q"/>
		<cmd name="Preferences" _label="_Preferences" _tip="Change preferences" pixtype="stock" pixname="Preferences"/>
		<cmd name="HelpAbout" _label="_About..." _tip="About this application"  pixtype="stock" pixname="About"/>
        </commands>

	<menu>
		<submenu name="Game" _label="_Game">
			 <placeholder/>
			 <separator/>
			 <menuitem name="FileExit" verb=""/>
		</submenu>

		<submenu name="Settings" _label="_Settings">
			 <placeholder/>
			 <separator/>
			 <menuitem name="Preferences" verb=""/>
		</submenu>

		<submenu name="Help" _label="_Help">
			 <menuitem name="HelpAbout" verb=""/>
		</submenu>
	</menu>

	<dockitem name="Toolbar" relief="none" homogeneous="1" behavior="exclusive">
		  <placeholder/>
	</dockitem>
</Root>

A simple explanation. Think of the Model/View concept. The <cmd> tags are like
models. They hold the basic info for commands. If the "name" field of the 
menuitems is same as "name" field of a <cmd> tags, it becomes like a "view" of
it. So you can have a toolbar icon for Open and a menuitem for Open. but
since they call the same callback, there <cmd> tag will be same.

It maybe a lame way to explain things, but thats the best way I could put 
forward in a simple way. Read the ui-xml.txt files in bonobo/doc.

Archit Baweja

Murray Cumming <Murray_Cumming BetaResearch de> writes:

> So, according to the API reference for BonoboWindow, "Its API mandates
> the use of XML to specify your UI". This XML file seems to be used in
> the example code, in the call to bonobo_ui_util_set_ui(). So where can I
> find a description of these XML files? What DTD do they use?
> 
> -- 
> Murray Cumming
> www.murrayc.com
> murrayc usa net
> 
> _______________________________________________
> gnome-components-list mailing list
> gnome-components-list gnome org
> http://mail.gnome.org/mailman/listinfo/gnome-components-list
> 

-- 
Its better to burn out than to fade away.




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