FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

gtkstate, undefined GTK_STATE_ACTIVE ? Solved !

 
Post new topic   Reply to topic     Forum Index -> gtkD
View previous topic :: View next topic  
Author Message
DrakeMagi



Joined: 31 Jul 2011
Posts: 17

PostPosted: Wed Aug 03, 2011 6:50 am    Post subject: gtkstate, undefined GTK_STATE_ACTIVE ? Solved ! Reply with quote

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
View user's profile Send private message
Mike Wey



Joined: 07 May 2007
Posts: 428

PostPosted: Wed Aug 03, 2011 1:40 pm    Post subject: Reply with quote

I'm not really sure what your asking?
Back to top
View user's profile Send private message
DrakeMagi



Joined: 31 Jul 2011
Posts: 17

PostPosted: Wed Aug 03, 2011 2:18 pm    Post subject: Reply with quote

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
View user's profile Send private message
DrakeMagi



Joined: 31 Jul 2011
Posts: 17

PostPosted: Thu Aug 04, 2011 7:37 am    Post subject: Reply with quote

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
View user's profile Send private message
DrakeMagi



Joined: 31 Jul 2011
Posts: 17

PostPosted: Thu Aug 04, 2011 10:02 am    Post subject: Reply with quote

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
View user's profile Send private message
Mike Wey



Joined: 07 May 2007
Posts: 428

PostPosted: Thu Aug 04, 2011 2:14 pm    Post subject: Reply with quote

Great. Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> gtkD All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group