[pygtk] How to set gtk.Clipboard data right?

2010-09-04 Thread Osmo Maatta
Hello, My application wants to provide 2 types of clipboard data; * Filename uri list, * Filename list as text. The clipboard targets are: clipboard_targets = [ ('x-special/gnome-copied-files',0,0), ("text/uri-list",0,0), ("UTF8_STRING",0,0)] I use the clipboard.set_with_data(..) function

Re: [pygtk] gtk.ComboBoxEntry and "changed" even t on keystrokes  [SOLVED by rethinking]

2010-03-30 Thread Osmo Maatta
0 03:09 PM, Osmo Maatta wrote: Hello, I have a small application that has a search-field (gtk.ComboBoxEntry) and a button to start a search job. The application will start a new search if user: 1) Selects an item from the gtk.ComboBoxEntry's drop-down list. This is handled by gtk.

[pygtk] gtk.ComboBoxEntry and "changed" event on keystrokes.

2010-03-30 Thread Osmo Maatta
Hello, I have a small application that has a search-field (gtk.ComboBoxEntry) and a button to start a search job. The application will start a new search if user: 1) Selects an item from the gtk.ComboBoxEntry's drop-down list. This is handled by gtk.ComboBoxEntry's "changed" event. This is

Re: [pygtk] Tool button with menu items and icons.

2010-03-28 Thread Osmo Maatta
That was really helpful method. I can now enable menu icons per. application. So we have two methods to show icons in the menu items (in the GNOME desktop). 1) Set the global GNOME option in the Gconf. Start gconf-editor and activate the "/desktop/gnome/interface/menus_have_icons" item. 2)

Re: [pygtk] Tool button with menu items and icons.

2010-03-27 Thread Osmo Maatta
Re-hello, Yes, you are right. The icons became visible after I enabled the "menus_have_icons" option in the GConf. Icons on menus simply rock! See why http://bildr.no/view/616349 Many thanks. // Moma Antero Grønland On 03/27/2010 02:28 PM, Andrew Steele wrote: My bet on the icons not ap

[pygtk] Tool button with menu items and icons.

2010-03-27 Thread Osmo Maatta
Hello, My app has a tool-button with menu. I want to populate this menu with menu-items that have both a label and icon. The menu items appear but the images (icons) are not shown. See this picture (tool button with menu + three menu-items shown) http://bildr.no/view/616160 I know the icon fil

Re: [pygtk] Wnck: Switching to and reporting current workspace (desktop) number.

2010-03-07 Thread Osmo Maatta
Re-hello, Yes, your code works fine. But the following code fails. The "self.attuale" print 0 for every loop. # Again: This works only with Metacity or similar WM. import gtk, gobject, wnck import time class Cambiatore(object): def __init__(self): self.screen= wnck.screen_get_defau

[pygtk] Wnck: Switching to and reporting current workspace (desktop) number.

2010-03-06 Thread Osmo Maatta
Hello, This question is about the Wnck library. I still hope someone here can shed light on this issue. The following code snippet loops though all active workspaces/desktops. It then tries to report the actual desktop/workspace number, but the "current workspace num" does not change. The co

[pygtk] Drawing on a gdk.Pixbuf using Cairo.

2010-03-02 Thread Osmo Maatta
Hi again, I have a program that needs to draw circles and other elements on a gdk.Pixbuf image. The current code works well but when creating a Cairo-surface from pixbuf, the gtk.gdk.Pixbuf.get_pixels_array() function reports that it's deprecated and should be avoided. pix_data = pixbuf.g

Re: [pygtk] How to get cursor/mouse-pointer image (pixbuf) for an application window.

2010-03-01 Thread Osmo Maatta
me to position the mouse-pointer/cursor. $ sleep 5; python read_cursor_image.py # The cursor image is saved to cursor1.png Many thanks! Cheers Osmo Antero M. Grønland, Oslo Wojciech Muła wrote: Osmo Maatta wrote: I've done it in c-code earlier and it works well. The c-code is h

[pygtk] How to get cursor/mouse-pointer image (pixbuf) for an application window.

2010-02-28 Thread Osmo Maatta
Hello, I would like to get cursor/mouse-pointer image for an application window in Linux. I have studied several libraries that support Python, but haven't found a suitable function to read Cursor or Pointer image. PyGTK : http://www.pygtk.org/docs/pygtk/index.html No success. Wnck python l

Re: [pygtk] Making gtk.IconView sortable. Crashes at model.clear().

2010-02-24 Thread Osmo Maatta
http://www.futuredesktop.com/tmp/Test6-good.tar.gz It rocks! Thanks, Osmo (Moma) Antero M Grønland, Norway Osmo Maatta wrote: Hello, I have a small application that shows thumbnail-images in a gtk.IconView widget. The thumbnails are sortable on filename, file size and date. The sorting

[pygtk] Making gtk.IconView sortable. Crashes at model.clear().

2010-02-24 Thread Osmo Maatta
Hello, I have a small application that shows thumbnail-images in a gtk.IconView widget. The thumbnails are sortable on filename, file size and date. The sorting seems to work fine. But the program crashes when I try to reload the thumbnails. Here is a picture of the application. http://bildr

Re: [pygtk] pygtk compiled with numpy for win32

2010-02-21 Thread Osmo Maatta
Hello, Maybe you can use the gtk.gdk.pixbuf_new_from_data() function instead. Take a look at this module (som functions I prototyped for my Gscreendump program). http://www.futuredesktop.com/tmp/switch_desktop.py Look for "get_window_icon_image" function. Use struct.pack_into(...) to pack th

Re: [pygtk] [on gnome] finding registered applications + icon(s) for MIME type

2010-02-19 Thread Osmo Maatta
Typo. The reference should be http://code.google.com/p/gscreendump/source/browse/trunk/src/sd_interface.c Osmo Maatta wrote: Hello, In my Gscreendump app I've used the following code. http://code.google.com/p/gscreendump/source/browse/trunk/src/sd_interface. Searc

Re: [pygtk] [on gnome] finding registered applications + icon(s) for MIME type

2010-02-19 Thread Osmo Maatta
Hello, In my Gscreendump app I've used the following code. http://code.google.com/p/gscreendump/source/browse/trunk/src/sd_interface. Search for "g_app_info_get_all_for_type" function. That converted to Python becomes: import gio # Mime type mime_type = "image/png" # Get list of supported apps

Re: [pygtk] Sending a message to the window manager (switch to desktop # X)

2010-02-10 Thread Osmo Maatta
Re-hello, The wnck library seems to have many useful functions. I made this based on your example. import gtk, gobject, wnck class SwitchDesktop(object): def __init__(self): self.screen = wnck.screen_get_default() def switch(self, desktop_num): self.screen = wnck.screen_g

[pygtk] Sending a message to the window manager (switch to desktop # X)

2010-02-10 Thread Osmo Maatta
Hello, I have code that sends a message to the window manager to switch to a given desktop number. I try converted this code from C to GDK on Ubuntu Linux. # The code is this. import gtk.gdk import struct # Switch to desktop number X gdk_root = gtk.gdk.get_default_root_window() gdk_di

Re: [pygtk] Setting value of gtk.SpinButton without triggering the "value-changed" event.

2008-11-21 Thread Osmo Maatta
n.freeze_child_notify() self.width_spin.set_value(some_value) self.width_spin.thaw_child_notify() cheers - Original Message - From: "Osmo Maatta" <[EMAIL PROTECTED]> To: pygtk@daa.com.au Sent: Friday, November 21, 2008 2:52:53 PM (GMT-0500) Auto-Detected Subject: [pygtk] Setting value of gtk.S

[pygtk] Setting value of gtk.SpinButton without triggering the "value-changed" event.

2008-11-21 Thread Osmo Maatta
Hello, I need to change the self.width_spin (gtk.SpinButton) value, but in some cases I do not want the changed event to fire. How do I set the value? This is my code: adj = gtk.Adjustment(orig_width, 1, orig_width, 1, 50, 0) self.width_spin = gtk.SpinButton(adj, climb_rate=0.0