gtk#

GUI building with GTK#

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 19:34:14
问题 I may need to build a GTK GUI using C# and Mono. If I understand correctly, that means I have 3 choices: Write the C# code to call the GTK# wrapper classes. GUI is "in the code". Use MonoDevelop GUI designer. This builds an interface using the stetic markup. I appears to just be XML. Use Glade and libglade to create the GUI and load it at runtime. I have a little experience with MonoDevelop's GUI editor. It's nice, but has a few rough edges. I can imagine needing to hand edit the stetic

Gtk Application Non-Consistant Execution using Xamarin Theme

不羁的心 提交于 2019-12-10 18:25:52
问题 I have a mkbundled mono app with mono embedded in it.i have created a standalone package from it using platypus.I use the following to load the Mac Theme(Xamarin) Gtk.Rc.Parse ("Default/gtkrc"); The theme is the Xamarin theme from share/theme/xamarin The thing is that the application does not launch consitantly when using this theme.It launches randomly.Also im using gtk-button-images = 1 in theme file to show the buttons.The app works fine with other themes. What is the problem here?please

Accessing System.Drawing.Bitmap from GTK# Thread throws Object Currently in use elsewhere exception

自作多情 提交于 2019-12-10 13:25:12
问题 Im trying to manipulate an image using system.drawing in GTk#.I want the UI to update the image on screen as soon as the user updates a textbox.To implement this i tried using the background worker from winforms,it worked but when the textbox is updated at a higher speed the application becomes stuck with no error. So i took a look at multithreading in GTK here http://www.mono-project.com/docs/gui/gtksharp/responsive-applications/ and created a thread . void textboxchanged() { Thread thr =

How do I get the item (tree node) under the mouse pointer in a TreeView?

☆樱花仙子☆ 提交于 2019-12-10 12:13:58
问题 In a GTK/GTK# TreeView , how do I get the item/node which the mouse pointer is currently hovering over? 回答1: Let's say we want to select items using the right mouse button without using checkboxes. The following ButtonPress event handler does just that - it toggles the selected property of the item we have clicked with the RMB. We then use CellDataFunc s to highlight the selected items. tv is the TreeView, store is the underlying ListStore. [GLib.ConnectBefore] void

How to change gtk theme in GTK# on Windows?

寵の児 提交于 2019-12-10 10:58:53
问题 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

GTK C# Widget Change Color Not working

时光怂恿深爱的人放手 提交于 2019-12-10 10:28:16
问题 Im trying to change the color of button widget in GTK# by using button1.ModifyBase(Statetype.Normal,new Gdk.Color(1,1,1)); This is called from another button click event,but the widget color is not updated why is this? 回答1: Instead of the 'flaky' ModifyBase, you can just use the ModifyBG method, same params are passed. button1.ModifyBG(Statetype.Normal,new Gdk.Color(1,1,1)); BTW, I say flaky since you are dealing with GTK2.x under Mono GTK# and there are tons of issues on both sides when it

GTK# Image Buttons not showing Images when Running

泄露秘密 提交于 2019-12-08 15:50:00
问题 Im trying to use Image Buttons in GTK# (Xamarin Studio).I set the Image to the button and in the UI Builder the Image is coming up. But when i run the program there is no image in the button I tried this in Different versions of the IDE and on different platforms(Mac and Windows) Please help Update: MainWindow.cs using System; using Gtk; public partial class MainWindow: Gtk.Window { public MainWindow () : base (Gtk.WindowType.Toplevel) { Build (); } protected void OnDeleteEvent (object sender

How to Right Align Numbers in GTK# Spin Button?

淺唱寂寞╮ 提交于 2019-12-08 09:43:22
问题 Can anyone tell me how to right align the numbers in a GTK# spinbutton control? I can't for the life of my figure out how it works there. The documentation is sparse, and I'm just drawing a blank after numerous attempts. Thanks in advance for any responses. 回答1: It's a subclass of Gtk.Entry - you should just be able to set the Xalign property to false. 来源: https://stackoverflow.com/questions/11284994/how-to-right-align-numbers-in-gtk-spin-button

Is there a Form.Showdialog equivalent for Gtk# Windows?

好久不见. 提交于 2019-12-07 19:44:49
问题 Using Windows Forms or WPF I can open a dialog window by calling ShowDialog. How can I do that using Gtk#? I tried just making the Window modal, but although it prevents the user from interacting with the calling window it does not wait for the user to close the dialog before running the code after ShowAll(). 回答1: Instead of using a Gtk.Window, use Gtk.Dialog, then call dialog.Run (). This returns an integer value corresponding to the ID of the button the user used to close the dialog. e.g.

Compile Gtk# 2.99.3 in Cygwin unknown types uid_t and pid_t

牧云@^-^@ 提交于 2019-12-07 15:39:53
问题 After compiling last version of mono in Cygwin64 (last version) I compiled some C# tests with the mono c# compiler (msc) I want to make some tests with Gtk so I downloaded the source code and try to compile... after solving some minor issues that were constantly stopping the compilation I become stuck with the error of 2 unknown types: uid_t pid_t the errors are: /usr/include/glib-2.0/gio/gcredentials.h:75:1: error: unknown type name 'uid_t' /usr/include/glib-2.0/gio/gcredentials.h:79:52: