Tag Info

Hot answers tagged

9

Good question. First of all, the appindicators are not Unity specific in any way. Actually, they run just as well on Xfce or KDE. It's very, very, simple to use. You'll create an indicator object, set the name of icons to use when it needs attention, etc, and simply attach menus to it. The indicators are then sent over dbus and properly displayed in a ...


9

An Ubuntu "app" is just an application, just like GIMP, Firefox, or whatever. They're still Debian packages, we just provide a tool called Quickly that gets people going with PyGTK and make it easy to package and submit to the software center. You can still write your application in Qt, package it, and submit it to the Software Center, we just are trying ...


8

Well, an application is provided as a package, but not all packages are applications. One or more fonts can be provided as packages, for instance. In other words, there is a conceptual difference between a package and an application, but no difference between an application and a package. Yes, you can develop applications in any language and using any ...


8

What's going on The <property name="icon"> settings refers to the window icon, not the application icon. As I understand it, the Ubuntu windowing server (X.org) squashes these to a tiny size after loading. If you don't recall from year 2009, they used to be used in this capacity: Using application icons instead Ubuntu Unity will use this low-res ...


7

Here's an example that has context from gi.repository import Gtk class Handler: def onDeleteWindow(self, *args): Gtk.main_quit(*args) def addNotebookClick(self, *args): vbox = builder.get_object("attachtome") mynote = builder.get_object("notebook1") temp = Gtk.Box() mynote.reparent(temp) ...


7

As of 12.04 Gtk3 is the default on 12.04. For 11.x Simple answer: No, it does not (Quickly 11.10). Extended answer: Since all the code produced by quickly can be edited, you can change it to support gtk3, but it does not come with support. There is however a branch of quickly in development that (only) supports gtk3. You can see the difference in the ...


7

Okay, this is going to be step by step: Our widget is going to be named AwesomeTextView, the module it's in will be called awesome_text_view. These are the only names we need. A glade widget consists of two parts, the module and the catalog. We create a catalog, awesome_text_view.xml, and (as root) save it at /usr/share/glade3/catalogs/ This is what ...


6

The Application Indicator menu support is based on D-Bus menus, which are limited in what they support - they only support basic menu functionality, not more exotic things such as arbitrary widgets. One significant roadblock to them ever supporting such things is the fact that the application indicator menu is rendered by a different process, the ...


6

What I've done for StackApplet is to simply disable a menu item and use that as a 'header'. That way it doesn't respond to mouse clicks and looks like a static text label.


6

Yes, in fact it's almost exactly the same: from gi.repository import Gtk class Test (object): def __init__(self): self.builder = Gtk.Builder() self.builder.add_from_file("test.glade") self.builder.connect_signals(self) def run(self, *args): self.builder.get_object("window1").show() Gtk.main() def ...


6

You can also try to have a look at the help for the add command. You can do either of these: invoke the quickly help add command invoke the quickly tutorial command and browse to the add command reference From the outupt of quickly help add For instance 'quickly add dialog dialog-name' will create: A subclass of Gtk.Dialog called DialogNameDialog in ...


5

This is a tricky one, I had a similar problem, when trying to have only a ncurses based interface on a time tracker pc, the problem for me was that when no window manager is present, normal X Window applications behave oddly. Here's my proposal: Install ratpoison window manager sudo apt-get install ratpoison Unbind keyboards that shows a menu or allows ...


4

Two solutions in one! :) First, there is a special button widget just for this job: GtkLinkButton. You create a GtkLinkButton just like a normal button. Here is a simple example program written with Python and PyGObject. PyGTK should look pretty similar: from gi.repository import Gtk window = Gtk.Window() button = Gtk.LinkButton("http://www.google.com", ...


4

If you built vim against Qt rather than GTK+ and python-complete still isn't working, that suggests the problem isn't actually a consequence of trying to link to both GTK+2 and GTK+3. However, since you haven't yet provided any details about how you built with Qt (Qt isn't officially supported, so you must have used a third party derivative of vim), and you ...


4

This bug report http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=628492 suggests python-glade2 is the missing dependency. sudo apt-get install python-glade2 If that fixes the problem, you may wish to append your bug report on launchpad ;)


4

The fix is: self.add_page(self.get_pages()) not self.add_page(self.get_pages) the latter passes in the function self.get_pages not its return value Edit: from: pages = self.subject.get_nth_page(subjectNum) to: pages = self.subjects.get_nth_page(subjectNum) This is a simple typo we all make from time to time.


