How to change theme in GTK4.0 on windows? - gtk4

I'm new to development using GTK. I installed gtkmm4.0 on windows using mingw64, but i noticed that the applications generated follow the default theme(adwaita); however i want to change that and use the windows 10 native theme. Where is the settings.ini file located in windows 10? I have searched it in the usual places described on the web, but could not find it(even tried creating one myself),does GTK4.0 on windows have a settings.ini file at all?

It is located in any of (but you will probably need to create it yourself):
DLL prefix/share/gtk-4.0/settings.ini
DLL prefix/etc/gtk-4.0/settings.ini
C:/Documents and Settings/All Users/Application Data/gtk-4.0/settings.ini
C:/Documents and Settings/username/Local Settings/Application Data/gtk-4.0/settings.ini
You can also use the GTK_THEME environment variable.
Note that GTK no longer ships a default Windows imitation theme in GTK4 (in GTK3 it was really, really, really, bad anyway).
If you want to have a native Windows look, you will need to write your own theme.
Also, in recent versions of GTK, the default theme is not "Adwaita", but "Default"

Related

Integrating a custom launcher into the Visual Studio Debugger

We're creating a Visual Studio Debugger extension that needs to launch the application being debugged through a custom launcher that sets up the runtime (not the CLR or Win32) and launch the target application in a new process. In other words, the custom launcher is in charge of creating the new process. In the VS Debugger, one typically launches the debugger by calling VsShellUtilities.LaunchDebugger() and supplying a VsDebugTargetInfo object whose dlo field is set to DEBUG_LAUNCH_OPERATION.DLO_CreateProcess, along with the coordinates of the exe file to be launched and debugged. This doesn't conform to our launching model.
There is also a dlo value DEBUG_LAUNCH_OPERATION.DLO_Custom that seems to be for this purpose (using the clsIdCustom field to indicate the launcher), but the current documentation says that's obsolete and directs us back to DEBUG_LAUNCH_OPERATION.DLO_CreateProcess, but not only doesn't that fit our model, but clsidCustom is used in this case to indicate the debug engine (if it's just a single one).
So, what is the recommended way for us to launch the VS debugger and use our custom launcher to configure and start our runtime (and the application within it)?
According to the Visual Studio API document, it only provide the DLO_CreateProcess to Launches the process. You could use dwClsidCount and pclsidList specify the debug engines to use.
Following example introduce how to call a custom launcher through a VSIX project.
https://code.msdn.microsoft.com/Visual-Studio-Debug-Engine-c2e21c0e
I'm having difficulty porting to a Modern VS2022 but I've been using the VSIX template built of of this Extension which works for VS2017 and VS2019. after some tinkering. This does work for VS2022 but only if you don't tamper with the packages.
https://github.com/microsoft/VSProjectSystem/blob/master/doc/extensibility/IDebugLaunchProvider.md Good luck there's not a lot out there so I thought I'd offer you this gem.
This allows you to make a drop done selection for a project property sheets for debugging. you got to import the targets file which then imports the rules sheet that you create which means you got to make a wizard that creates a custom project.

How do I set a default theme for my Gtk+ application?

I'm building my Gtk+-3.0 application on Windows 7 and I want to change it's default theme. I noticed GIMP does not require the Gtk+ Runtime to be installed in order to render it's
default theme. I can't find any function that sets a given theme at runtime for my application.
Also I considered using CSS styling however that feature was introduced in Gtk+-3.X and GIMP uses Gtk+-2.X as far as I know.
So my question is:
Is it even possible to change the Gtk theme at runtime and if so what functions does the application have to call?
Gimp on Windows probably doesn't require a separate Gtk+ runtime, because it has been bundled in the installer. This means the application lugs along its own libraries and runtime files just like a lot of Windows software usually does. System integration in Windows is pretty miserable (no repositories, libraries or dependency tracking, so almost nobody shares libraries).
I suspect because of this, setting a system wide GTK theme might not be applied everywhere. You can hunt for the gtk rc files, though.
If you want to style a single application, Gtk3 should be able to load custom CSS at runtime. There is an example for Python at http://wolfvollprecht.de/blog/gtk-python-and-css-are-an-awesome-combo/. The API will be similar.

Dos.h + Pc.h in C and Windows Vista

I am currently looking to work with Mesa3D to create a software rendered graphic application with OpenGL.
I am looking a a few tutorials right now on how to use it, and many are written with DOS or older versions of Windows in mind. As I run Vista I don't seem to have the right files I need.
The Mesa3D tutorial I am using uses outportb() and a few other commands which I can't seem to get working. After looking around I have found you require the 2 include files:
dos.h
pc.h
These do not seem to be found within the Window's SDK that comes with Visual Studio 2010 (Express) or even the older version of 2005 (Professional) which I currently have.
They seem to be found with the DJGPP compiler that only works under DOS and is not supported in Vista, even with compatability mode. Running DosBox still does not get this to work.
I am wondering - is there perhaps a new functions replacing outportb or can I use these DJGPP files with my C/C++ complier with VS or PellesC (which I find better for C-only programs)?
In addition the conio.h include file I have with both VS and PellesC doesn't have the textmode() function, but the DJGPP version does.
If anyone could help either getting DJGPP working on Vista or allowing me to use the dos,pc and conio.h files from DJGPP with either VS or PellesC that'd be a great help!
Port-manipulating functions will simply not work in Win32 programs. Either use Win32 APIs to do I/O (rendering included) or stick to DOS and run your program in DOS or whatever DOS emulator you can find that works. Vista and later Windows won't run most DOS programs directly as the support for DOS is either severely reduced or removed altogether (e.g. in 64-bit Windows).
The low-level hardware access that functions like outportb give you is not available to programs in modern Windows environments. Such capabilities are reserved for specially-trusted code (OS internals and drivers). You need to go through higher-level APIs or drivers in order to access the same functionality.
The Mesa3D website has a readme for Windows developers that has information about what you need to install and configure. It also references some official demo code that you can use as the basis for your project. The Mesa3D website also has a repository full of demo programs that will probably serve as better examples than the out-of-date tutorials that you mentioned.
Do not use 16bit compilers on vista and higher.. instead use DOSBOX to run your programs.

MVVMCross how to use with WPF (Windows)?

How can I use it on WinRT (Windows 8) - I can't compile it. Can I use it also with "normal" Windows (WPF)?
There isn't currently an mvvmcross port specifically for wpf - a couple of people have suggested building one, but the majority of users have so far requested more work on mobile platforms instead. There is a current console (win32) port and extending that towards WPF should be quite straight-forward.
Future development is now based around the Portable Library branch - see some info on http://slodge.blogspot.co.uk/2012/09/mvvmcross-vnext-portable-class.html and the code on https://github.com/slodge/MvvmCross/tree/vnext
For WinRT, the TwitterSearch example within the vNext branch is a good place to start - it should compile and work across all of MonoTouch, MonoDroid, WP7, WinRT and Console:
If you find you can't compile then please log specific compiler error messages either here or to github issues.
MvvmCrossLibs\MvvmCrossLibs.sln consists of many projects, requiring different runtimes to be installed to open properly (Mono Touch, Mono Droid, WP7). If you only need the library in WinRT, your best bet is to open Cirrious\Cirrious.MvvmCross\Cirrious.MvvmCross.WinRT.csproj directly and add the missing Newtonsoft.JSON package with NuGet (you'll need to save the automatically created .sln file before that). It should compile just fine after that, at keast it did for me. Now just reference the assembly in your Windows Store app project and start using it.
I don't have any previous experience with MVVMCross, but it doesn't look like it currently supports despktop WPF apps. I don't know how difficult it would be to create/compile such a version, though.

VS create winforms apps only with x86 configuration, why?

I have VS.NET 10.0.40219.1 SP1 in 2 computers and when I create a new C# Winform app only do it with Properties/Build/Platform x86, and the target let me choose AnyCpu/x64, but can't set it in the configuration (however, libraries work fine).
If I try to change it in the project file manually, I get a lot of nasty errors. Is this normal behavior, a bug or a problem in my installation?
P.D: When I change manually the project, this happend:
Warning 1 The OutputPath property is not set for project '*.csproj'.
Please check to make sure that you have specified a valid combination
of Configuration and Platform for this project. Configuration='Debug'
Platform='x86'. This error may also appear if some other project is
trying to follow a project-to-project reference to this project, this
project has been unloaded or is not included in the solution, and the
referencing project does not build using the same or an equivalent
Configuration or
Platform. c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets
When I reopen the project, ALL the references become invalid
It is normal for Visual Studio to create WinForms projects with just an x86 platform. I have no idea if that's because historically x86 was the only platform type or because x86 is the most commonly used value or for some other reason.
It's also normal to have problems when the project file is manually modified, try to avoid doing that where possible.
To create another platform configuration in a C# project
Select Build | Configuration manager
Select <New...> in the Active Solution Platform field
Select the new type you want
Click on OK
Visual Studio used to create AnyCPU apps by default. I think both VS2005 and VS2008 did this, though they may have changed it for VS2008. Here's what happened: a lot of AnyCPU apps ended up broken on 64-bit systems, because they were built with dependencies on 32-bit libraries. If you tried to run an AnyCPU app that had a 32bit dependancy on a 64bit system, you got a 64bit process that would crash as soon as it tried to load your 32bit dll.
To fix this, the default was changed to use the x86 option. If you want to use AnyCPU, you must now setup the environment for it.

Resources