Re: [PHP-GTK] Gtk2 issues I've found..
[email protected] (Matt) Tue, 04 Mar 2008 08:41:24 -0600
| Newsgroups | php.gtk.general |
|---|---|
| Message-ID | <[email protected]> |
Per Elizabeth's note and yours below, I've managed to figure out the
theming a bit. Turns out my beta release did not have a gtkrc file so it
was just using the default theme. The new one has one set up to use the
Windows theme. I poked around in there and found the button image
setting and now that's back on. I also adjusted the ComboBox setting to
use the normal Gtk style list and that removes my annoying visual glitch.
So, thanks again for all the help.. This is my first time using GTK for
anything, so its hard to figure out where the dividing line between the
php-gtk code and the gtk libraries is. As a side note, does anyone know
where the documentation is for the gtkrc file? Seems like lots of
potential in there to cut out a lot of my formatting code..
-Matt
kksou wrote:
>
> 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();
>
> ?>
>
>
>