Re: gtk2-perl, glade-2, & nautilus



On Sun, 2003-08-17 at 13:52, muppet wrote:
On Sun, 2003-08-17 at 15:43, Jeff Trefftzs wrote:
I am trying to build an interactive nautilus script, based on gtk2-perl
and the glade-2 development package.

is this the kind of script you call from the File->Scripts menu?

Exactly.

What is the
beat way (using glade-2) to initially populate a text entry?  I would
like to have it display a list of selected files when the app first
comes up (files selected in nautilus).

if you're using Gtk2::GladeXML (and i assume you are), you can fetch the
textboxen by name from the gladexml object and call $entry->set_text
($new_text) on them before showing everything.

you just say $gladexml->get_widget ($name), where $name is the name you
gave the widget in the widget properties dialog in glade.

Ah.  Something like $glx->get_widget('textview1'); perhaps?
I'll give it a try.

I have tried realize, but that never seems to get
called -- is there some way to forcibly realize the text box before the
whole window is shown?

it would happen much like the method i described above... you ask for
the widget by name and then call realize on it.  i think that's not a
great way to go, though.  show would be a better signal.

And I'll try this, too.

On a related note, can anyone on this list tell me how to get a nautilus
script to actually show the GUI?  Or is this something that I really
should ask on a nautilus list?

i'm just making a wild guess, but does nautilus include DISPLAY in its
children's environments?  without that, both Gtk2->init and
Gtk2->init_check would fail because they can't get to the X server. 
 
hrm.  i just tried it out, and DISPLAY is set to :0, but some bizarre
messages show up in ~/.xsession-errors.

On my system (RH-9) it seems to show DISPLAY=:0.0  so that looks right.

Many thanks for the advice.

-- 

--Jeff

Jeff Trefftzs <trefftzs tcsn net>
http://www.tcsn.net/trefftzs                    Home Page
http://gug.sunsite.dk/gallery.php?artist=68     Gimp Gallery
http://trefftzs.topcities.com/                  Photo Gallery 




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