Gtk3 integration with ipython works. #1588

Merged
merged 7 commits into from Apr 14, 2012

Conversation

Projects
None yet
3 participants
@thomir
Contributor

thomir commented Apr 12, 2012

This branch adds support for interactive Gtk3 UI support.

The older Gtk2 bindings (pygtk) are being deprecated in the wild, in favor of the newer gi bindings. This allows users to use new features in Gtk3. This is a very simple branch, that follows the same pattern as the 'gtk' UI support feature, but for Gtk3.

@fperez

This comment has been minimized.

Show comment
Hide comment
@fperez

fperez Apr 14, 2012

Member

Do you have any tests we can use to see this functionality at work? It could be an interactive example that goes into docs/examples/lib if it's hard to unittest this...

Also, since this adds a 'gtk3' target for the %gui magic, the docstring for magic_gui needs to be updated to show that gtk3 is also a valid value.

Member

fperez commented Apr 14, 2012

Do you have any tests we can use to see this functionality at work? It could be an interactive example that goes into docs/examples/lib if it's hard to unittest this...

Also, since this adds a 'gtk3' target for the %gui magic, the docstring for magic_gui needs to be updated to show that gtk3 is also a valid value.

@thomir

This comment has been minimized.

Show comment
Hide comment
@thomir

thomir Apr 14, 2012

Contributor

Hi,

Thanks for looking at this. Both changes have been made now. I added a docstring to the %gui magic function. I notice that the UI types weren't listed alphabetically, so I put the docstring for 'gtk3' right below the docstring or 'gtk'. As far as testing is concerned, I've followed the pattern for the 'gtk' Gui integration.

Contributor

thomir commented Apr 14, 2012

Hi,

Thanks for looking at this. Both changes have been made now. I added a docstring to the %gui magic function. I notice that the UI types weren't listed alphabetically, so I put the docstring for 'gtk3' right below the docstring or 'gtk'. As far as testing is concerned, I've followed the pattern for the 'gtk' Gui integration.

@takluyver

View changes

IPython/core/magic.py
@@ -94,7 +94,7 @@ def needs_local_scope(func):
func.needs_local_scope = True
return func
-
+

This comment has been minimized.

@takluyver

takluyver Apr 14, 2012

Member

For future reference: please try to avoid whitespace changes in functional pull requests, because it makes it hard to see what's really changed.

@takluyver

takluyver Apr 14, 2012

Member

For future reference: please try to avoid whitespace changes in functional pull requests, because it makes it hard to see what's really changed.

@takluyver

View changes

docs/examples/lib/gui-gtk3.py
+
+
+def hello_world(wigdet, data=None):
+ print "Hello World"

This comment has been minimized.

@takluyver

takluyver Apr 14, 2012

Member

Can you change this to print("Hello World") so it's easy to test from Python 3 (I've just done it locally, and it does work). The brackets are valid in Python 2 for a single argument.

@takluyver

takluyver Apr 14, 2012

Member

Can you change this to print("Hello World") so it's easy to test from Python 3 (I've just done it locally, and it does work). The brackets are valid in Python 2 for a single argument.

@fperez

This comment has been minimized.

Show comment
Hide comment
@fperez

fperez Apr 14, 2012

Member

@thomir, it seems that (in addition to the small fix suggested by @takluyver), this PR now has a conflict with master, likelye something small that's colliding with other recently merged code. We'll have to ask you to rebase it before we can merge it, unfortunately.

Let us know if you need help with that and we'll give you a hand. Once you rebase and make that small fix I'll take care of merging it quickly so this doesn't happen again.

Member

fperez commented Apr 14, 2012

@thomir, it seems that (in addition to the small fix suggested by @takluyver), this PR now has a conflict with master, likelye something small that's colliding with other recently merged code. We'll have to ask you to rebase it before we can merge it, unfortunately.

Let us know if you need help with that and we'll give you a hand. Once you rebase and make that small fix I'll take care of merging it quickly so this doesn't happen again.

@takluyver

This comment has been minimized.

Show comment
Hide comment
@takluyver

takluyver Apr 14, 2012

Member

It may well be the whitespace changes conflicting with a change in nearby lines.

Member

takluyver commented Apr 14, 2012

It may well be the whitespace changes conflicting with a change in nearby lines.

@fperez

This comment has been minimized.

Show comment
Hide comment
@fperez

fperez Apr 14, 2012

Member

Yes, very likely, though I haven't confirmed yet by looking at the conflicts.

Member

fperez commented Apr 14, 2012

Yes, very likely, though I haven't confirmed yet by looking at the conflicts.

@thomir

This comment has been minimized.

Show comment
Hide comment
@thomir

thomir Apr 14, 2012

Contributor

Hi,

Sorry about the whitespace changes - my editor automatically strips trailing whitespace, so I didn't even notice I had done this.

I've merged trunk, and fixed the conflicts. I think I've done this correctly, although I'm using the git backend to bzr, so there's a chance it's not correct.

Thanks again for looking at this.

Contributor

thomir commented Apr 14, 2012

Hi,

Sorry about the whitespace changes - my editor automatically strips trailing whitespace, so I didn't even notice I had done this.

I've merged trunk, and fixed the conflicts. I think I've done this correctly, although I'm using the git backend to bzr, so there's a chance it's not correct.

Thanks again for looking at this.

@takluyver

View changes

IPython/core/magic.py
contents = openpy.read_py_file(arg_s, skip_encoding_cookie=True)
self.set_next_input(contents)
+>>>>>>> MERGE-SOURCE

This comment has been minimized.

@takluyver

takluyver Apr 14, 2012

Member

Nope, this merge didn't quite go right.

@takluyver

takluyver Apr 14, 2012

Member

Nope, this merge didn't quite go right.

@takluyver

This comment has been minimized.

Show comment
Hide comment
@takluyver

takluyver Apr 14, 2012

Member

The docstring change for the %gui magic seems to have gone missing after the latest merge.

Member

takluyver commented Apr 14, 2012

The docstring change for the %gui magic seems to have gone missing after the latest merge.

@thomir

This comment has been minimized.

Show comment
Hide comment
@thomir

thomir Apr 14, 2012

Contributor

OK, I figured out how to use rebase properly :)

Contributor

thomir commented Apr 14, 2012

OK, I figured out how to use rebase properly :)

@thomir

This comment has been minimized.

Show comment
Hide comment
@thomir

thomir Apr 14, 2012

Contributor

whitespace-only changes reverted.

Contributor

thomir commented Apr 14, 2012

whitespace-only changes reverted.

takluyver added a commit that referenced this pull request Apr 14, 2012

Merge pull request #1588 from thomir/gtk3-support
Add Gtk3 event loop integration and example.

@takluyver takluyver merged commit 9096723 into ipython:master Apr 14, 2012

@takluyver

This comment has been minimized.

Show comment
Hide comment
@takluyver

takluyver Apr 14, 2012

Member

@fperez already OKed the changes, so I've merged this.

Member

takluyver commented Apr 14, 2012

@fperez already OKed the changes, so I've merged this.

@fperez

This comment has been minimized.

Show comment
Hide comment
@fperez

fperez Apr 15, 2012

Member

Many thanks to all!

Member

fperez commented Apr 15, 2012

Many thanks to all!

mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014

Merge pull request #1588 from thomir/gtk3-support
Add Gtk3 event loop integration and example.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment