1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-08 05:31:31 +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:
dmiller
2022-12-07 20:34:03 +00:00
parent e2e55660c3
commit 24b26317c7
104 changed files with 5381 additions and 4383 deletions

View File

@@ -1,5 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#!/usr/bin/env python3
# ***********************IMPORTANT NMAP LICENSE TERMS************************
# * *
@@ -66,18 +65,21 @@ higwidgets/higframe.py
__all__ = ['HIGFrame']
import gtk
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
class HIGFrame(gtk.Frame):
class HIGFrame(Gtk.Frame):
"""
Frame without border with bold label.
"""
def __init__(self, label=None):
gtk.Frame.__init__(self)
Gtk.Frame.__init__(self)
self.set_shadow_type(gtk.SHADOW_NONE)
self._flabel = gtk.Label()
self.set_shadow_type(Gtk.ShadowType.NONE)
self._flabel = Gtk.Label()
self._set_label(label)
self.set_label_widget(self._flabel)
@@ -86,20 +88,20 @@ class HIGFrame(gtk.Frame):
# Demo
if __name__ == "__main__":
w = gtk.Window()
w = Gtk.Window()
hframe = HIGFrame("Sample HIGFrame")
aalign = gtk.Alignment(0, 0, 0, 0)
aalign = Gtk.Alignment.new(0, 0, 0, 0)
aalign.set_padding(12, 0, 24, 0)
abox = gtk.VBox()
abox = Gtk.Box.new(Gtk.Orientation.VERTICAL, 0)
aalign.add(abox)
hframe.add(aalign)
w.add(hframe)
for i in xrange(5):
abox.pack_start(gtk.Label("Sample %d" % i), False, False, 3)
for i in range(5):
abox.pack_start(Gtk.Label.new("Sample %d" % i), False, False, 3)
w.connect('destroy', lambda d: gtk.main_quit())
w.connect('destroy', lambda d: Gtk.main_quit())
w.show_all()
gtk.main()
Gtk.main()