Re: Where can find a full list and description of the signal name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 20 Aug 2008 13:50:58 +0800
"Lazy Fox" <lazy.fox.wu@xxxxxxxxx> wrote:

>Just like "expose-event" and "expose-event",
>I can't find all of them in the 'GTK+ Reference Manual' and source code.
>And other string type enumerations such as color: "red", "orange".
>I can't find them neither.
>
>Does anybody know where can find the full list and description of the string
>type enumerations.

If you look in gtk+-yourversion/docs/reference/gtk/html
you see gtk-Signals.html.

Search thru the files in that subdir for any keyword you want.

GtkColorSelection.html  has info on gdk_color_parse.

This is from /tests/testgtk.c 

 GdkColor red;                                                                       
                                                                                        
      /* make the widgets */                                                              
      button = gtk_button_new_with_label ("A Button");                                    
      event = gtk_event_box_new ();                                                       
      window = gtk_window_new (GTK_WINDOW_TOPLEVEL);                                      
                                                                                          
      g_signal_connect (window, "destroy",                                                
                        G_CALLBACK (gtk_widget_destroyed),                                
                        &window);                                                         
                                                                                          
      /* put a red background on the window */                                            
      gdk_color_parse ("red", &red);                                                      
      gtk_widget_modify_bg (window, GTK_STATE_NORMAL, &red);                              
                                                                                          
      /* set the colourmap for the event box.                                             
       * must be done before the event box is realised.                                   
       */                                                                                 
      screen = gtk_widget_get_screen (event);                                             
      rgba = gdk_screen_get_rgba_colormap (screen);                                       
      gtk_widget_set_colormap (event, rgba);                 


In Perl, this is what we use for named colors:

######################
my $gc = Gtk2::Gdk::GC->new ($gdkwindow, undef);
                                                                                          
my $colormap = Gtk2::Gdk::Colormap->get_system;                                           
$colormap = $gc->get_colormap;
       
# draw a pink rectangle                                                                   
my $color = Gtk2::Gdk::Color->parse('pink');                                              
my $colormap = $gdkwindow->get_colormap;                                                  
$colormap->alloc_color($color,TRUE,TRUE);                                                 
Gtk2::Gdk::GC::set_foreground($gc, $color);                                               
#######################    


You are not going to find 1 whiz-bang tutorial that explains everything
in full simplicity. You need to read the docs, search for examples of the keywords,
and piece it together yourself.
Searching thru this maillist archives will also yield many code examples.


zentara


-- 
I'm not really a human, but I play one on earth.
http://zentara.net/Remember_How_Lucky_You_Are.html 
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux