I am using the wx.html.HtmlWindow widget for the first time. I’m a novice with HTML(5) as well.
I have a problem with scaling the webpage to fit within the initial size of the html widget.
I have a frame with several panels. The frame is about 1/3 the screen size by default, although it can expand. One panel has a vanilla wx.html.HtmlWindow widget as it’s only control. This panel takes about 1/3 of the frame’s default size. The other panels stay basically the same size when the frame expands; ie primarily the WebNews panel expands. The html window shows a small webpage (by design) of news. However this webpage my not be exactly 300 by 300 pixels on any give day. It might vary by ± 5% in size on either axis. Exact aspect ratio of the webpage is of little concern. All is good so far.
The problem I have is knowing how to scale the webpage to scale up or down to fit within the wx.html.HtmlWindow’s initial size of 300 x 300. I’d like to see no border, margin or outline around the mini-webpage.
With news = wx.html.HtmlWindow(self, size=(300,300)) additionally I need to use new.SetBorders(0). However this only removes the top and left borders from around the webpage content. There is some kind of margin, border, outline or something that allows the left and bottom parts of the underlying panel to be seen. I’d like to have the webpage take up the entire panels size. This could be some HTML tag default behavior for all I know.
As a simple test case I am using the following HTML:
Although adding width and height attributes to the tag scales the image; it’s the tag that I’d like to scale; for when there is more then just an image. I’ve tried the width and height attributes in the tag; I believe they are not support by wx.html module.
I’ve been having a hard time finding and or understanding information on the Internet what the methods of wx.html.HtmlWindow do. Like when does a method effect the widget and when does it effect the webpage content or how it’s displayed.
Does the wx.html module allow for scaling of an entire webpage?