View previous topic :: View next topic |
Author |
Message |
DrakeMagi
Joined: 31 Jul 2011 Posts: 17
|
Posted: Wed Aug 03, 2011 6:50 am Post subject: gtkstate, undefined GTK_STATE_ACTIVE ? Solved ! |
|
|
using D version 1.0 on debian 6, gdc
undefine GTK_STATE_ACTIVE
Code: | numbers[length-1].modifyBg ( GTK_STATE_ACTIVE, color ); |
what do i need to do to fix this ?
anyway in adding space to the end of a HBox ?
Code: | //gdc -o dlotty dlotty.d -I/usr/include/d/4.3.5/gtkD/src -lm -ldl -lgtkd
import gtk.Main;
import gtk.MainWindow;
import gtk.VBox;
import gtk.HBox;
import gtk.Label;
import gtk.ToggleButton;
import gtk.Button;
import gtkc.gtktypes;
import gdk.Color;
import str = std.string;
class lotto : MainWindow
{
Label Last_winning_numbers;
ToggleButton numbers[];
this()
{
super("Dlotto");
setDefaultSize(800, 150);
HBox row = new HBox(true,2);
VBox table = new VBox(false,2);
GdkColor color = GdkColor(0,150,0);
for(uint i = 1; i < 57; i++)
{
numbers ~= new ToggleButton(str.toString(i));
numbers[length-1].modifyBg ( GTK_STATE_ACTIVE, color );
row.add(numbers[length-1]);
if(i%20 == 0)
{
table.add(row);
row = new HBox(true,2);
}
}
table.add(row);
add(table);
showAll();
}
}
void main(string[] args)
{
Main.init(args);
new lotto();
Main.run();
} |
Last edited by DrakeMagi on Thu Aug 04, 2011 10:00 am; edited 2 times in total |
|
Back to top |
|
|
Mike Wey
Joined: 07 May 2007 Posts: 428
|
Posted: Wed Aug 03, 2011 1:40 pm Post subject: |
|
|
I'm not really sure what your asking? |
|
Back to top |
|
|
DrakeMagi
Joined: 31 Jul 2011 Posts: 17
|
Posted: Wed Aug 03, 2011 2:18 pm Post subject: |
|
|
Error: undefined identifier GTK_STATE_ACTIVE
Error: cannot implicitly convert expression (color) of type GdkColor to gdk.Color.Color
want to fix compiler errors ?
want to know if i can add spaces to HBox ? |
|
Back to top |
|
|
DrakeMagi
Joined: 31 Jul 2011 Posts: 17
|
Posted: Thu Aug 04, 2011 7:37 am Post subject: |
|
|
solved GTK_STATE_ACTIVE
should have been this , StateType.ACTIVE
now figure out color
gdkcolor variable it doesn't like.
say it needs gdk.color.color ? |
|
Back to top |
|
|
DrakeMagi
Joined: 31 Jul 2011 Posts: 17
|
Posted: Thu Aug 04, 2011 10:02 am Post subject: |
|
|
i have solved it.
Code: | numbers[length-1].modifyBg ( GTK_STATE_ACTIVE, color ); |
should have been
Code: | numbers[length-1].modifyBg ( StateType.ACTIVE, new Color(cast(ubyte)0,cast(ubyte)150,cast(ubyte)0) ); |
|
|
Back to top |
|
|
Mike Wey
Joined: 07 May 2007 Posts: 428
|
Posted: Thu Aug 04, 2011 2:14 pm Post subject: |
|
|
Great. |
|
Back to top |
|
|
|