Change style of the widgets in GTK# - mono

Are there other methods for changing style of the widgets in GTK# like gtkrc themes? I already tried to use themes but not successfully. Pixbuf engine is the only engine which correctly rendered in my GTK# application, but when I trying to resize any widget, my UI is working slowly and freezes. So are there any other methods for changing style of the widgets in GTK# app without gtkrc?

You must using cairo library to draw new widget.
below references is useful:
http://pygtk.org/articles/cairo-pygtk-widgets/cairo-pygtk-widgets.htm
http://www.tortall.net/mu/wiki/PyGTKCairoTutorial
http://manwhocodes.blogspot.com/2013/04/drawing-with-cairo-in-pygtk.html
http://zetcode.com/gui/pygtk/
you can inherit from a gtk widget similar EventBox and change face of this and draw different face on firing different events.

Related

Can WinUI 3 be used for offscreen rendering of a xaml tree?

I would like to use the new WinUI 3 framework to render a 2D xaml tree to a DirectX texture.
Ideally, I want to be able to supply the WinUI infrastructure with my own DirectX device, context and rendering target and it will render the xaml content onto my rendering target.
I basically want to embed WinUI 3 into an existing 3D graphics engine.
From skimming through the documentation, I can see that some form of DirectX interoperability exists via CompositionGraphicsDevice class. But I haven't been able to understand if this mechanism is intended to be used in order to embed custom D3D content into an existing WinUI-based UI or the other way around.
So Can this be done? Can WinUI 3 be used for offscreen rendering of a xaml tree without creating a Window? Can you outline the steps required to do so?

Picker with two selection columns with numbers in Xamarin.Forms

I need to make a picker like this in the picture below:
What you see is a TimePicker and I took it just to give you an example. I would like to have one with about 200 numbers on the left and 100 on the right (for example). How can I do it in a Xamarin.Forms PCL project?
The first problem you'll face is that the picker control you see here is a native iOS control. The Xamarin.Forms TimePicker is basically not a physical control in itself but it translates to a native control on each platform. That's why it will look different on Android and UWP devices because they provide their own picker controls, as seen in the picture below.
Now, if you're ok with the controls looking different, you could use custom renderers to modify each native control or even replace them to provide the functionality you need. I thought I'd outline the basic steps for you to get you started:
Create a new Xamarin.Forms control called CustomPicker or something.
Create custom renderers for each platform.
On iOS, you can use the UIPickerView and specify numberOfComponents, numberOfRows and the data source.
On Android, you might want to use a 3rd party control since by default, there are no scrolling picker controls like the one on iOS. WheelPicker looks promising.
On UWP, you might be able to work something out using the PickerFlyoutBase. I have limited knowledge on the platform but you should be able to find something quite easily.
As you can see, it's going to be quite an effort to get the scroll picker working on each platform.
Edit: You could also look into native embedding, which lets you embed native controls into Xamarin.Forms app's pages.
Native Embedding
Embedding native controls into Xamarin.Forms
We've developed a two-column picker for Xamarin.Forms (Android and iOS).
Sample:
https://github.com/HorusSoftwareUY/MaterialDesignControlsPlugin#materialdoublepicker
Screenshots:
Android
iOS
We added this control to MaterialDesignControls NuGet (https://www.nuget.org/packages/Plugin.MaterialDesignControls/), where you can find other interesting controls with the material design look and feel.
Contributions are welcome!

How to Set Scrollbar theme in XAML webview?

I'm creating a windows 10 xaml app. One of the views contains a webview which fetches some html.
My problem is that although the default theme on the app is set to dark, the scrollbar in the webview is always light, which jars against the rest of the UI.
I've tried setting the RequestedTheme=dark on the webview, but no joy
Unfortunately this isn't possible since the WebView is based off of Edge and Edge doesn't currently support it, as you can see here. If Edge gets this feature, you could simply insert a STYLE into your head element to define the color.

QML Loader strange behavior

I'm having issues rendering using OpenGL with a QQuickItem.
The setup:
I've partitioned the app window into a status bar and a display area. The display area will be used to render output from various Qt plugins. I'm using the QML Loader object to dynamically load the objects from the plugins as needed.
The problem:
I've duplicated the opengl rendering with qml example. If I load it into the display area directly it works perfectly. If I load it into the display area using a Loader it displays nothing. I've logged debugging messages and it's definitely running. I've debugged the app using GDebugger and it appears to be sending OpenGL calls.
Does the loader object mess with the window context?
Any suggestions on how to get this to work?
Is source for the loader object available somewhere?
The problem was not that the custom control wasn't drawing. It was my misuse of QML.
The dynamic loader was adding the content to a 'column' control. The layout controls exhibit 'undefined behavior' if you use them incorrectly. Changing to manual layout using anchors corrected the issue.

NSOutline/NSTableView source list Lion-style icons

From the Mac OS X HIG:
As with the icons that can be used inside toolbar controls, the system applies various effects to sidebar icons. To help you understand how these effects can change the appearance of a sidebar icon, consider the Finder Home icon, shown here in its unprocessed state[...]
So I'm trying to get my NSOutlineView to render a black sidebar icon with the typical new Lion style. I'm using a view-based NSOutlineView. However, I'm unable to find anything in the docs and if I simple set the imageView.image property to the sidebar image, it renders in black. So I figure there must be some sort of opt-in mechanism to get the sidebar to render it properly. Any suggestions on how to achieve that?
Apart from using the setTemplate: method of NSImage, you can just rename your images. This is from the documentation of imageNamed:…
If an application is linked in Mac OS X v10.5 or later, images
requested using this method and whose name ends in the word “Template”
are automatically marked as template images.