Reply
Thread Tools
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#1
Hey programmer-types,

I wrote a tiny Python app to open a window and put some text in it. But because it is in Python, I need to depend on Python for my package, which otherwise wouldn't have any dependencies.

Could someone write a small compiled program (in C or something) that uses the stock libraries to do the same thing?

Here's the Python code. I mostly ripped it off from the Maemo Python tutorial. It should be very obvious what I want, and I can't imagine it is difficult for any C programmer to whip something up.

Code:
#!/usr/bin/env python2.5
import gtk
import sys

wmname = sys.argv[1]
exttxt = sys.argv[2]

window = gtk.Window(gtk.WINDOW_TOPLEVEL)
window.set_title (wmname)
window.connect("destroy", gtk.main_quit)

label1 = gtk.Label("This is the "+wmname+" host window.\n"+exttxt)
window.add(label1)

window.show_all ()
gtk.main()
__________________
qole.org --- twitter --- Easy Debian wiki page
Please don't send me a private message, post to the appropriate thread.
Thank you all for your donations!
 
Posts: 155 | Thanked: 69 times | Joined on Apr 2008
#2
There are a couple of threads on here for "zenity" and "gxmessage" which may be what you want.
 
Bundyo's Avatar
Posts: 4,707 | Thanked: 4,643 times | Joined on Oct 2007 @ Bulgaria
#3
You can try with Vala too.
__________________
Technically, there are three determinate states the cat could be in: Alive, Dead, and Bloody Furious.
 
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#4
Thanks for your suggestions.

I am familiar with gxmessage and Zenity. I don't want a dialog box, I want a window. I also want no dependencies.

As I asked in the first post, I would like someone to post (or PM me) a dependency-free, compiled file that does what the python script does, please. I don't care what language it is written in originally. I don't need the source, either.
__________________
qole.org --- twitter --- Easy Debian wiki page
Please don't send me a private message, post to the appropriate thread.
Thank you all for your donations!
 
Bundyo's Avatar
Posts: 4,707 | Thanked: 4,643 times | Joined on Oct 2007 @ Bulgaria
#5
Do you want to run it from the menu?
__________________
Technically, there are three determinate states the cat could be in: Alive, Dead, and Bloody Furious.
 
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#6
I want to run it as part of a script that is run from the menu.

If you want more context: I need a host window for the Xephyr nested x-server. This host window supplies the panel icon and task menu entry for Xephyr, which doesn't have such things in Hildon.

If you've tried my easy chroot package, you see this window before IceWM starts.

EDIT: Here's a screenshot of what the Python script does:

Running the following:
Code:
/usr/bin/openhostwin.py IceWM "Please log out of IceWM before closing this window."
Produces this:
__________________
qole.org --- twitter --- Easy Debian wiki page
Please don't send me a private message, post to the appropriate thread.
Thank you all for your donations!

Last edited by qole; 2008-07-12 at 07:24. Reason: screenshot
 

The Following User Says Thank You to qole For This Useful Post:
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#7
It would really be cool if the program could be linked to an arbitrary png file (say, "hostwin.png") that would show in the left-hand task bar and on the task chooser menu, and that I could modify.

I'm willing to discuss payment via PayPal. I was the recipient of some donations, I should pass on the joy.
__________________
qole.org --- twitter --- Easy Debian wiki page
Please don't send me a private message, post to the appropriate thread.
Thank you all for your donations!
 
Bundyo's Avatar
Posts: 4,707 | Thanked: 4,643 times | Joined on Oct 2007 @ Bulgaria
#8
I almost done it 2 hours ago, but had to go out
__________________
Technically, there are three determinate states the cat could be in: Alive, Dead, and Bloody Furious.
 

The Following User Says Thank You to Bundyo For This Useful Post:
Bundyo's Avatar
Posts: 4,707 | Thanked: 4,643 times | Joined on Oct 2007 @ Bulgaria
#9
http://bundyo.org/maemo/hostwin.bz2

Is this okay?

Btw, if you run it from the menu, i'm registering it with osso_initialize, so i guess it will show you the icon.

Or maybe i can do it so you can pass a script to run as third parameter?
__________________
Technically, there are three determinate states the cat could be in: Alive, Dead, and Bloody Furious.
 

The Following User Says Thank You to Bundyo For This Useful Post:
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#10
Perfect! That does what my Python script does, but faster. That is just what I asked for!

Enhancement talk:

So if I made a dbus service entry for it, that would add more integration?

The only way I could run it from the menu would be if I could pass a script name that this app could run after opening the window...
__________________
qole.org --- twitter --- Easy Debian wiki page
Please don't send me a private message, post to the appropriate thread.
Thank you all for your donations!
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 22:09.