Re: [PHP-GTK] Gtk2 issues I've found..
[email protected] (kksou)
| Newsgroups | php.gtk.general |
|---|---|
| Message-ID | <[email protected]> |
Matt-239 wrote:
> 3. Various image issues. Icons for MessageDialogBoxs work fine, Window
> icons load fine, but everything else doesn't. Any image on a button will
> not show up (stock or loaded from png), likewise I have images displayed
> in a GtkTreeView that worked fine before, but now don't show up at all.
> The only images I'm seeing in the app are the window icon and
> MessageDialogBox icon. I'm receiving no warnings or errors on this one..
> its like they are loaded but just not displayed.
>
Hi Matt,
In the folder: etc\gtk-2.0
edit file: gtkrc
line 5: change to "gtk-button-images = 1"
You should be able to see the stock images.
Attached a sample code below for testing purpose.
Sample output:
http://www.nabble.com/file/p15822095/0203.gif
Regards,
/kksou
<?php
$window = new GtkWindow();
$window->set_title($argv[0]);
$window->set_size_request(400, 200);
$window->connect_simple('destroy', array('Gtk','main_quit'));
$window->add($vbox = new GtkVBox());
// display title
$title = new GtkLabel("Using Stock Images for Buttons");
$title->modify_font(new PangoFontDescription("Times New Roman Italic 10"));
$title->modify_fg(Gtk::STATE_NORMAL, GdkColor::parse("#0000ff"));
$title->set_size_request(-1, 40);
$title->set_justify(Gtk::JUSTIFY_CENTER);
$alignment = new GtkAlignment(0.5, 0, 0, 0);
$alignment->add($title);
$vbox->pack_start($alignment, 0, 0);
$vbox->pack_start(new GtkLabel(), 0, 0);
// setup button
$vbox->pack_start($hbox = new GtkHBox(), 0);
$hbox->pack_start(GtkButton::new_from_stock(Gtk::STOCK_NEW), 0);
$hbox->pack_start(GtkButton::new_from_stock(Gtk::STOCK_OPEN), 0);
$hbox->pack_start(GtkButton::new_from_stock(Gtk::STOCK_CLOSE), 0);
$vbox->pack_start(new GtkLabel(), 0);
$vbox->pack_start($hbox = new GtkHBox(), 0);
$hbox->pack_start(GtkButton::new_from_stock(Gtk::STOCK_MEDIA_PREVIOUS), 0);
$hbox->pack_start(GtkButton::new_from_stock(Gtk::STOCK_MEDIA_PLAY), 0);
$hbox->pack_start(GtkButton::new_from_stock(Gtk::STOCK_MEDIA_STOP), 0);
$hbox->pack_start(GtkButton::new_from_stock(Gtk::STOCK_MEDIA_NEXT), 0);
$window->show_all();
Gtk::main();
?>
--
View this message in context: http://www.nabble.com/Gtk2-issues-I%27ve-found..-tp15815759p15822095.html
Sent from the Php - GTK - General mailing list archive at Nabble.com.