Tag Info

Hot answers tagged

15

There is a useful python extension that incorporates Meld into Nautilus how to install Obtain the source or the deb package from the authors website. wget http://www.giuspen.com/software/nautilus-pyextensions_3.0-1_all.deb sudo apt-get install python-nautilus sudo dpkg -i nautilus-pyextensions_3.0-1_all.deb Search for pyextension in Dash and run ...


10

Here we go: First you need to find the default background color for the the current theme. Then you can inject it into the current css for the GtkToolbar class. # Get the default window background color for the the current theme. win_style_context = window.get_style_context() bg = win_style_context.lookup_color('theme_bg_color')[1].to_string() # Then we ...


8

You may switch to classic Theme in the menu: Window->Preferences->General->Appearance. This will get you back to the looks in eclipse 3.7 if you find that more appealing.


8

You can also install the nautilus-compare package, available (starting with Ubuntu 12.04) from the standard Ubuntu package repositories -- run the following from a terminal: sudo apt-get install nautilus-compare This provides nautilus menu options for 2-way and 3-way comparisons. Meld is used by default, but any user-defined diff application can be used. ...


8

Ubuntu 11.10 is built on the premise of the GTK+3 software libraries. Therefore, removing GTK+3 will effectively mean no "ubuntu". What you will be left with is a newer kernel and a few additional slightly upgraded packages. If you are not interested in backward compatibility etc, then it would be simpler to start from a GTK+2/gnome2 based distro such as ...


7

Here a basic example: #!/usr/bin/env python from gi.repository import Gtk, Vte from gi.repository import GLib import os terminal = Vte.Terminal() terminal.fork_command_full( Vte.PtyFlags.DEFAULT, os.environ['HOME'], ["/bin/sh"], [], GLib.SpawnFlags.DO_NOT_REAP_CHILD, None, None, ) win = Gtk.Window() ...


7

Its certainly possible, I don't have much of themeing experience, but when you navigate to /usr/share/themes/*Theme Name*/gtk-3.0/apps/ directory, you'll find .css files, named with apps they target, to theme, so yes you can create the Themes. Note that the way you mentioned to theme your apps may require some work to be done (like having both Ambiance and ...


6

Open the file /usr/share/themes/MyTheme/gtk-3.0/apps/nautilus.css (Requires root permission). Add this line: NautilusWindow * {background-image:url("bg.jpg");} where bg.jpg is the background image you want to display. Run nautilus -q to kill all open file browsers. Run nautilus. This will apply background to all classes present inside ...


5

Found the answer here: https://forums.gentoo.org/viewtopic-t-948904-start-0.html Edit (or create) the file: ~/.config/gtk-3.0/settings.ini And add the following: [Settings] gtk-primary-button-warps-slider = false


5

It's not a problem with your installation, but with your code. Change win = Gtk.window() to win = Gtk.Window()


5

I have achieved a fade-out effect using pure GTK and CSS. It is only working in GTK 3.6 and I am not sure if a slide in / out effect would be possible, however, if you want, you can look at the source at launchpad.net/uberwriter It works through a state-change and then GTK Transitions... Maybe with height // width that would be possible, too. EDIT ...


5

No: the application needs to be ported to GTK3. This means adapting the application's source code to the new GTK API and linking against the new libraries. If you'd like to see your favorite application ported to GTK3, you should get in touch with its developers.


5

Use from gi.repository import Indicate instead of import indicate


5

Have a look at this example on how to connect events to callbacks in Gtk 3 and Python. In short, you use the connect() method to connect a signal name (which is emitted when an event such as a button click occurs) to a callback, which is the function that will handle your event. def __init__(self): # Other initialization code # We create a button ...


4

Does your application assume you are starting it from the folder /opt/NSTrain/? If so add the line Path=/opt/NSTrain/ to your .desktop file. That tells Unity (or Gnome Shell or from whatever program you are using to start your application) to start your program in the given folder. Without that line your application gets started from the current working ...


4

What version of Ubuntu are you on? At this point, you actually shouldn't be able to use PyGI with any of the old static pygobject stuff. If this was working, it was pretty much by accident. On Precise anyway, if the order of the imports is reversed, you get an exception explaining the issue: >>> import gst >>> from gi.repository import ...


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

I solved the problem, here's the code that works. The important part is setting the correct operator for operation that is being performed on the surface. #!/usr/bin/env python import cairo from gi.repository import Gtk, Gdk class MyWin (Gtk.Window): def __init__(self): super(MyWin, self).__init__() ...


4

Well, apparently not: $ GDK_BACKEND=broadway gnome-calculator Gdk-ERROR **: Unsupported GDK backend: broadway Trace/breakpoint trap (core dumped) You could try to create a bugreport for the Ubuntu GTK3 package, asking to compile it with --enable-broadway-backend GTK3 Ubuntu source package


4

I created a PPA with a Broadway-backend enabled GTK+. You can find it here.


4

Ported well, Yes and no. GTK 2 Themes make use of a gtkrc and other files like .png images. GTK 3 Themes make use of CSS for theming. CSS was chosen because it was easier to work with to make theming less difficult, so you would only need to create the needed CSS files to match the Colors and gradients, etc. of the GTK 2 you want. So there's really ...


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

First, as a little background for those who don't know what pixel-perfect scrolling means. (I didn't know myself, but I did some research and want to share that here.) Usually when you scroll on a touchpad (right edge or two-finger) or a tablet device, what happens is that the X server intercepts those signals and translates them to normal mouse wheel ...


4

Looking at the documentation, you should be able to use the get_path of the AppInfoManager object Running the following in the python interpreter: >>> from gi.repository import Unity >>> a = Unity.AppInfoManager.get_instance() >>> a.get_path("gedit.desktop") '/usr/share/applications/gedit.desktop' As you can see, just passing the desktop file-name ...


3

-dbg packages aren't automatic - the package maintainer needs to define the package, and pass the appropriate parameters to the package building tools to ensure the package has any content. By convention, but not by actual policy, the -dbg package is populated with data which would otherwise be removed by a call to GNU strip, i.e. debugging symbols which ...


3

Such animation is not achievable in pure GTK+. There are no mechanisms that would process it. I have given a quick look on gedit's source code, it's clear that they process this animation on their own. I have not looked into details, for the code related to animations is quite expanded, but I have noted that they incorporate Cairo drawing features for the ...


3

The manu items are in the top right corner. I'm attaching a pic of that.


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 ...



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