Menu

#4 SelectValue window always in "wrong" place

open-accepted
None
5
2006-01-30
2006-01-24
No

I have a patch to put the SelectValue window at the
location of the right click. You may wish to modify it
slightly but its better than what you currently have.
Otherwise, great program. I use it a lot! :-)

diff -u pythonsudoku-0.11/gui.py
pythonsudoku-0.11-modified/gui.py
--- pythonsudoku-0.11/gui.py 2005-12-01
12:48:32.000000000 -0700
+++ pythonsudoku-0.11-modified/gui.py 2006-01-24
12:51:12.698118927 -0700
@@ -209,7 +209,7 @@
class SelectValue(object):
__slots__ = ["sudoku", "j", "i", "window"]

- def __init__(self, sudoku, j, i):
+ def __init__(self, sudoku, j, i, x, y):
self.sudoku = sudoku
self.j = j
self.i = i
@@ -217,6 +217,8 @@
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.window.set_title(_("Select a number"))
self.window.connect("delete_event",
self.delete_event)
+ windowX, windowY = sudoku.window.get_position()
+ self.window.move(int(windowX + x), int(windowY
+ y))
self.window.show()

numbers = gtk.Table(self.sudoku.cellsize[0],
self.sudoku.cellsize[1],
@@ -365,7 +367,7 @@
# outside board regions
if i >= self.sudoku.boardsize or j >=
self.sudoku.boardsize:
return
- SelectValue(self.sudoku, j, i)
+ SelectValue(self.sudoku, j, i, event.x, event.y)

def widget(self):
return self.view

Discussion

  • Xosé Otero

    Xosé Otero - 2006-01-30
    • assigned_to: nobody --> xoseotero
    • status: open --> open-accepted
     
  • Xosé Otero

    Xosé Otero - 2006-01-30

    Logged In: YES
    user_id=684913

    Thank you Anthony for the patch.

    I have to modify it, because this code don't move all the
    windows. I'll add it to the CVS soon.
    In the future I'll try to do a better interface, the
    current version was my first contact with GTK.

     
  • Anthony Tuininga

    Logged In: YES
    user_id=619560

    You're welcome. I'm not surprised that you had to modify it.
    I only took a quick peek at the code and my patch was a
    quick hack. Any idea on when this will be released?

     
  • Xosé Otero

    Xosé Otero - 2006-01-31

    Logged In: YES
    user_id=684913

    I don't know.
    The next week I have exams. I want to use the following
    week in finish the work made in CVS and release 0.12. And
    then start working in this (and some strange ideas :)).

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.