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.
Related
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"
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.
Are there any pre-built GUI toolkits that exist as a C DLL?
So i can simply import a static library and start using GUI commands to build an application written in C? Also so i can redistribute the dll with my application.
EDIT: Preferably with no dependencies or that they too are dlls.
IUP comes in pre-built packages. Scroll down to read which version you should get depending on which dependencies you want or which compiler you're using.
Note that your preference to have no dependencies is almost impossible considering that most toolkits will link against some msvcr***.dll, IDE-specific libs, or other lower-level open-source libs.
Realistically though, you should probably just pick your favourite toolkit and then compile it yourself along with all the dependencies, put them all into a folder, and that folder is what you link against to use the toolkit. Once you do that initial compilation it'll be just as easy to use as a precompiled one. Another advantage of compiling it yourself is you can pick which extras or extensions you wish to bundle in and which you won't need, which optimises the output filesize.
You mean like GTK+?
I am new to MonoDroid so maybe there is an easy answer, but so far searching hasn't turned it up... Since deploying to the Android emulator takes _for_ever_ on my PC, I would like to put most of my logic into a separate library and test it from a separate winforms application. Later, I can build a regular MonoAndroid application that provides the UI and just calls the library. However, when I try to link to the MonoAndroid class library I get this message:
Warning 1 The project 'MonoAndroidClassLibrary1' cannot be referenced. The referenced project is targeted to a different framework family (MonoAndroid)
Is there another way to achieve this objective? Yes, I could simply create a separate standard windows library and copy/paste the code between the two, but there must be a better way
You can use this extension http://msdn.microsoft.com/en-us/library/ff921108%28v=pandp.20%29.aspx
You would need to create a regular .Net 2.0/3.5/4.0/etc class library and copy (or link) your source code files into it. Use this assembly for testing in winforms, and the Android class library copy for Android.
Of course, this will only allow you to write code that doesn't reference anything in the Mono.Android.dll assembly.
Is it possible to create a small library (similar to a Flash or Flex SWC component) that can be used in Silverlight apps?
Since I'm a Flash and Flex developer, I'll relate it. In Flex, if I have a SWC I can add it to my build path and then immediately use its included classes and functions in my project. Similarly, in Flash if I add a SWC to the Components folder then drag that SWC into my library, I can use the classes in my Flash project.
Does Silverlight have a similar concept? I just need a small code library that I can send to other developers, but it should be pre-compiled so the source is not readily available.
Thanks!
You should not have an issue pre-compiling the "Silverlight Class Library" project type in Visual Studio like you would traditional C# libraries, and release these to developers who can reference them in their Silverlight applications.