style name for Text insertion cursor

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

style name for Text insertion cursor

zentara
Hi,
I like to use a black background in my text boxes. But I can't
seem to find the style setting to make the insertion cursor visible.
Can someone point it out to me please?

Thanks.

#!/usr/bin/perl
use warnings;
use strict;
use Glib qw/TRUE FALSE/;
use Gtk2 '-init';

Gtk2::Rc->parse_string(<<__);

style "my_text" {
font_name ="sans 24"
text[NORMAL] = "#FFAA00"
base[NORMAL] = "#000000"  
}

widget "*Text*" style "my_text"
__

my $window = Gtk2::Window->new('toplevel');
$window->set_title('Z');
$window ->signal_connect( 'destroy' => \&delete_event );
$window->set_border_width(10);
$window->set_size_request(400,400);

my $vbox = Gtk2::VBox->new( FALSE, 6 );
$window->add($vbox);
$vbox->set_border_width(2);

my $hbox= Gtk2::HBox->new( FALSE, 6 );
$vbox->pack_end($hbox,FALSE,FALSE,0);

my $ebutton = Gtk2::Button->new_from_stock('gtk-quit');
$hbox->pack_end( $ebutton, FALSE, FALSE, 0 );
$ebutton->signal_connect( clicked => \&delete_event );

my $textbuffer = Gtk2::TextBuffer->new();
$textbuffer->set_text('yadda yadda yadda');
my $textview = Gtk2::TextView->new_with_buffer($textbuffer);
my $scrolledwindow = Gtk2::ScrolledWindow->new( undef, undef );
$scrolledwindow->add($textview);
$vbox->pack_start($scrolledwindow, 1, 1, 0 );

$window->show_all();

Gtk2->main;
#####################################
sub delete_event {
Gtk2->main_quit;
return FALSE;
}
#######################################



--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html
_______________________________________________
gtk-perl-list mailing list
[hidden email]
http://mail.gnome.org/mailman/listinfo/gtk-perl-list
Reply | Threaded
Open this post in threaded view
|

Re: style name for Text insertion cursor

muppet-6

On Jun 19, 2005, at 7:02 PM, zentara wrote:

> style "my_text" {
> font_name ="sans 24"
> text[NORMAL] = "#FFAA00"
> base[NORMAL] = "#000000"

GtkTextView::cursor-color = "red"  # or whatever you like

> }
>
> widget "*Text*" style "my_text"


i'm sure that's documented somewhere, but i found it by romping  
through the gtk+ sources...  for some reason, you have to set the  
cursor-color style property for GtkEntry and GtkTextView separately.


--
If I lived in Teletubby Land, the homicide rate would be four.
   -- elysse

_______________________________________________
gtk-perl-list mailing list
[hidden email]
http://mail.gnome.org/mailman/listinfo/gtk-perl-list