pygtk

How to make a Multiple-Select List Box in Ruby Glade/GTK, maybe using TreeView?

Hey guys, I am trying to make a multiple-select listbox in glade/ruby program and I am wondering how I go about doing this, like what element I add to the window and the corresponding example code I can use. I was looking at GTKList but it says it is deprecated now, and also I don't know how to get it working in ruby. GTK List docs say ...

pygtk: Draw lines onto a gtk.gdk.Pixbuf

I'm using pygtk with PIL. I've already figured out a way to convert PIL Images to gtk.gdk.Pixbufs. What I do to display the pixbuf is I create a gtk.gdk.Image, and then use img.set_from_pixbuf. I now want to draw a few lines onto this image. Apparently I need a Drawable to do that. I've started looking through the docs but already I have...

How to add GtkMozEmbed browser into a tab with Ruby/Glade/GtK?

Hey guys, I am trying to add a browser using GtkMozEmbed into a gui I am designing using Glade. I want the browser to take up a tab in a notebook widget, but I cannot figure out how to actually do this. I am wondering what container to use to put the browser in, and the associated ruby code to actually embed the browser in this contain...

How to make two elements in gtk have the same size?

I'm using pyGTK. I want to layout a large element with 2 smaller ones on each side. For aesthetic reasons, I want the 2 smaller ones to be the same size. As it is, they differ by a few pixels, and the middle element is not centered as a result. I tried using gtk.Table with 3 cells, but having homogeneous=True doesn't have the desired ef...

python and set_wrap_mode in treeview

Hi, i'Ve got a sring that i wann paste into a column: textrenderer = gtk.CellRendererText() column = gtk.TreeViewColumn('Text', textrenderer, text=COLUMN_TEXT) treeview.append_column(column) but the text is too long for the column and so the window gets automaticly resized, but i want to get the text wrapped automaticly like with this...

In GTK, how do I get the actual size of a widget on screen?

First I looked at the get_size_request method. The docs there end with: To get the size a widget will actually use, call the size_request() instead of this method. I look at size_request(), and it ends with Also remember that the size request is not necessarily the size a widget will actually be allocated. So, is there any f...

In GTK, how do I make a window unable to be closed?

Example: graying out the "X" on windows systems. ...

GTK: Modify bg color of a CheckButton

I tried the following, yet the button still has a white background: self.button = gtk.CheckButton() self.button.modify_fg(gtk.STATE_NORMAL, gtk.gdk.Color(65535,0,0)) self.button.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(65535,0,0)) self.button.modify_fg(gtk.STATE_ACTIVE, gtk.gdk.Color(65535,0,0)) self.button.modify_b...

GTK: create a colored regular button

How do I do it? A lot of sites say I can just call .modify_bg() on the button, but that doesn't do anything. I'm able to add an EventBox to the button, and add a label to that, and then change its colors, but it looks horrendous - there is a ton of gray space between the edge of the button that doesn't change. I just want something that ...

In GTK on Windows, how do I change the background color of the whole app?

According to http://www.pygtk.org/docs/pygtk/gtk-constants.html, there are five state types: STATE_NORMAL, STATE_INSENSITIVE, etc. I want to set the background color of a Table, HBox, VBox, whatever, and I've tried setting every possible color of every kind of state: style = self.get_style() for a in (style.base, style.fg, style...

How can I highlight a row in a gtk.Table?

I want to highlight specific rows in a gtk.Table. I also want a mouseover to highlight it w/ a different color (like on a link in a web browser). I thought of just packing each cell with an eventBox and changing the STATE_NORMAL and STATE_PRELIGHT bg colors, which does work, but mousing over the eventbox doesn't work. Is there a better w...

What's the point of alloc_color() in gtk?

Various examples always use alloc_color() and stuff like gtk.color.parse('red'), etc. I just do gtk.gdk.Color(65535,0,0), and that seems to work. What's the need for alloc_color? ...

Getting the position of the gtk.StatusIcon on Windows

I am assisting with Windows support for a PyGTK app that appears as a system tray applet, but am not so strong on the GTK+ gooey stuff... We have it so when you left-click the systray icon, the window appears right by your tray icon no matter where your system tray is--and on Linux this works great, using the results of gtk.StatusIcon.g...

In GTK, is there an easy way to scale all widgets by an arbitrary amount?

I want my widget to look exactly like it does now, except to be smaller. It includes buttons, labels, text, images, etc. Is there any way to just say "scale this to be half the size", and have GTK do all the image processing, widget resizing, etc., necessary? If not, what's the easiest way to accomplish this? ...

Scale an image in GTK

In GTK, how can I scale an image? Right now I load images with PIL and scale them beforehand, but is there a way to do it with GTK? ...

How can I change the font size in GTK?

Is there an easy way to change the font size of text elements in GTK? Right now the best I can do is do set_markup on a label, with something silly like: lbl.set_markup("<span font_desc='Tahoma 5.4'>%s</span>" % text) This 1) requires me to set the font , 2) seems like a lot of overhead (having to parse the markup), and 3) would make ...

Piping output of subprocess.call to progress bar

I'm using growisofs to burn an iso through my Python application. I have two classes in two different files; GUI() (main.py) and Boxblaze() (core.py). GUI() builds the window and handles all the events and stuff, and Boxblaze() has all the methods that GUI() calls. Now when the user has selected the device to burn with, and the file to...

How do I install PyGTK / PyGobject on Windows with Python 2.6?

Hi, I have an application which depends on PyGTK, PyGobject, and PyCairo that I built to work on Linux. I want to port it over to windows, but when I execute import gobject I get this: Traceback (most recent call last): import gobject File "C:\Python26\lib\site-packages\gtk-2.0\gobject\__init__.py", line 30, in <module> from ...

How I can add a Widget or a Region to an Status Icon in PyGTK

Hello All, This is my first question in StackOverflow, so I would try to explain my self the best I can. I made an small app trying to emularte the windows Procastination Killer Application, using pygtk and pygame for the sound alerts. Here is a video of my little app running http://www.youtube.com/watch?v=FmE-QPA9p-8 My Issue is tha...

Running function 5 seconds after pygtk widget is shown

How to run function 5 seconds after pygtk widget is shown? ...