4

A reference to the current icon theme can be found in gconf-editor at: desktop > gnome > interface > icon_theme You can alternatively read directly ~/.gconf/desktop/gnome/interface$ cat %gconf.xml file. Unfortunately, this does not provide a path to the relevant icon theme. I'll check how this setting relates to the path and i'll let you know ;-)


4

Think I've cracked the code after dir()-ing everything I could find in the GObject class => G_SIGNAL_RUN_FIRST is found in the GSignalFlags enum, which translates to GObject.SignalFlags.RUN_FIRST. This is consistent, so G_SIGNAL_MATCH_ID found in the enum GSignalMatchType translates to GObject.SignalMatchType.ID. Not entirely obvious, but easy enough once ...


4

As per previous comments, the translation you asked would be as follows: from gi.repository import GObject __gsignals__ = {'cell-edited': (GObject.SignalFlags.RUN_LAST, GObject.TYPE_NONE, (GObject.TYPE_PYOBJECT, GObject.TYPE_PYOBJECT, GObject.TYPE_PYOBJECT, GObject.TYPE_PYOBJECT, ...


4

Using the function list_icons(): icons=icon_theme.list_icons() for icon in icons: if 'usb' in icon: print icon and the output: drive-removable-media-usb usbpendrive_unmount gnome-dev-removable-usb usb-creator drive-harddisk-usb gnome-dev-harddisk-usb gnome-dev-unknown-usb usb-creator-gtk drive-harddisk-usb-symbolic Now take your pic


3

Threads and GTK don't always play nice together. There are a few tricks that help, but don't be surprised to have weird bugs. I recently removed all threads from an application and it feels much better. So, the first thing you should think about is whether you can rewrite your application to take advantage of the GLib async methods. If you insist on having ...


3

sudo apt-get install python-gtk2 should fix this. These are the python bindings for GTK, which is a graphical package used to build the GUI for software-center. axi is something else entirely, try typing sudo apt-get install afnix into a terminal and see if that fixes it.


3

You should use gtk_scrolled_window widget because is the only widget that support overlay scrollbars. Source https://wiki.ubuntu.com/Ayatana/ScrollBars If it doesn't work try with: sudo su echo "export LIBOVERLAY_SCROLLBAR=1" > /etc/X11/Xsession.d/80overlayscrollbars


3

For your part of the question : if I create custom icon, how can I detect which theme is active (I suppose I need to have dark and light icon version) and render appropriate icon? What is with other themes, looks like it's hard to support all of them? you can use "gtk-theme-name" property defined in GtkSettings class to get the name of the ...


3

I don't think it's a problem specific to the toolbar, in that if you add an entry elsewhere you would face the same issue - it won't go less than a certain width (I'm assuming your problem is making it smaller rather than larger) using the Width request property. See this: http://faq.pygtk.org/index.py?file=faq14.001.htp&req=show and ...


3

The XML file defines a set of keys you can use throughout your application to store user preferences. In the element schema, you will notice two attributes: id and path. The id is what you use to refer to the schema in the code when instantiating the settings object. The path is where the keys are stored. You can find the settings by installing the ...


3

I found this stackoverflow post, which leads to the documentation on the run function of a GtkDialog, where it states: The run() method blocks in a recursive main loop until the dialog either emits the "response" signal, or is destroyed. If the dialog is destroyed, the run() method returns gtk.RESPONSE_NONE; otherwise, it returns the response ID ...


3

What architectures your application is built for depends on the Architecture field in your debian/control file. all will build architecture-independent packages. any will build architecture-depend packages, once for each of the supported architectures. You can also explicitly specify the architectures that should be build (e.g. Architecture: amd64 ...


3

Here you go, taken from the Seahorse source: from gi.repository import Gtk, Gio icon_theme = Gtk.IconTheme.get_default() def get_pixbuf_from_themed_icon(name, size): icon = Gio.ThemedIcon.new_with_default_fallbacks(name) icon_info = icon_theme.lookup_by_gicon(icon, size, 0) return icon_info.load_icon() pixbuf_lock = ...


3

Yes it's possible. No it's probably not worth it for redistribution. If you did manually update your pygi+webkit you would have to shove that in a ppa and depend on your own packaged version of WebKit in order to "send" the functionality to other users. You would run the risk of breaking other things that depend on the current version in repo, which ...



Only top voted, non community-wiki answers of a minimum length are eligible