starting with GUI

Carlos checoimg at gmail.com
Tue Apr 30 10:03:06 PDT 2013


I;m trying to add a Entry but I get the following error:

"mywindow.d(12): Error: undefined identifier Entry"

Here is my code :

"window.add(new Entry("Minsit"));"

I'm just guessing to see if everything is that simple. So I have 
to define the Entry. How do I do that ? ( Any tutorials from the 
web are welcome )

I'm trying to make a program that calculates two numbers and then 
adds them together to give a result.

Here is the CLI version :
"
import std.stdio;
import std.c.stdlib;
void main()
{
immutable sitc = 1.66, sleepc = 1.08;
float tcsleep, tcsit, tc;
int minsleep, minsit;
	write("Input number of minutes sleep and sit : \n");
	readf(" %s ", &minsleep);
	readf(" %s ", &minsit);
	write("Thanks!\n");
tcsit = minsleep*sleepc;
tcsleep = minsit*sitc;
tc = (tcsleep + tcsit);
	writeln("Your total burned calories is : ", tc);
}
"

I'm using this GTK for the GUI :

"http://www.dsource.org/projects/gtkd/wiki/DebianPackages"
  and this compiles fine with the following :

"dmd $(pkg-config --cflags --libs gtkd-2) mywindow.d"

This is the code I compiled with GTKD :
"
import gtk.MainWindow;
import gtk.Label;
import gtk.Main;

void main (string[] args)
{
Main.init(args);
auto window = new MainWindow("My Window");
window.show();
window.setDefaultSize(200, 100);
window.add(new Label("Hello!"));
window.showAll();
Main.run;
}
"

So basicly what I'm missing is a good way on learning to use this 
GTKD but for the moment I only want to define a Entry.
THank you for your time.


More information about the Digitalmars-d-learn mailing list