mirror of
https://github.com/nmap/nmap.git
synced 2025-12-15 20:29:03 +00:00
Merge #2088: Update Zenmap to Python 3 and PyGObject
Note: Ndiff build will be broken until subsequent changes are made. Deprecation warnings will need to be addressed in future changes. Closes #2088
This commit is contained in:
@@ -57,7 +57,10 @@
|
||||
# * *
|
||||
# ***************************************************************************/
|
||||
|
||||
import gtk
|
||||
import gi
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk
|
||||
from radialnet.bestwidgets.boxes import *
|
||||
|
||||
|
||||
@@ -76,8 +79,8 @@ class BWTextView(BWScrolledWindow):
|
||||
def __create_widgets(self):
|
||||
"""
|
||||
"""
|
||||
self.__textbuffer = gtk.TextBuffer()
|
||||
self.__textview = gtk.TextView(self.__textbuffer)
|
||||
self.__textbuffer = Gtk.TextBuffer()
|
||||
self.__textview = Gtk.TextView.new_with_buffer(self.__textbuffer)
|
||||
|
||||
self.add_with_viewport(self.__textview)
|
||||
|
||||
@@ -128,7 +131,7 @@ class BWTextEditor(BWScrolledWindow):
|
||||
"""
|
||||
"""
|
||||
BWScrolledWindow.__init__(self)
|
||||
self.connect('expose_event', self.__expose)
|
||||
self.connect('draw', self.__draw)
|
||||
|
||||
self.__auto_scroll = False
|
||||
|
||||
@@ -139,12 +142,12 @@ class BWTextEditor(BWScrolledWindow):
|
||||
"""
|
||||
self.__hbox = BWHBox(spacing=6)
|
||||
|
||||
self.__textbuffer = gtk.TextBuffer()
|
||||
self.__textview = gtk.TextView(self.__textbuffer)
|
||||
self.__textbuffer = Gtk.TextBuffer()
|
||||
self.__textview = Gtk.TextView.new_with_buffer(self.__textbuffer)
|
||||
|
||||
self.__linebuffer = gtk.TextBuffer()
|
||||
self.__lineview = gtk.TextView(self.__linebuffer)
|
||||
self.__lineview.set_justification(gtk.JUSTIFY_RIGHT)
|
||||
self.__linebuffer = Gtk.TextBuffer()
|
||||
self.__lineview = Gtk.TextView.new_with_buffer(self.__linebuffer)
|
||||
self.__lineview.set_justification(Gtk.Justification.RIGHT)
|
||||
self.__lineview.set_editable(False)
|
||||
self.__lineview.set_sensitive(False)
|
||||
|
||||
@@ -153,7 +156,7 @@ class BWTextEditor(BWScrolledWindow):
|
||||
|
||||
self.add_with_viewport(self.__hbox)
|
||||
|
||||
def __expose(self, widget, event):
|
||||
def __draw(self, widget, event):
|
||||
"""
|
||||
"""
|
||||
# code to fix a gtk issue that don't show text correctly
|
||||
|
||||
Reference in New Issue
Block a user