[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyKDE] Trying to use KHTMLPart
From:       Joseph Rawson <umeboshi () gregscomputerservice ! com>
Date:       2007-01-24 18:17:52
Message-ID: 200701241218.00603.umeboshi () gregscomputerservice ! com
[Download RAW message or body]

[Attachment #2 (multipart/signed)]

[Attachment #4 (multipart/mixed)]


I've just recently started using a KHTMLPart rather than a KTextBrowser to 
display information.  In both cases, I've been using simple HTML to display 
the data in tables, and provide anchors for actions in the application.

I have noticed a couple of things that I haven't been able to figure out about 
both widgets, involving the <img> tags.  In the underlying documents, there 
is a screenshot image that is to be displayed, called title.png, using a tag 
similar to this - <img src="/path/to/title.png">.  When a new screenshot is 
selected to be the title, the title.png file is overwritten.  Neither the 
textbroser or kpart will display the changed image.  The textbrowser will, if 
I first tell it to setText('') then setText(doc), but I can't figure out what 
to do about the KHTMLPart.  I have tried to load a blank document, then 
reload with the real document, but that doesn't work.

I have made a little test script displaying this, that is attached.  This 
script uses the 16x16 filenew.png and fileopen.png files, that I am not 
attaching.  They should be placed in the same directory as the script.  You 
may also want to copy one of them to "title.png".  Any two different 16x16 
png's will work, you only have to change the code or the filenames.  The 
script displays both the KTextBrowser and the KHTMLPart side by side, but 
they don't keep track of each other.  They are simply there to help display 
what is going on in my application.  Both use the same document text and 
should be displaying what the current "title.png" is. --- I just changed the 
code a little, so both document viewers are on the same page now ---  The 
problem is easily visible when you click "Change Image" on the KPart side.


-- 
Joseph Rawson

["textbrowser_image.py" (application/x-python)]
[Attachment #8 (application/pgp-signature)]

_______________________________________________
PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic