Ich arbeite an einem Lagerverwaltungssystem für meine Eltern, und da habe ich ein Problem mit dem wxHtmlWindow.
Ich habe eine neue Klasse basierend auf der alten gemacht:
Code: Alles auswählen
# -*- coding: cp1252 -*-
# ---------------------------------------------------------------------------- #
# SmartStorageManager HTML Fenster #
# Version for Linux, Windows and MacOS #
# #
# Code by Armin Ronacher <armin.ronacher@active-4.com> #
# (c) Copyright 2004 by Active-4 Software Developement #
# http://www.active-4.com #
# ---------------------------------------------------------------------------- #
from wxPython.wx import *
from wxPython.html import *
import wxPython.lib.wxpTag
from ssm import *
class dlg_html(wxHtmlWindow):
def __init__(self, parent, id):
mainframe.__Action = ""
wxHtmlWindow.__init__(self, parent, id, style=wxNO_FULL_REPAINT_ON_RESIZE)
lc = wxLayoutConstraints()
lc.top.SameAs(parent, wxTop, 0)
lc.left.SameAs(parent, wxLeft, 0)
lc.right.SameAs(parent, wxRight, 0)
lc.bottom.SameAs(parent, wxBottom, 0)
self.SetConstraints(lc)
def OnLinkClicked(self, linkinfo):
print "User want's to view "+linkinfo.GetHref()
if (linkinfo.GetHref() == "ssm:login"):
mainframe.showMessage("Das ist ein Test") #Fehler!
Ich habe es auch schon mit
Code: Alles auswählen
parent.showMessage("Das ist ein Test")
Wie kann ich erreichen, dass diese Klasse eine Methode einer anderen Aufruft?
Ach Ja. Nochwas.
Ich erstelle dieses HtmlWindow mit:
Code: Alles auswählen
#Übersichts Seite
self.nb_index = wxPanel(self, -1, style=0)
self.notebook.AddPage(self.nb_index, "Übersicht")
self.nb_index.SetAutoLayout(true)
self.nb_index_html = dlg_html(self.nb_index, -1)
self.nb_index_html.LoadPage('frames/index.html')
Vielleicht kann mir einer helfen.