[Kde-games-devel] Re: KToolBar ?

Neil Stevens neil at qualityassistant.com
Wed Aug 20 18:34:32 CEST 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday August 20, 2003 05:22, cantabile wrote:
> Hi,
> I looked at the examples I found over the net, but I don't really
> understand how I can create a KToolBar.
> When I write (from my main widget inherited from KMainWindow):
>
> KToolBar* bar = new KToolBar(this);
> bar->insertButton( ... );
> //I tried adding addDockWindow(bar); with no effect
> bar->show();
>
> nothing appears. Is there something else to do ?

Here's the answer to both questions at once:  By using kdelibs fully, your 
app is easier to write, and your app will look and act more like a KDE 
application.

To create menubars and toolbars you should use the XML GUI system. There is 
a tutorial for it at 
http://developer.kde.org/documentation/tutorials/xmlui/preface.html

Doing it this way means a lot less work for you, because you don't have to 
manage the menubars and toolbars yourself.

Notice that in addition to the KStandardActions in kdelibs, there are 
game-specific ones in libkdegames' kstdgameaction.h

Examples of games using XML GUI are Megami and Atlantik.

- -- 
Neil Stevens - neil at qualityassistant.com

"I'll believe it when I see it." -- George Walker Bush
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)

iD8DBQE/RBOYf7mnligQOmERAs1hAJ4x+IWirddEC+mDw1EmFIOdw1p3dgCfR2MV
/ofAO/6roC/T6yK8IuypH9s=
=jjrT
-----END PGP SIGNATURE-----



More information about the kde-games-devel mailing list