How to make height of Gtk.StatusBar smaller in PyGObject (GTK+3)? - python

Standart StatusBar image
<-- So, here it how it looks in my application now. How can I make the height of it smaller? For e.g. in Google Chrome when you pointing some link it shows in the grey bar at the bottom of the page, I want same size.

Chrome is not using a GtkStatusBar (or any other GTK widgets, for that matter).
If you want to change the appearance of a GTK widgets, you'll have to either tweak the theme or use a custom widget, with your own sizing policy.

Related

Equivalent of browser debugger's Box Model Inspector in kivy

What is the equivalent to the browser's "Box Model" Layout Inspector in the browser debugger, but for kivy?
I come from a background of web development, where "UI" debugging is done in a browser. Probably because of widespread rendering issues (w3c standards ambiguity or implementation errors in web browsers), the tools for debugging "why did my HTML render like that!?!" are quite sophisticated in web browsers.
I can simply press F12 in Firefox (also now Chromium) to open a debugging window, click on the top-left-most button (the element picker), then as I drag my mouse across the page, every distinct element (as well as a tree of breadcrumbs to the given child element) is highlighted.
If I click on a given UI element, then the html element cooresponding to the UI element is highlighted, all CSS elements are also shown, as well as a "Box Model" in the Layout tab that shows me clearly the width, height, margin, padding, and border of the element. This "Box Model" is so extremely helpful to figure out, tweak, and fix UI rendering issues when designing web pages.
Enter UI development with kivy, it takes me days instead of minutes to figure out what's going on because I don't know of a similar tool.
I want a way to be able to wrap a given kivy app with some debugger such that, as I hover over widgets in my kivy app, the full tree (breadcrums) of that tree is shown in real-time as I move my mouse across the screen. And if I click somewhere in the app, it dumps for me all of the properties of that widget, such as width, height, spacing, padding, etc (actually just enumerating the entire __dict__ of the given widget object). And, ideally, a visual representation of that widget and its sizing is displayed, like the "Box Model" screenshot above.
What's the best equivalent in kivy development for the web browser's debugger and "Box Model"?

Does kivy have the capability to create a scrollable grid of menus with text and icons, as in the image below, if yes, how?

I want to create a dictionary, like the one in the image, where I can translate English to my native language. I have achieved the navigation drawer, but the challenge is how to create a scrollable home screen menu, as in the image. Pls, any idea how I can go about it?

How to adapt the height of a wx.html2.WebView to its contents?

I'm trying to make a wx.html2.WebView high enough that its contents don't need to be scrolled.
I tried using javascript in RunScript to detect that document height is larger than window height, but it won't work on some backends, for which RunScript does not return results.
Can I detect scrollbars on the WebView from Python to adapt the height ? Is there another way ?
I found a hack that works : I inject javascript that on document load navigates to "size:"+document.body.scrollHeight
Then, I bind to the event EVT_WEBVIEW_NAVIGATING, veto it and use the URL from the event to get the height and set the WebView height to it.

How to change Kivy dropdown width

I have a kivy dropdown menu and I can't get the width of the button to change. Does anyone know how to do this? I attached a photo of what the button looks like.
Here is the line where i add buttons:
self.drop_down.add_widget(Button(text=address, auto_width=False, size_hint=(None,None), height=self.height/15, width=self.width/2))
In the kv file dropdown class is empty but i have played around with various layouts to try to change the width but nothing i try works.
Changing the values for width seem to only change the label width where the text will move around on the button but the button itself wont change. The Widget is suppose to size itself to the parent width but that is not happening either. I found the value attach_to where my understanding is that i can specify what parent widget to hook to. Yet that didnt seem to change anything.
A normal dropdown list is different from a actiondropdown list and you modify the width in different ways. The way stated above is for a dropdown where you use auto_width set to False and then set width. But with an actiondropdown you use dropdown_width to modify the width.

wxPython: Highlight item in GidSizer upon mouse click

I have a Panel with a bunch of pictures placed on it in a GridSizer layout. How can I draw a highlighted color around the edge of an image or its border to show that it has been selected upon a mouse click event?
Take a look at the Widget Inspection Tool's code. It can highlight any widget. On my machine, it's in the "_InspectionHighlighter" class in the inspection.py file, which is here: C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\lib
You can read about the tool here: http://wiki.wxpython.org/Widget%20Inspection%20Tool
You could put each picture in a panel, and use SetBackgroundColour()to set the background color of the panel.

Categories

Resources