gtk#

In Gtk, is it possible to make widgets fade in and out?

▼魔方 西西 提交于 2019-12-06 11:53:12
I would like to have a Label (or at least the text on the label) do a quick fade-in. It looks like this is possible in clutter , but I don't want to use clutter until clutter-sharp is packaged for Ubuntu. Is there any way to do this that doesn't involve using clutter? Emmanuele Bassi you can use gtk_widget_get_snapshot() and then fade out the GdkPixmap it returns using cairo I've never seen it in any of the more common GTK themes, but Google Chrome's new theme does this, and it uses GTK. So, I'm going to say yes, but not many use it. 来源: https://stackoverflow.com/questions/2827639/in-gtk-is-it

How do I cut, copy, paste and select all in a TextView control?

久未见 提交于 2019-12-06 05:55:55
问题 I'm trying to cut, copy, paste and select all with the TextView Gtk control. Why the TextView control? Cause I can't seem to get the bloody TextEditor control to go multiline! Anyway... How do I: Cut text from the TextView control? Copy text from the TextView control? Paste text into the TextView control? Select All text in the TextView control? Here's what I've tried: 1 hour of googling. and this: TextView tv = ...; TextIter start, end; if (tv.Buffer.GetSelectionBounds(start, end)) { String

How to change gtk theme in GTK# on Windows?

时间秒杀一切 提交于 2019-12-06 05:39:05
I need to change GUI theme in GTK#. I tried something, but it is still far from ideal. Here is my code: string Resource_File = "Black-Diamond\\gtk-2.0\\gtkrc"; Application.Init (); if (System.IO.File.Exists (Resource_File)) { Gtk.Rc.AddDefaultFile (Resource_File); Gtk.Rc.Parse (Resource_File); } else { ; } MainWindow win = new MainWindow (); win.Show (); Application.Run (); Output: That's ok, but not what I expected(some elements don't look like in original theme ). Can you tell me how I can change GUI theme in GTK# on windows? Thanks! 来源: https://stackoverflow.com/questions/26349493/how-to

GTK# .NET Application without requiring separate GTK# Install

谁都会走 提交于 2019-12-05 09:38:41
I was playing around with developing C# apps using MonoDevelop on windows and found that I like using GTK# instead of winforms. However, as far as I could tell so far you cannot just embed the GTK# runtime into the application. The problem is that I would rather not have to require the end users of an app I'm working on to having to install GTK# separately... this is fine for geeks like me, but the app would be for non-geek users and I want the install to pretty much be a one click operation. Any ideas? The "easy" way is to embed the Gtk# installer into your application's installer. The harder

Newbie Question: GTK# (Mono) on OSX

落爺英雄遲暮 提交于 2019-12-05 03:11:25
I am taking my first steps (or perhaps my last steps) in GTK# on Mono for OSX. I write a .cs file and then try to compile with mono: gmcs -pkg:gtk-sharp-2.0 one.cs this results in this message error CS8027: Couldn't run pkg-config: ApplicationName='pkg-config', CommandLine='--libs gtk-sharp-2.0', CurrentDirectory='' Which would, apparently, require me to know what I'm doing. I do know that Mono's Installer for MacOS X comes with Gtk+ and Gtk# so you can start building and running cross-platform GUI Gtk# applications that include OSX." So there's nothing to install. I do find GTK2 here /opt

How To Print Image with GTKSharp

不羁岁月 提交于 2019-12-04 16:51:57
I'm porting an C# .NET application to Mono .NET for executing in OSX. Part of the application involves printing an image. Fairly easy in .NET and boils down to primarily e.Graphics.DrawImage(img, new Rectangle(x, y, printSize.Width, printSize.Height)); in the PrintDocument's PrintPage event. Mono does not have a full implementation of System.Drawing.Printing so it seems that the best way to go about doing this is using GtkSharp. I've found some examples online as to how to print text using a Gtk.PrintOperation. PrintOperation has an event DrawPage which should be similar to PrintPage, however

How to load a GTK Sharp theme on MS Windows

这一生的挚爱 提交于 2019-12-04 13:51:04
I'm programming a GTK Sharp (v2.12) application using Xamarin Studio 5.4 on MS Windows. The installed Mono version is 3.2.3 (but I'm using the .Net tool chain to compile, because Xamarin doesn't allow me to compile using the Mono toolchain). The case is that when I run the application from the Xamarin Studio or using Mono, then I have a relatively nice look & feel, but when I run the application using .Net (doing double click on the executable) then the look & feel is horrible. I've tried to trick the application to load a decent theme... but it does nothing when I do it from .Net (but when I

How to call JavaScript from Mono's WebKitSharp?

故事扮演 提交于 2019-12-03 17:37:43
I tried this code. All works, but I can't find a way to reach the DOM or to call JavaScript from it. Any ideas how to do that? This is using GTK# and WebKitSharp. EDIT: Also I need to get the result. webView.ExecuteScript("alert('An alert from C#!');"); will do the trick. Getting the results back is another challange though: WebKit.DOMDocument is not implemented in webkit-sharp, so you can't access the DOM. There are a few workarounds, this is what we normally do: Have a invisible frame somwhere in your page Get the WebFrame for it via webView.MainFrame.FindFrame("framename") in your JS write

Lazy loaded list view in GTK#

此生再无相见时 提交于 2019-12-03 16:48:26
问题 I'm looking to display a large dataset via a list view in GTK# and performance is an issue here. I'm currently using a TreeView backed with a ListStore, but adding all my data to the ListStore takes forever. Is there a list view widget of some sort in GTK that supports lazy loading of data? In Winforms, you can use the VirtualMode property of DataGridView to handle this, but I don't see anything of the sort for GTK. 回答1: There, as far as I am aware, no widget to do what you want in Gtk,

Lazy loaded list view in GTK#

梦想与她 提交于 2019-12-03 05:05:57
I'm looking to display a large dataset via a list view in GTK# and performance is an issue here. I'm currently using a TreeView backed with a ListStore, but adding all my data to the ListStore takes forever. Is there a list view widget of some sort in GTK that supports lazy loading of data? In Winforms, you can use the VirtualMode property of DataGridView to handle this, but I don't see anything of the sort for GTK. James Hurford There, as far as I am aware, no widget to do what you want in Gtk, however, you can do something similar, in the end result, to the VirtualMode property, in the