Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2005:
[Freeciv-Dev] Re: Adding Things To the Game
Home

[Freeciv-Dev] Re: Adding Things To the Game

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: YaChu Yang <yyan050@xxxxxxxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Adding Things To the Game
From: Vasco Alexandre Da Silva Costa <vasc@xxxxxxxxxxxxxx>
Date: Mon, 22 Aug 2005 15:49:35 +0100 (WET DST)

On Mon, 22 Aug 2005, YaChu Yang wrote:

> Hi,
>
> I'm currently looking at the FreeCiv game code. I'm a real novice in C/C++, 
> and
> this might sound like a stupid question but....
>
> I've spent hours trying to add a new tab with buttons, labels etc. in the city
> "overview" window (the one that gives city overview, worklist, CMA, happiness
> etc. for each city) and I've only managed to add a button in the bottom panel
> with the 'Close', 'Rename' etc. and crash the game when I try creating a new
> tab. I've tried copying certain code that creates the 'City Overview' tab, but
> that crashed the game, and I've also increase the variable that indicates how
> many tabs there are to 7, and it crashed on me. I've tried everything that I
> could think of in the citydlg.c file and all it's done is crash and burn on me
> :(

You need to increase the constant which holds the number of tabs, then add
the tab name string to the proper array. IIRC.

> I've also made a few C files for our GA, and we were wondering if I wanted to
> have my files as part of the game what changes would I need to make so that my
> code compiles and works with the rest of the game. Currently I hope to use my
> files with the civclient.c file.
>
> Any hints you could give me would be greatly appreciated.

Assuming you are modifying gui-gtk-2.0, the GTK+ (GUI toolkit)
reference manual would probably come in handy:
http://developer.gnome.org/doc/API/2.0/gtk/index.html

Here is a pictorial overview of the available GTK+ widgets:
http://developer.gnome.org/doc/API/2.0/gtk/ch02.html

---
Vasco Alexandre da Silva Costa @ Instituto Superior Tecnico, Lisboa




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