From adam at morrison-ind.com Thu May 1 08:30:55 2008 From: adam at morrison-ind.com (Adam Tauno Williams) Date: Thu, 01 May 2008 08:30:55 -0400 Subject: [Gtk-sharp-list] GLADE or not GLADE???. gtk on rails In-Reply-To: References: <4818EE7B.60500@opengeomap.org> Message-ID: <1209645055.4921.1.camel@WM_ADAM1.morrison.iserv.net> > > We have a insteresting discusion about use libglade or not. In OOP > > languajes like c++, c# or ruby it?s important find other methos to build > > GUIs: > > http://www.ruby-forum.com/topic/150564#668485 > > http://wiki.inkscape.org/wiki/index.php/GtkMMificatio > Have you used Stetic, the GTK# designer that is integrated into MD? It > generates code so that you can use the stetic-created widgets directly > from code, and it also consumes GTK# widgets written in C#. Ditto, Stetic is very nice and a real improvement over Glade. From bratsche at gnome.org Thu May 1 12:05:11 2008 From: bratsche at gnome.org (Cody Russell) Date: Thu, 01 May 2008 11:05:11 -0500 Subject: [Gtk-sharp-list] Make Run() of a Dialog return imediately In-Reply-To: <64574.195.64.3.50.1209564796.squirrel@fsmat.at> References: <64574.195.64.3.50.1209564796.squirrel@fsmat.at> Message-ID: <1209657911.30799.10.camel@prometheus> On Wed, 2008-04-30 at 16:13 +0200, Mathias Tausig wrote: > > What I would like to do is to display some sort of Dialog on the > screen > the displays a status message (like "Please wait"), then do some stuff > and > destroy the Dialog afterwards. The ideal soulution from my perspective > would be somethin like > > Dialog d= new Dialog(...); > d.Run(); > foo(); > d.Destroy(); > > The problem is, that I am not able to make Run() return imediately. > The > only soultion I see is via threading,which is alwas a hassle with > gtk#. > Are there any better ways of displaying a Dialog on the screen ehile > leaving the control with the program? You could use a timeout.. Dialog d = new Dialog (); GLib.Timeout.Add (10, new GLib.TimeoutHandler (foo)); d.Run (); From jaebird at gmail.com Thu May 1 18:43:46 2008 From: jaebird at gmail.com (Jae Stutzman) Date: Thu, 1 May 2008 17:43:46 -0500 Subject: [Gtk-sharp-list] GLADE or not GLADE???. gtk on rails In-Reply-To: <1209645055.4921.1.camel@WM_ADAM1.morrison.iserv.net> References: <4818EE7B.60500@opengeomap.org> <1209645055.4921.1.camel@WM_ADAM1.morrison.iserv.net> Message-ID: What about on Win32? It looks like MonoDevelop will compile by jumping through some hoops, but is there a standalone stetic for windows that uses the same xml schema? are the schemas compatible? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080501/ff1e08d5/attachment.html From adam at morrison-ind.com Fri May 2 09:18:16 2008 From: adam at morrison-ind.com (Adam Tauno Williams) Date: Fri, 02 May 2008 09:18:16 -0400 Subject: [Gtk-sharp-list] GLADE or not GLADE???. gtk on rails In-Reply-To: References: <4818EE7B.60500@opengeomap.org> <1209645055.4921.1.camel@WM_ADAM1.morrison.iserv.net> Message-ID: <1209734296.6398.0.camel@WM_ADAM1.morrison.iserv.net> On Thu, 2008-05-01 at 17:43 -0500, Jae Stutzman wrote: > What about on Win32? It looks like MonoDevelop will compile by jumping > through some hoops, but is there a standalone stetic for windows that > uses the same xml schema? are the schemas compatible? I don't think there is a standalone Stetic. But Stetic apps *run* on Win32 just fine. -- Consonance: an Open Source .NET OpenGroupware client. Contact:awilliam at whitemiceconsulting.com http://freshmeat.net/projects/consonance/ From jaebird at gmail.com Fri May 2 09:24:04 2008 From: jaebird at gmail.com (Jae Stutzman) Date: Fri, 2 May 2008 08:24:04 -0500 Subject: [Gtk-sharp-list] GLADE or not GLADE???. gtk on rails In-Reply-To: <1209734296.6398.0.camel@WM_ADAM1.morrison.iserv.net> References: <4818EE7B.60500@opengeomap.org> <1209645055.4921.1.camel@WM_ADAM1.morrison.iserv.net> <1209734296.6398.0.camel@WM_ADAM1.morrison.iserv.net> Message-ID: Yeah, I've got a prototype using the MonoDevelop.Dock library running in Win32 and Ubuntu 8.04. It uses a 3rd party c++ library that we used SWIG to generate wrappers for (on both Win32 and Linux). Overall the test is successful, I'm just trying to figure out if there is a way our devs can use Windows to develop their guis. I realize that MonoDevelop is the "best" for gtk#. Hopefully the win32 version will get some love (and some binaries!). For now, we are looking at using vmware or doubling up PCs at their desks! Cheers, Jae -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080502/a9038547/attachment.html From david at ritter.demon.co.uk Sun May 4 07:04:57 2008 From: david at ritter.demon.co.uk (David A Knight) Date: Sun, 04 May 2008 12:04:57 +0100 Subject: [Gtk-sharp-list] Gtk.TreePath double free / TreeModelImplementor In-Reply-To: <1204665451.7096.109.camel@ganymede,> References: <1204665451.7096.109.camel@ganymede,> Message-ID: <1209899097.7195.1.camel@ganymede,> On Tue, 2008-03-04 at 21:17 +0000, David A Knight wrote: > I have recently installed gtk-sharp from svn to play with > Gtk.TreeModelImplementor and have hit a slightly annoying problem, not > sure if it is my code at fault or a problem with gtk-sharp. > > I have a Gtk.TreeModelImplementor which works with a List to provide > a list view (seeing big memory savings where this works over a > Gtk.ListStore). This seems to work great in some cases but in one > instance I have a constant problem with a double from of a Gtk.TreePath: > > at (wrapper managed-to-native) Gtk.TreePath.gtk_tree_path_free > (intptr) <0x0000b> > at (wrapper managed-to-native) Gtk.TreePath.gtk_tree_path_free > (intptr) <0xffffffff> > at Gtk.TreePath.Free (intptr) [0x00000] In case anyone else was wondering about this, my problem was I wasn't setting Owned to false on my Gtk.TreePaths. David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080504/8ded4900/attachment.bin From mkestner at gmail.com Sun May 4 12:46:05 2008 From: mkestner at gmail.com (Mike Kestner) Date: Sun, 04 May 2008 11:46:05 -0500 Subject: [Gtk-sharp-list] Gtk.TreePath double free / TreeModelImplementor In-Reply-To: <1209899097.7195.1.camel@ganymede,> References: <1204665451.7096.109.camel@ganymede,> <1209899097.7195.1.camel@ganymede,> Message-ID: <1209919565.11736.14.camel@t61p.site> On Sun, 2008-05-04 at 12:04 +0100, David A Knight wrote: > On Tue, 2008-03-04 at 21:17 +0000, David A Knight wrote: > > I have recently installed gtk-sharp from svn to play with > > Gtk.TreeModelImplementor and have hit a slightly annoying problem, not > > sure if it is my code at fault or a problem with gtk-sharp. > > > > I have a Gtk.TreeModelImplementor which works with a List to provide > > a list view (seeing big memory savings where this works over a > > Gtk.ListStore). This seems to work great in some cases but in one > > instance I have a constant problem with a double from of a Gtk.TreePath: > > > > at (wrapper managed-to-native) Gtk.TreePath.gtk_tree_path_free > > (intptr) <0x0000b> > > at (wrapper managed-to-native) Gtk.TreePath.gtk_tree_path_free > > (intptr) <0xffffffff> > > at Gtk.TreePath.Free (intptr) [0x00000] > > In case anyone else was wondering about this, my problem was I wasn't > setting Owned to false on my Gtk.TreePaths. FWIW, I believe the issue you were seeing was fixed on gtk-sharp trunk on r100762 which introduced the OwnedCopy property for opaque types. Before that patch, GetPath implementations would return a tree path reference that wasn't really owned by the caller even though it was supposed to be. This fix will be in the next release of Gtk#. Mike From m.j.hutchinson at gmail.com Tue May 6 00:48:31 2008 From: m.j.hutchinson at gmail.com (Michael Hutchinson) Date: Tue, 6 May 2008 00:48:31 -0400 Subject: [Gtk-sharp-list] Child windows in a seperate dll file. In-Reply-To: <16966107.post@talk.nabble.com> References: <16966107.post@talk.nabble.com> Message-ID: On Tue, Apr 29, 2008 at 1:42 PM, Induane wrote: > > Greetings, I'm new to programming and thus to C#. In fact I'm only a few > weeks into my learning process. I've written an app for work and now am > rewriting it so that its not so hideous and ugly. At the moment its at like > 8000 lines and all in one class with just a ton of methods. Wow. that's pretty big. I generally find it's unusual for a file to pass 1000 lines, and very rare to pass 2000. I think your problem is that you are not structuring your code in an object-oriented way. When your are designing your code, structure it as objects with behaviors, properties etc inherent to those objects. If there is common functionality that you need to share between similar objects, put it in a base class, etc. > Anyways I've started rewriting it and decided to split the eventhandlers > into their own dll file so that it would be easier to maintain and cleaner. Why are you splitting event handlers into a separate dll file? What kind of handlers are you splitting out? Event handlers are generally pretty specific to the situation, so this doesn't make much sense to me. You can have more than one .cs file compile into a single dll or exe > This worked to a degree but I'd like to create dialogs that come up and > unfortunately I cannot seem to make that happen as it cannot compile due to > being unable to locate the parent window. Note that the signature of an EventHandler (object sender, EventArgs args) passes you the object that emitted the event as the first argument. > I have the program split up into > three files now: > > First is a simple file for the exe: > > using System; > using drawInterface; > // We'll be using these later I think. > // using Gtk; > // using GtkSharp; > > namespace ApplicationWrapper > { > > class applicationWrapper > { > > static void Main() > { > > sowInterface drawSow = new sowInterface(); > drawSow.MainInterface(); > > } > > } > > } > > > > Simple enough even for someone as slow as me. Now onto the code to draw the > interface (almost nothing yet but its a rewrite ;) don't make fun! > > using System; > using Gtk; > using GtkSharp; > using eventHandlers; > > namespace drawInterface > { > > > public class sowInterface > { > > public void MainInterface () > > { > > Application.Init (); > > Window window = new Window ("Statement of Work Generator"); > > /* Set a handler for delete_event that immediately > * exits GTK. */ > window.DeleteEvent += OnDelete; > > // sets windows size by default. We'll see if we need this later on. > // window.SetDefaultSize (200,200); > > /* Set the border width of the window and show the window itself.*/ > window.BorderWidth= 5; > > > /* Create a big ass table and place it inside the main window.*/ > Table table = new Table (26, 4, false); > table.SetColSpacing(0, 16); ... snip > > window.ShowAll(); > Application.Run(); > > } > > OnDelete2 OnDelete = new OnDelete2(); > > /* > > // Handles exiting when you click the X button - temp disabled as trying > to split into dll > static void OnDelete (object obj, DeleteEventArgs e) > { > Application.Quit(); > } > > */ > > > } > > > > } For a start, you could have this class subclass Gtk.Window. public class MainInterface : Gtk.Window { public MainInterface () : base ("My window title") { //construct the GUI //hook up the event handlers } //define the event handlers } then your main class public class MyApplication { public static void Main () { Application.Init () MainWindow win = new MainWindow (); Application.Run () } } > > > > > > and now the file I'm using for the event handler: > > > using System; > using Gtk; > using GtkSharp; > > namespace eventHandlers > { > > public class event_handlers > { > > public static void OnDelete2 (object obj, DeleteEventArgs e) > { > /* > MessageDialog md = new MessageDialog (window, > DialogFlags.DestroyWithParent, > MessageType.Question, > ButtonsType.YesNo, "Are you sure you want to quit?"); > > ResponseType result = (ResponseType)md.Run (); > > if (result == ResponseType.Yes) > { > Application.Quit(); > } > else > { > md.Destroy(); > } > } > */ > Application.Quit(); > > } > > } And again, you can encapsulate this into a class: public class QuitDialog : MessageDialog { public QuitDialog (Window parent) : base (window, DialogFlags.DestroyWithParent, MessageType.Question, ButtonsType.YesNo, "Are you sure you want to quit?") { } public void RunDialog () { ShowAll (); ResponseType result = (ResponseType)Run (); if (result == ResponseType.Yes) { Application.Quit(); } Hide (); } public override Dispose () { Destroy (); base.Dispose (); } } Note that this is a nice re-usable chunk of code that will go quite nicely in its own file. You can compile it into your main exe or into a separate dll if you want to share it between apps. You can use this with using (QuitDialog qd = new QuitDialog ((Window) sender)) { qd.RunDialog (); } > > > As you can see I've commented out the confirmation dialog box. I had though > instancing it in my main drawinterface would make it work but it doesn't. > Can anyone point me in the right direction? Look up the difference betwen static and instance members. A static member in the event_handlers class has no way to access members of an instance of the main app class without a pointer to that instance. > Also eventually part of the code will eventually have certain events calling > methods that change the values and labels of other widgets so I need to > figure out how to do that across libraries as well. If your widgets are public properties of the main window, you can access them via a pointer to an instance of that window, e.g. MainWindow main = (MainWindow)sender; main.SomeLabel.Text = "Hello"; However, I strongly advise against breaking up a class into pieces without fixing the inderlying structure. You should structure your code into objects with the behaviours specific to those objects baked into them. > Many thanks and kind regards. Hopefully someone can point me in the right > direction. I suggest taking a look at MonoDevelop and its GTK# designer. It designs widgets and windows based on these principles. In particular http://www.monodevelop.com/Creating_custom_widgets_with_MonoDevelop > > Brant Watson > > P.S. I've also attached an archive that includes my old (horrible) source > code as well as the beginnings that are listed above and the makefile to > compile the new version. Eventually I'd like to add a preferences dialog as > well and make that its own library so that it can be worked on > independently. So I'll need to be passing things back and fourth like a > madman. > http://www.nabble.com/file/p16966107/StatementofWork.tar.gz > StatementofWork.tar.gz > -- > View this message in context: http://www.nabble.com/Child-windows-in-a-seperate-dll-file.-tp16966107p16966107.html > Sent from the Mono - Gtk# mailing list archive at Nabble.com. > > _______________________________________________ > Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list > -- Michael Hutchinson http://mjhutchinson.com From alex.launi at gmail.com Thu May 8 20:38:20 2008 From: alex.launi at gmail.com (Alex Launi) Date: Thu, 8 May 2008 20:38:20 -0400 Subject: [Gtk-sharp-list] Need help .parsing desktop files! Message-ID: <66cdbbc0805081738y2d75f8e4paeadb14b19afff0a@mail.gmail.com> Hi everyone, I'm having an issue parsing .desktop files, I'm not exactly sure how to open the file so that I can write back to it. At the moment I can read the file fine, getting any data I want out of it, but I can't make changes. When I try to save, I get an exception. I've included the relevant code snippets, and the exception it throws. Thanks for any help guys. [CODE] ... ditem = OpenDesktopFile (desktop_file); if (auto_start_chk.Active) { Console.Error.WriteLine ("ENABLED"); ditem.SetBoolean ("X-GNOME-Autostart-enabled",true); ditem.Save(desktop_file,true); } else { Console.Error.WriteLine ("DISABLED"); ditem.SetBoolean ("X-GNOME-Autostart-enabled",false); ditem.Save(desktop_file,true); } ... private DesktopItem OpenDesktopFile (string desktopFile) { DesktopItem item; IntPtr desktopFileP; desktopFileP = gnome_desktop_item_new_from_file ( desktopFile, 0, IntPtr.Zero); if (desktopFileP == IntPtr.Zero) throw new FileNotFoundException (desktopFile); item = new DesktopItem (desktopFileP); // We may need to call this depending on how DesktopItem works. gnome_desktop_item_unref (desktopFileP); return item; } [DllImport ("libgnome-desktop-2.so.2")] private static extern IntPtr gnome_desktop_item_new_from_file (string file, int flags, IntPtr error); [DllImport ("libgnome-desktop-2.so.2")] private static extern void gnome_desktop_item_unref (IntPtr item); [/CODE] [EXCEPTION] Exception in Gtk# callback delegate Note: Applications can use GLib.ExceptionManager.UnhandledException to handle the exception. GLib.GException: Operation not supported at Gnome.DesktopItem.Save (System.String under, Boolean force) [0x00000] at Do.UI.SettingsWindow.OnAutoStartChkClicked (System.Object sender, System.EventArgs e) [0x001d4] in /home/alex/Do/Do/src/Do.UI/SettingsWindow.cs:188 at GLib.Signal.voidObjectCallback (IntPtr handle, IntPtr data) [0x00000] at GLib.ExceptionManager.RaiseUnhandledException(System.Exception e, Boolean is_terminal) at GLib.Signal.voidObjectCallback(IntPtr handle, IntPtr data) at GLib.Signal.voidObjectCallback(IntPtr , IntPtr ) at Gtk.Application.gtk_main() at Gtk.Application.gtk_main() at Gtk.Application.Run() at Do.Do.Main(System.String[] args) in /home/alex/Do/Do/src/Do.cs:line 78 [/EXCEPTION] I've tried not dereferencing the pointer, the same exception is thrown. I've also tried opening the Desktop item like item = new DesktopItem (desktopFile,DesktopItemLoadFlags.OnlyIfExists); It throws the exception here: http://www.paste2.org/p/26450. Thanks for any help people, I really appreciate it. -- --Alex Launi -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080508/9c7e4437/attachment.html From mkestner at gmail.com Thu May 8 22:59:45 2008 From: mkestner at gmail.com (Mike Kestner) Date: Thu, 08 May 2008 21:59:45 -0500 Subject: [Gtk-sharp-list] Need help .parsing desktop files! In-Reply-To: <66cdbbc0805081738y2d75f8e4paeadb14b19afff0a@mail.gmail.com> References: <66cdbbc0805081738y2d75f8e4paeadb14b19afff0a@mail.gmail.com> Message-ID: <1210301985.11736.98.camel@t61p.site> Does ditem.Save (null, true) work? The docs on library.gnome.org say that is how you save to the original location. Also, is there some reason you aren't using DesktopItem.NewFromFile to open the file? If that's broken, please file a bug report. Mike On Thu, 2008-05-08 at 20:38 -0400, Alex Launi wrote: > Hi everyone, I'm having an issue parsing .desktop files, I'm not > exactly sure how to open the file so that I can write back to it. At > the moment I can read the file fine, getting any data I want out of > it, but I can't make changes. When I try to save, I get an exception. > I've included the relevant code snippets, and the exception it throws. > Thanks for any help guys. > > [CODE] > ... > ditem = OpenDesktopFile (desktop_file); > > if (auto_start_chk.Active) { > Console.Error.WriteLine ("ENABLED"); > ditem.SetBoolean ("X-GNOME-Autostart-enabled",true); > ditem.Save(desktop_file,true); > } > else { > Console.Error.WriteLine ("DISABLED"); > ditem.SetBoolean ("X-GNOME-Autostart-enabled",false); > ditem.Save(desktop_file,true); > } > ... > private DesktopItem OpenDesktopFile (string desktopFile) > { > DesktopItem item; > IntPtr desktopFileP; > > desktopFileP = gnome_desktop_item_new_from_file ( > desktopFile, 0, IntPtr.Zero); > > if (desktopFileP == IntPtr.Zero) > throw new FileNotFoundException (desktopFile); > > item = new DesktopItem (desktopFileP); > > // We may need to call this depending on how DesktopItem > works. > gnome_desktop_item_unref (desktopFileP); > return item; > } > > [DllImport ("libgnome-desktop-2.so.2")] > private static extern IntPtr gnome_desktop_item_new_from_file > (string file, int flags, IntPtr error); > > [DllImport ("libgnome-desktop-2.so.2")] > private static extern void gnome_desktop_item_unref (IntPtr > item); > > [/CODE] > > [EXCEPTION] > > Exception in Gtk# callback delegate > Note: Applications can use GLib.ExceptionManager.UnhandledException > to handle the exception. > GLib.GException: Operation not supported > at Gnome.DesktopItem.Save (System.String under, Boolean force) > [0x00000] > at Do.UI.SettingsWindow.OnAutoStartChkClicked (System.Object sender, > System.EventArgs e) [0x001d4] > in /home/alex/Do/Do/src/Do.UI/SettingsWindow.cs:188 > at GLib.Signal.voidObjectCallback (IntPtr handle, IntPtr data) > [0x00000] > at GLib.ExceptionManager.RaiseUnhandledException(System.Exception > e, Boolean is_terminal) > at GLib.Signal.voidObjectCallback(IntPtr handle, IntPtr data) > at GLib.Signal.voidObjectCallback(IntPtr , IntPtr ) > at Gtk.Application.gtk_main() > at Gtk.Application.gtk_main() > at Gtk.Application.Run() > at Do.Do.Main(System.String[] args) > in /home/alex/Do/Do/src/Do.cs:line 78 > > [/EXCEPTION] > > I've tried not dereferencing the pointer, the same exception is > thrown. I've also tried opening the Desktop item like > item = new DesktopItem > (desktopFile,DesktopItemLoadFlags.OnlyIfExists); > It throws the exception here: http://www.paste2.org/p/26450. > Thanks for any help people, I really appreciate it. > -- > --Alex Launi > _______________________________________________ > Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list From alex.launi at gmail.com Fri May 9 17:33:24 2008 From: alex.launi at gmail.com (Alex Launi) Date: Fri, 9 May 2008 17:33:24 -0400 Subject: [Gtk-sharp-list] Taking keyboard input Message-ID: <66cdbbc0805091433w10b4b050j9a3dc4f76374ddb3@mail.gmail.com> Hi again Gtk# list, I'm trying to figure out how to grab keyboard input and use it to save a key binding. This is a snippet, I know how to register the binding once I have it, and I know a lot more needs added, but I'm not able to get the keyboard input at all. As it is, OnAccelEntryKeyPress never gets called. How can I get the app so that when the button is clicked, it takes the keyboard input? I really appreciate the help, I'm trying to learn this stuff but I haven't been able to find any real solid documentation for gtk-sharp (so if it's out there, and you just want to send me a link, I'll be more than happy with that). Thanks. protected virtual void OnKeybindingBtnClicked (object sender, System.EventArgs e) { keybinding_btn.KeyPressEvent += new KeyPressEventHandler (OnAccelEntryKeyPress); //keybinding_btn.Label = "KEYS??"; } void OnAccelEntryKeyPress (object sender, KeyPressEventArgs e) { Gdk.ModifierType mod = e.Event.State; Gdk.Key key = e.Event.Key; string accel = ""; if (mod.Equals ( Gdk.Key.Control_L) || mod.Equals (Gdk.Key.Control_R)) accel = ""; else if (mod.Equals ( Gdk.Key.Meta_L) || mod.Equals (Gdk.Key.Meta_R)) accel = ""; else if (mod.Equals ( Gdk.Key.Alt_L) || mod.Equals (Gdk.Key.Alt_R)) accel = ""; keybinding_btn.Label = accel + e.Event.Key; Console.Error.WriteLine (accel + e.Event.Key); } -- --Alex Launi -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080509/188ef3d0/attachment.html From gtk-sharp at indicium.za.net Sun May 11 08:17:12 2008 From: gtk-sharp at indicium.za.net (Walter Kempf) Date: Sun, 11 May 2008 14:17:12 +0200 Subject: [Gtk-sharp-list] Taking keyboard input In-Reply-To: <66cdbbc0805091433w10b4b050j9a3dc4f76374ddb3@mail.gmail.com> References: <66cdbbc0805091433w10b4b050j9a3dc4f76374ddb3@mail.gmail.com> Message-ID: <4826E3C8.5070107@indicium.za.net> Try using the containing Window/Dialog/Container's KeyPressEvent (in stead of the button's) to catch the key-press. Alex Launi wrote: > Hi again Gtk# list, I'm trying to figure out how to grab keyboard > input and use it to save a key binding. This is a snippet, I know how > to register the binding once I have it, and I know a lot more needs > added, but I'm not able to get the keyboard input at all. As it is, > OnAccelEntryKeyPress never gets called. How can I get the app so that > when the button is clicked, it takes the keyboard input? I really > appreciate the help, I'm trying to learn this stuff but I haven't been > able to find any real solid documentation for gtk-sharp (so if it's > out there, and you just want to send me a link, I'll be more than > happy with that). Thanks. > > > protected virtual void OnKeybindingBtnClicked (object sender, > System.EventArgs e) > { > keybinding_btn.KeyPressEvent += new KeyPressEventHandler > (OnAccelEntryKeyPress); > //keybinding_btn.Label = "KEYS??"; > } > > void OnAccelEntryKeyPress (object sender, KeyPressEventArgs e) > { > Gdk.ModifierType mod = e.Event.State; > Gdk.Key key = e.Event.Key; > > string accel = ""; > > if (mod.Equals ( Gdk.Key.Control_L) || mod.Equals > (Gdk.Key.Control_R)) > accel = ""; > else if (mod.Equals ( Gdk.Key.Meta_L) || mod.Equals > (Gdk.Key.Meta_R)) > accel = ""; > else if (mod.Equals ( Gdk.Key.Alt_L) || mod.Equals > (Gdk.Key.Alt_R)) > accel = ""; > keybinding_btn.Label = accel + e.Event.Key; > Console.Error.WriteLine (accel + e.Event.Key); > } > > -- > --Alex Launi > ------------------------------------------------------------------------ > > _______________________________________________ > Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list > From lordphoenix at free.fr Sun May 11 08:46:05 2008 From: lordphoenix at free.fr (lordphoenix) Date: Sun, 11 May 2008 14:46:05 +0200 Subject: [Gtk-sharp-list] Problems with ConfigureEvent Message-ID: <20080511144605.5e82c576@free.fr> Hi all, I'm trying to use Gtk.Widget.ConfigureEvent in order to get informed about window moving and resizing. In my constructor I have this code this.ConfigureEvent += new ConfigureEventHandler (onConfigureEvent); and in this same class I've method void OnConfigureEvent (object o, Gtk.ConfigureEventArgs args) { Console.Writeline("test"); } Nothing really difficult but it doesn't seems to be good solution because nothing happens. Someone has an idea about the problem? Thanks for help. PS : Sorry for my bad English I don't speak it very often. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080511/f90c0afe/attachment.bin From rothflorian at gmx.de Sun May 11 10:26:00 2008 From: rothflorian at gmx.de (Florian Roth) Date: Sun, 11 May 2008 16:26:00 +0200 Subject: [Gtk-sharp-list] Problems with ConfigureEvent In-Reply-To: <20080511144605.5e82c576@free.fr> References: <20080511144605.5e82c576@free.fr> Message-ID: <20080511142600.320790@gmx.net> I had the same problem until I found this: Have a look art http://gtk-sharp.sourceforge.net/faq.html question 3.3 Florian Roth -------- Original-Nachricht -------- > Datum: Sun, 11 May 2008 14:46:05 +0200 > Von: lordphoenix > An: gtk-sharp-list at lists.ximian.com > Betreff: [Gtk-sharp-list] Problems with ConfigureEvent > Hi all, > I'm trying to use Gtk.Widget.ConfigureEvent in order to get informed > about window moving and resizing. > > In my constructor I have this code > > this.ConfigureEvent += new ConfigureEventHandler (onConfigureEvent); > > and in this same class I've method > > void OnConfigureEvent (object o, Gtk.ConfigureEventArgs > args) > { > Console.Writeline("test"); > } > > Nothing really difficult but it doesn't seems to be good solution > because nothing happens. > > Someone has an idea about the problem? > > Thanks for help. > > PS : Sorry for my bad English I don't speak it very often. -- 249 Spiele f?r nur 1 Preis. Die GMX Spieleflatrate schon ab 9,90 Euro. Neu: Asterix bei den Olympischen Spielen: http://flat.games.gmx.de From gtk-sharp at indicium.za.net Sun May 11 10:56:37 2008 From: gtk-sharp at indicium.za.net (Walter Kempf) Date: Sun, 11 May 2008 16:56:37 +0200 Subject: [Gtk-sharp-list] Problems with ConfigureEvent In-Reply-To: <20080511142600.320790@gmx.net> References: <20080511144605.5e82c576@free.fr> <20080511142600.320790@gmx.net> Message-ID: <48270925.1020109@indicium.za.net> Interesting. That attribute seems to do the trick. Besides the ConfigureEvent event I've found that both ExposeEvent and SizeAllocated fires when a window is resized. As far as window movement goes, I was unable to find another event. Just note, lordphoenix, that your event handlers may be called multiple times for a single "action". Florian Roth wrote: > I had the same problem until I found this: > Have a look art http://gtk-sharp.sourceforge.net/faq.html question 3.3 > > Florian Roth > > -------- Original-Nachricht -------- > >> Datum: Sun, 11 May 2008 14:46:05 +0200 >> Von: lordphoenix >> An: gtk-sharp-list at lists.ximian.com >> Betreff: [Gtk-sharp-list] Problems with ConfigureEvent >> > > >> Hi all, >> I'm trying to use Gtk.Widget.ConfigureEvent in order to get informed >> about window moving and resizing. >> >> In my constructor I have this code >> >> this.ConfigureEvent += new ConfigureEventHandler (onConfigureEvent); >> >> and in this same class I've method >> >> void OnConfigureEvent (object o, Gtk.ConfigureEventArgs >> args) >> { >> Console.Writeline("test"); >> } >> >> Nothing really difficult but it doesn't seems to be good solution >> because nothing happens. >> >> Someone has an idea about the problem? >> >> Thanks for help. >> >> PS : Sorry for my bad English I don't speak it very often. >> > > From lordphoenix at free.fr Mon May 12 04:26:24 2008 From: lordphoenix at free.fr (lordphoenix) Date: Mon, 12 May 2008 10:26:24 +0200 Subject: [Gtk-sharp-list] Problems with ConfigureEvent In-Reply-To: <48270925.1020109@indicium.za.net> References: <20080511144605.5e82c576@free.fr> <20080511142600.320790@gmx.net> <48270925.1020109@indicium.za.net> Message-ID: <20080512102624.4e8f72a6@jupiter> Le Sun, 11 May 2008 16:56:37 +0200, Walter Kempf a ?crit : > Just note, lordphoenix, that your event handlers may be called > multiple times for a single "action". Yes I known but it's the only way i've find to get information about window position and size. If you know another way It would be greatfull to help :) PS : Sorry for my bad english I don't speak it very often -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080512/8dcb8636/attachment.bin From adam at morrison-ind.com Mon May 12 16:13:11 2008 From: adam at morrison-ind.com (Adam Tauno Williams) Date: Mon, 12 May 2008 16:13:11 -0400 Subject: [Gtk-sharp-list] Printing Text for Multiple Pages In-Reply-To: <1208355027.19578.3.camel@inspidel.lan> References: <1208355027.19578.3.camel@inspidel.lan> Message-ID: <1210623191.4663.7.camel@WM_ADAM1.morrison.iserv.net> On Wed, 2008-04-16 at 08:10 -0600, John M. Anderson wrote: > I'm trying to fix the Tomboy print code to use GTK Printing rather than > gnome print... Thanks for the excellent BLOB post on this topic! From gtk-sharp at indicium.za.net Tue May 13 01:35:41 2008 From: gtk-sharp at indicium.za.net (Walter Kempf) Date: Tue, 13 May 2008 07:35:41 +0200 Subject: [Gtk-sharp-list] [OT] Printing Text for Multiple Pages In-Reply-To: <1210623191.4663.7.camel@WM_ADAM1.morrison.iserv.net> References: <1208355027.19578.3.camel@inspidel.lan> <1210623191.4663.7.camel@WM_ADAM1.morrison.iserv.net> Message-ID: <482928AD.7060105@indicium.za.net> This is one helluva coincidence, but this is the second reference to his blog I got it 1 day! The other being http://blog.sontek.net/2008/05/11/python-with-a-modular-ide-vim/. Looks like I've got some reading to do. :) Adam Tauno Williams wrote: > On Wed, 2008-04-16 at 08:10 -0600, John M. Anderson wrote: > >> I'm trying to fix the Tomboy print code to use GTK Printing rather than >> gnome print... >> > > Thanks for the excellent BLOB post on this topic! > > > _______________________________________________ > Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list > > > From wasbridge at gmail.com Thu May 15 09:55:58 2008 From: wasbridge at gmail.com (Billy Schoenberg) Date: Thu, 15 May 2008 15:55:58 +0200 Subject: [Gtk-sharp-list] VPaned Locking the Position Message-ID: Hello, I am using a VPaned control and I want to lock the position of the panel. How can I do this? I have found the Paned.Move-Handle event, but that is not firing on my machine ever. Any ideas? Here is what I have tried: public void TopVerticalPanelMoved(object o, MoveHandleArgs e) { if ( LockPane ) { SecondVerticalPanel.Position = 0; } } Thanks Billy -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080515/35eff333/attachment.html From adam at morrison-ind.com Thu May 15 09:57:34 2008 From: adam at morrison-ind.com (Adam Tauno Williams) Date: Thu, 15 May 2008 09:57:34 -0400 Subject: [Gtk-sharp-list] VPaned Locking the Position In-Reply-To: References: Message-ID: <1210859854.8084.5.camel@WM_ADAM1.morrison.iserv.net> > I am using a VPaned control and I want to lock the position of the > panel. How can I do this? I have found the Paned.Move-Handle event, > but that is not firing on my machine ever. Did you try adding the GLib.ConnectBefore attribute to your event handler? > Any ideas? > Here is what I have tried: > public void TopVerticalPanelMoved(object o, MoveHandleArgs e) > if ( LockPane ) > { > SecondVerticalPanel.Position = 0; > } > } -- Consonance: an Open Source .NET OpenGroupware client. Contact:awilliam at whitemiceconsulting.com http://freshmeat.net/projects/consonance/ From wasbridge at gmail.com Thu May 15 10:03:34 2008 From: wasbridge at gmail.com (Billy Schoenberg) Date: Thu, 15 May 2008 16:03:34 +0200 Subject: [Gtk-sharp-list] VPaned Locking the Position In-Reply-To: <1210859854.8084.5.camel@WM_ADAM1.morrison.iserv.net> References: <1210859854.8084.5.camel@WM_ADAM1.morrison.iserv.net> Message-ID: I am using Glade and autoconnect. Would it be best to connect this one myself? Can you show me an example of how to use that. Billy On Thu, May 15, 2008 at 3:57 PM, Adam Tauno Williams wrote: > > I am using a VPaned control and I want to lock the position of the > > panel. How can I do this? I have found the Paned.Move-Handle event, > > but that is not firing on my machine ever. > > Did you try adding the GLib.ConnectBefore attribute to your event > handler? > > > Any ideas? > > Here is what I have tried: > > public void TopVerticalPanelMoved(object o, MoveHandleArgs e) > > if ( LockPane ) > > { > > SecondVerticalPanel.Position = 0; > > } > > } > > -- > Consonance: an Open Source .NET OpenGroupware client. > Contact:awilliam at whitemiceconsulting.com > http://freshmeat.net/projects/consonance/ > > _______________________________________________ > Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080515/29a4723f/attachment.html From adam at morrison-ind.com Thu May 15 13:13:10 2008 From: adam at morrison-ind.com (Adam Tauno Williams) Date: Thu, 15 May 2008 13:13:10 -0400 Subject: [Gtk-sharp-list] VPaned Locking the Position In-Reply-To: References: <1210859854.8084.5.camel@WM_ADAM1.morrison.iserv.net> Message-ID: <1210871590.8084.13.camel@WM_ADAM1.morrison.iserv.net> > I am using Glade and autoconnect. Would it be best to connect this > one myself? No, just apply the attribute to the method. Not saying it will solve your problem with the VPaned, but you should at least see the event. > Can you show me an example of how to use that. [GLib.ConnectBefore] public void TopVerticalPanelMoved(object o, MoveHandleArgs e) .... From atgnbk at gmail.com Sat May 17 08:57:13 2008 From: atgnbk at gmail.com (Arthur Turrini) Date: Sat, 17 May 2008 09:57:13 -0300 Subject: [Gtk-sharp-list] Binaries for GTK 2.12.x for Windows Message-ID: <7308d4540805170557m7255ec7fs9b74da58c59978fc@mail.gmail.com> Hi, When gtk-sharp 2.12.x for Windows will be available? Is there any binary beta version available for testing? Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080517/fad8baa1/attachment.html From linux at famped.dk Sat May 17 09:06:18 2008 From: linux at famped.dk (Jesper K. Pedersen) Date: Sat, 17 May 2008 15:06:18 +0200 Subject: [Gtk-sharp-list] Dialog response handler to not exit the dialog.Run() method on response event? Message-ID: <20080517150618.2d3128a1@io.solnet> Is it possible to keep a dialog running despite response handlers being activated? Normally a Gtk.Dialog will exit its "run" loop when a response handler is called, but I would like to somehow stay in the dialog run loop until a user enter a valid value in a field that is placed in the dialog. Is that possible or will I need to rerun the Dialog manually by entering it in my response event handler? Any hints are greatly appreciated JesperKP -- From mtausig at fsmat.at Mon May 19 10:32:30 2008 From: mtausig at fsmat.at (Mathias Tausig) Date: Mon, 19 May 2008 16:32:30 +0200 (CEST) Subject: [Gtk-sharp-list] Redraw window Message-ID: <61747.195.64.3.50.1211207550.squirrel@fsmat.at> Hy! In an event of my main window, I first open a FileChooserDialog to read a filename (and destroy it promptly) and call a function afterwards. My problem is, that before that function (and right after it, the event) is finished and my app returns to the main loop, my mainwindo is greyed out and the GUI ist completely unresponsive.But I would need to display some stuff from my function. How can I do that? cheers Mathias From adam at morrison-ind.com Mon May 19 10:51:41 2008 From: adam at morrison-ind.com (Adam Tauno Williams) Date: Mon, 19 May 2008 10:51:41 -0400 Subject: [Gtk-sharp-list] Code Project Article: Custom controls with MonoDevelop and Gtk# Message-ID: <1211208701.11593.9.camel@EVTLIS03.morrison.iserv.net> Code project has a new, and rather nice, article on building custom controls. Really wish this had been around six months ago! :) "Custom controls with MonoDevelop and Gtk#" From mtausig at fsmat.at Mon May 19 10:52:43 2008 From: mtausig at fsmat.at (Mathias Tausig) Date: Mon, 19 May 2008 16:52:43 +0200 (CEST) Subject: [Gtk-sharp-list] Redraw window In-Reply-To: <483192BF.7020604@opengeomap.org> References: <61747.195.64.3.50.1211207550.squirrel@fsmat.at> <483192BF.7020604@opengeomap.org> Message-ID: <61867.195.64.3.50.1211208763.squirrel@fsmat.at> Sure, here are the relevant (abbreviated) parts. In SignPDF I would like to have access to the UI (display a Dialog for Smartcard-Pin verification), but the whole window is greyed until SignPDF is finished. cheers Mathias private void PdfSign_Click(object o, EventArgs args){ try{ String filename=OpenFileDialog("Bitte die gew?nschte PDF Datei ausw?hlen."); String outfile=OpenFileDialog("Bitte die ge?nschte Ausgabedatei ausw?hlen."); SignPDF(filename, outfile, SelectedCertificate, "reason", "location"); }catch{} } protected String RunFileDialog(FileChooserDialog fc){ String filename=""; try{ if(fc.Run()== (int)ResponseType.Accept) filename=fc.Filename; }catch{} }finally{ fc.Destroy(); } return filename; } protected String OpenFileDialog(String label){ FileChooserDialog fc=new FileChooserDialog(label, MainWindow, FileChooserAction.Open, "Abort", ResponseType.Cancel, "Open", ResponseType.Accept); fc.Modal=false; return RunFileDialog(fc); } > Mathias Tausig escribi?: >> > can you put some source code to understand your problem? From mhenriquezs at terra.cl Mon May 19 12:07:52 2008 From: mhenriquezs at terra.cl (Mauricio Henriquez) Date: Mon, 19 May 2008 12:07:52 -0400 Subject: [Gtk-sharp-list] Code Project Article: Custom controls with MonoDevelop and Gtk# In-Reply-To: <1211208701.11593.9.camel@EVTLIS03.morrison.iserv.net> References: <1211208701.11593.9.camel@EVTLIS03.morrison.iserv.net> Message-ID: <4831A5D8.50003@terra.cl> ...great article!!! Adam Tauno Williams wrote: > Code project has a new, and rather nice, article on building custom > controls. Really wish this had been around six months ago! :) > > "Custom controls with MonoDevelop and Gtk#" > > > _______________________________________________ > Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list > > From martin at opengeomap.org Mon May 19 10:46:23 2008 From: martin at opengeomap.org (Martin (OpenGeoMap)) Date: Mon, 19 May 2008 16:46:23 +0200 Subject: [Gtk-sharp-list] Redraw window In-Reply-To: <61747.195.64.3.50.1211207550.squirrel@fsmat.at> References: <61747.195.64.3.50.1211207550.squirrel@fsmat.at> Message-ID: <483192BF.7020604@opengeomap.org> Mathias Tausig escribi?: > Hy! > > In an event of my main window, I first open a FileChooserDialog to read a > filename (and destroy it promptly) and call a function afterwards. My > problem is, that before that function (and right after it, the event) is > finished and my app returns to the main loop, my mainwindo is greyed out > and the GUI ist completely unresponsive.But I would need to display some > stuff from my function. How can I do that? > > cheers > Mathias > can you put some source code to understand your problem? > _______________________________________________ > Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list > > From andy at brdstudio.net Mon May 19 14:21:44 2008 From: andy at brdstudio.net (Andrew York) Date: Mon, 19 May 2008 14:21:44 -0400 Subject: [Gtk-sharp-list] Code Project Article: Custom controls with MonoDevelop and Gtk# In-Reply-To: <1211208701.11593.9.camel@EVTLIS03.morrison.iserv.net> References: <1211208701.11593.9.camel@EVTLIS03.morrison.iserv.net> Message-ID: <4831C538.4040102@brdstudio.net> Sweet!!! Adam Tauno Williams wrote: > Code project has a new, and rather nice, article on building custom > controls. Really wish this had been around six months ago! :) > > "Custom controls with MonoDevelop and Gtk#" > > > _______________________________________________ > Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list > From martin at opengeomap.org Mon May 19 21:08:47 2008 From: martin at opengeomap.org (martin (OpenGeoMap)) Date: Mon, 19 May 2008 22:08:47 -0300 Subject: [Gtk-sharp-list] Redraw window In-Reply-To: <4831C538.4040102@brdstudio.net> References: <1211208701.11593.9.camel@EVTLIS03.morrison.iserv.net> <4831C538.4040102@brdstudio.net> Message-ID: <4832249F.50803@opengeomap.org> Hi: I don't understand well the exceptions here, but perhaps it was well. I use more simple code. I see in gtkmm, ruby/gnome and obvioulsy in the C API: GTK# sample: http://www.go-mono.com/docs/index.aspx?link=T%3aGtk.FileFilter Ruby sample: http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gtk%3A%3AFileChooserDialog GTKMM sample: http://www.gtkmm.org/docs/gtkmm-2.4/docs/tutorial/html/sec-dialogs-filechooserdialog.html ruby and c++ have exceptions like c# but they don't use it here. For me the C API is always my reference: http://library.gnome.org/devel/gtk/2.11/GtkFileChooserDialog.html I test this simple code to solve your problem i think: protected virtual void OnButton1Clicked (object sender, System.EventArgs e) { FileChooserDialog fc=new FileChooserDialog("hola mundo",this, FileChooserAction.Open, "Abort", ResponseType.Cancel, "Open", ResponseType.Accept); Gtk.FileFilter filter=new Gtk.FileFilter(); filter.Name="C/C++ files"; filter.AddPattern("*.cc"); fc.AddFilter(filter); if (fc.Run()==(int)ResponseType.Accept) { System.Console.Write("filename is {0} \n",fc.Filename); } fc.Destroy(); fc=new FileChooserDialog("hola mundo",this, FileChooserAction.Open, "Abort", ResponseType.Cancel, "Open", ResponseType.Accept); if (fc.Run() ==(int)ResponseType.Accept) { System.Console.Write("filename is {0} \n",fc.Filename); } fc.Destroy(); } can this help you? Regards. From mtausig at fsmat.at Tue May 20 03:54:24 2008 From: mtausig at fsmat.at (Mathias Tausig) Date: Tue, 20 May 2008 09:54:24 +0200 (CEST) Subject: [Gtk-sharp-list] Redraw window In-Reply-To: <4832249F.50803@opengeomap.org> References: <1211208701.11593.9.camel@EVTLIS03.morrison.iserv.net> <4831C538.4040102@brdstudio.net> <4832249F.50803@opengeomap.org> Message-ID: <63710.195.64.3.50.1211270064.squirrel@fsmat.at> Hy! I think you misunderstood me. The FileChooserDialog is displayed just fine. My problem lies after the fc.Destroy(). The dialog is closed then, but the remaining part of the UI remains unusable, before the event handler ends. cheers Mathias > Hi: > > I don't understand well the exceptions here, but perhaps it was well. I > use more simple code. > > I see in gtkmm, ruby/gnome and obvioulsy in the C API: > > GTK# sample: > http://www.go-mono.com/docs/index.aspx?link=T%3aGtk.FileFilter > Ruby sample: > http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gtk%3A%3AFileChooserDialog > GTKMM sample: > http://www.gtkmm.org/docs/gtkmm-2.4/docs/tutorial/html/sec-dialogs-filechooserdialog.html > > ruby and c++ have exceptions like c# but they don't use it here. > > > For me the C API is always my reference: > http://library.gnome.org/devel/gtk/2.11/GtkFileChooserDialog.html > > > I test this simple code to solve your problem i think: > > > > protected virtual void OnButton1Clicked (object sender, > System.EventArgs e) > { > > FileChooserDialog fc=new FileChooserDialog("hola mundo",this, > > FileChooserAction.Open, "Abort", ResponseType.Cancel, "Open", > ResponseType.Accept); > > Gtk.FileFilter filter=new Gtk.FileFilter(); > filter.Name="C/C++ files"; > filter.AddPattern("*.cc"); > fc.AddFilter(filter); > > > if (fc.Run()==(int)ResponseType.Accept) { > System.Console.Write("filename is {0} \n",fc.Filename); > > } > fc.Destroy(); > > fc=new FileChooserDialog("hola mundo",this, > > FileChooserAction.Open, "Abort", ResponseType.Cancel, "Open", > ResponseType.Accept); > > if (fc.Run() ==(int)ResponseType.Accept) { > System.Console.Write("filename is {0} \n",fc.Filename); > > } > fc.Destroy(); > > > > } > > > can this help you? > > > Regards. > > > > > _______________________________________________ > Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list > > From cyberzr at gmail.com Tue May 20 10:11:48 2008 From: cyberzr at gmail.com (cyberzr) Date: Tue, 20 May 2008 16:11:48 +0200 Subject: [Gtk-sharp-list] Gtk TextBuffer Serialization & Deserialization Message-ID: <1211292708.15868.5.camel@localhost> Hi! I need to serialize and deserialize a TextBuffer for a project. But it doesn't work. When serializing the TextBuffer and write it in a file, it give me a file with only zeros. The code: BinaryWriter bw = new BinaryWriter(File.Open("myfile",System.IO.FileMode.CreateNew)); byte[] data = noteView.Buffer.Serialize(noteView.Buffer,Gdk.Atom.Intern("application/x-gtk-text-buffer-rich-text",true),noteView.Buffer.StartIter,noteView.Buffer.EndIter); bw.Write(data); bw.Close(); Does anyone have an example? I'll be happy ;) ++ From elmar at haneke.de Wed May 21 10:58:59 2008 From: elmar at haneke.de (Elmar Haneke) Date: Wed, 21 May 2008 16:58:59 +0200 Subject: [Gtk-sharp-list] Select from ComboBox by Typing Prefix Message-ID: <483438B3.80908@haneke.de> Is it possible to make an ComboBox to select active item by an Prefix typed in? If the user does type "bo" the box should jump to first item starting with "bo". Elmar From iggy.ma at gmail.com Wed May 21 11:03:06 2008 From: iggy.ma at gmail.com (Iggy) Date: Wed, 21 May 2008 10:03:06 -0500 Subject: [Gtk-sharp-list] Select from ComboBox by Typing Prefix In-Reply-To: <483438B3.80908@haneke.de> References: <483438B3.80908@haneke.de> Message-ID: <527a90a10805210803i199627a9vc31ef07171133323@mail.gmail.com> try using a ComboBoxEntry On Wed, May 21, 2008 at 9:58 AM, Elmar Haneke wrote: > Is it possible to make an ComboBox to select active item by an Prefix > typed in? > > If the user does type "bo" the box should jump to first item starting > with "bo". > > Elmar > > _______________________________________________ > Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list > > From linux at famped.dk Wed May 21 15:48:50 2008 From: linux at famped.dk (Jesper K. Pedersen) Date: Wed, 21 May 2008 21:48:50 +0200 Subject: [Gtk-sharp-list] gtk.entry validation difficulty Message-ID: <20080521214850.49a9fff6@io.solnet> In connection with a small application I am writing I have run into a slight problem. I have a form consisting of several gtk.entry widgets and two buttons for "cancel" and "accept" Each gtk.entry needs data validated when it is edited (changed) meaning when you either press enter or try to deselect the entry (by for instance tab'ing/clicking on another entry) my program should validate the content of the entry... Except in the case where you press the "cancel" button which should just disregard all validation. Currently my software is running fine if users don't do anything but use "enter" to finalize data entry. I use the Entry.Activated handler to validate my input. Unfortunately we have users who are creative with using both the tabulate key and the mouse too. I have tried using the Entry.EditingDone handler but I cannot get the event to fire at all (the GUI is made in glade). I have also tried using the Widget.FocusOutEvent but then trying to press the "cancel" button will fire the validation event. Any idea's/suggestions on how to get around this problem? Thank's Jesper KP From cdhowie at gmail.com Wed May 21 15:52:22 2008 From: cdhowie at gmail.com (Chris Howie) Date: Wed, 21 May 2008 15:52:22 -0400 Subject: [Gtk-sharp-list] gtk.entry validation difficulty In-Reply-To: <20080521214850.49a9fff6@io.solnet> References: <20080521214850.49a9fff6@io.solnet> Message-ID: <3d2f29dc0805211252l1def8f15pf6972f92e211c528@mail.gmail.com> On Wed, May 21, 2008 at 3:48 PM, Jesper K. Pedersen wrote: > In connection with a small application I am writing I have run into a > slight problem. > > I have a form consisting of several gtk.entry widgets and two buttons > for "cancel" and "accept" > > Each gtk.entry needs data validated when it is edited (changed) > meaning when you either press enter or try to deselect the entry (by > for instance tab'ing/clicking on another entry) my program should > validate the content of the entry... Except in the case where you press > the "cancel" button which should just disregard all validation. > > Currently my software is running fine if users don't do anything but use > "enter" to finalize data entry. I use the Entry.Activated handler to > validate my input. Unfortunately we have users who are creative with > using both the tabulate key and the mouse too. > > I have tried using the Entry.EditingDone handler but I cannot get the > event to fire at all (the GUI is made in glade). > > I have also tried using the Widget.FocusOutEvent but then trying to > press the "cancel" button will fire the validation event. > > Any idea's/suggestions on how to get around this problem? If validating the data isn't too resource-intensive (like CPU or DB connection, etc) just do what I do: have all of the entries' Changed signal call one method that validates the data and sets the Accept button's Sensitive property accordingly. Then users also get visual feedback while they are typing. If this would be too slow then you could perform this validation when an entry loses focus instead. -- Chris Howie http://www.chrishowie.com http://en.wikipedia.org/wiki/User:Crazycomputers From cdhowie at gmail.com Wed May 21 16:08:28 2008 From: cdhowie at gmail.com (Chris Howie) Date: Wed, 21 May 2008 16:08:28 -0400 Subject: [Gtk-sharp-list] gtk.entry validation difficulty In-Reply-To: <20080521220532.361f3d4e@io.solnet> References: <20080521214850.49a9fff6@io.solnet> <3d2f29dc0805211252l1def8f15pf6972f92e211c528@mail.gmail.com> <20080521220532.361f3d4e@io.solnet> Message-ID: <3d2f29dc0805211308y628e6697w34c0b8233529ae5b@mail.gmail.com> (Whoops, sending to the list too. Sorry, Jesper.) On Wed, May 21, 2008 at 4:05 PM, Jesper K. Pedersen wrote: > On Wed, 21 May 2008 15:52:22 -0400 > "Chris Howie" wrote: > >> On Wed, May 21, 2008 at 3:48 PM, Jesper K. Pedersen >> wrote: >> > In connection with a small application I am writing I have run into >> > a slight problem. >> > >> > I have a form consisting of several gtk.entry widgets and two >> > buttons for "cancel" and "accept" >> > >> > Each gtk.entry needs data validated when it is edited (changed) >> > meaning when you either press enter or try to deselect the entry (by >> > for instance tab'ing/clicking on another entry) my program should >> > validate the content of the entry... Except in the case where you >> > press the "cancel" button which should just disregard all >> > validation. >> > >> > Currently my software is running fine if users don't do anything >> > but use "enter" to finalize data entry. I use the Entry.Activated >> > handler to validate my input. Unfortunately we have users who are >> > creative with using both the tabulate key and the mouse too. >> > >> > I have tried using the Entry.EditingDone handler but I cannot get >> > the event to fire at all (the GUI is made in glade). >> > >> > I have also tried using the Widget.FocusOutEvent but then trying to >> > press the "cancel" button will fire the validation event. >> > >> > Any idea's/suggestions on how to get around this problem? >> >> If validating the data isn't too resource-intensive (like CPU or DB >> connection, etc) just do what I do: have all of the entries' Changed >> signal call one method that validates the data and sets the Accept >> button's Sensitive property accordingly. Then users also get visual >> feedback while they are typing. >> >> If this would be too slow then you could perform this validation when >> an entry loses focus instead. >> > > There is a slight problem with the resources as it is depending on a > result from a database validation (a partnumber validation). Even with > only approximately 19500 parts in the database it becomes a bit slow. > > The problem with using the FocusOutEvent is that it will force a > validation even if the user try and cancel what he is doing by pressing > the cancel button. > > I've tried checking if the widget that gets the new focus has it at the > time of the previous Widget.FocusOutEvent - then I could just check for > focus on the cancel button, but unfortunately focus isnt changed until > the FocusOutEvent is done. > > Right now I am about ready to throw the mouse away and cut the tabulate > key from the keyboard, but I think the whole problem is that I am the > only programmer on the project and this is my first real project on > C#/Gtk# What would be wrong with just validating in the Clicked event for the Accept button? -- Chris Howie http://www.chrishowie.com http://en.wikipedia.org/wiki/User:Crazycomputers From cdhowie at gmail.com Wed May 21 17:59:33 2008 From: cdhowie at gmail.com (Chris Howie) Date: Wed, 21 May 2008 17:59:33 -0400 Subject: [Gtk-sharp-list] gtk.entry validation difficulty In-Reply-To: <20080521221815.1e95f5b6@io.solnet> References: <20080521214850.49a9fff6@io.solnet> <3d2f29dc0805211252l1def8f15pf6972f92e211c528@mail.gmail.com> <20080521220532.361f3d4e@io.solnet> <3d2f29dc0805211308y628e6697w34c0b8233529ae5b@mail.gmail.com> <20080521221815.1e95f5b6@io.solnet> Message-ID: <3d2f29dc0805211459n2e69687dxa682e2ee74522bc2@mail.gmail.com> On Wed, May 21, 2008 at 4:18 PM, Jesper K. Pedersen wrote: > The software I am writing is for assisting aviation mechanics in > registering their use of aircraft spare parts (I am the leader of an > spare parts inventory in a small company). > > The form is a parts entry registration form where I have a range of > fields - of which 4 needs to be validated and correct until the system > accept to add the information to its central database. > > I fear that if the validation comes at the point of the mechanic being > "done" with entering data (some is entered via a barcode reader) and > there are problems the mechanic will have a difficulty resolving the > issues. Some of the issues can actually force the mechanic to have to > leave the terminal to get further data before he can finish up - so to > assist the mechanic I have each field validated at entry time and the > most significant done as the very first entry (dont know if that makes > sense). > > I have also tried to make the system as "mechanic friendly" by having it > tell you what is wrong with the entry - and where possible it > will suggest what needs to be done to fix it (like suggesting > partnumbers if a partnumber isnt recognized in the inventory system) Then checking on lost focus seems like the most appropriate thing to do. Note that when I say validate, I do *not* mean the type of validation that pops up horribly annoying dialog boxes on failure. (We have stuff like that where I work. I could rant about it for days.) I'm talking about the kind of validation that will annotate invalid fields with some indicator and disable all mechanisms that could be used to submit the form (like the Accept button). Clicking the indicator could provide further explanation in a dialog. An even better idea would be to keep the error messages short and display them below the field itself. I'm not sure how doing this on-blur would be an issue. -- Chris Howie http://www.chrishowie.com http://en.wikipedia.org/wiki/User:Crazycomputers From martin at opengeomap.org Wed May 21 18:09:09 2008 From: martin at opengeomap.org (martin (OpenGeoMap)) Date: Wed, 21 May 2008 19:09:09 -0300 Subject: [Gtk-sharp-list] Select from ComboBox by Typing Prefix In-Reply-To: <483438B3.80908@haneke.de> References: <483438B3.80908@haneke.de> Message-ID: <48349D85.1080907@opengeomap.org> Elmar Haneke escribi?: > Is it possible to make an ComboBox to select active item by an Prefix > typed in? > > If the user does type "bo" the box should jump to first item starting > with "bo". > > > I use the get_entry_completion to this task: http://www.go-mono.com/docs/index.aspx?tlink=4 at ecma%3a884%23EntryCompletion%2f Regards. -- If you need a religion perhaps you can choose GTK: http://www.gtk.org/language-bindings.html http://live.gnome.org/GnomeLove From lists at andrewpendleton.net Wed May 21 20:40:29 2008 From: lists at andrewpendleton.net (Andrew Pendleton) Date: Wed, 21 May 2008 20:40:29 -0400 (EDT) Subject: [Gtk-sharp-list] Gapi2 question In-Reply-To: <32707572.2661211416769279.JavaMail.root@lenny> Message-ID: <29421324.2681211416829638.JavaMail.root@lenny> I'm working on bindings for a gobject-based library that has a bunch of classes with constructors of the form: some_library_object_new(gdouble param1, gdouble param2, ...) { /* whatever */ } where param1 and param2 are required parameters, and the ellipsis is to be replaced by the caller with an arbitrary number of key/value pairs to be used to fill in other, optional properties of the object, followed by a null (they use g_object_set_valist). Obviously, C# doesn't support methods of this kind, and since all of the properties that can be specified from the constructor are also accessible as properties that can be set later, I'm content to just leave the arguments after the required ones out of the bindings. So, I need the bound constructor to come out as follows: [DllImport("some_library.dll")] static extern IntPtr some_library_asdf_new(double param1, double param2, IntPtr terminator); public Asdf (double param1, double param2) : base (IntPtr.Zero) { if (GetType () != typeof (Asdf)) { throw new InvalidOperationException ("Can't override this constructor."); } Raw = some_library_asdf_new(param1, param2, IntPtr.Zero); } that is to say, the wrapped C function needs to have an extra parameter, and rather than being exposed via the C# method, a null value always needs to be passed into the C function from the wrapping constructor. So, my question: this occurs in a whole bunch of classes in the library. I know I can use the gapi2 fixer program to strip the constructors out of all of these classes, and use .custom files to hand-code new constructors for each one, but I'd rather not. Is there some way I can make gapi2 generate code with this behavior? Andrew From mkestner at gmail.com Thu May 22 00:24:49 2008 From: mkestner at gmail.com (Mike Kestner) Date: Wed, 21 May 2008 23:24:49 -0500 Subject: [Gtk-sharp-list] Gapi2 question In-Reply-To: <29421324.2681211416829638.JavaMail.root@lenny> References: <29421324.2681211416829638.JavaMail.root@lenny> Message-ID: <1211430289.19816.54.camel@t61p.site> On Wed, 2008-05-21 at 20:40 -0400, Andrew Pendleton wrote: > that is to say, the wrapped C function needs to have an extra > parameter, and rather than being exposed via the C# method, a null > value always needs to be passed into the C function from the wrapping > constructor. > > So, my question: this occurs in a whole bunch of classes in the > library. I know I can use the gapi2 fixer program to strip the > constructors out of all of these classes, and use .custom files to > hand-code new constructors for each one, but I'd rather not. Is there > some way I can make gapi2 generate code with this behavior? Unfortunately, no. The generator currently ignores all methods/ctors with "ellipsis" parameters, reporting a warning to console. It might be a nice generator feature to support an ellipsis="NULL" attribute value that could be set with fixup so that the code you describe would be produced, but I don't think it would be a good default behavior. Often such methods have binding-friendlier alternative versions and many ellipsis methods would be useless without at least one value provided on the parameter stack. If you are interested in adding such a feature to the generator, you could contact me and I'd be happy to help get you started. Depending on how many ctors you have to .custom though, it may be quicker to just go that route. -- Mike Kestner From pipiten at gmail.com Thu May 22 14:24:26 2008 From: pipiten at gmail.com (Pedro Guridi) Date: Thu, 22 May 2008 15:24:26 -0300 Subject: [Gtk-sharp-list] gtk.entry validation difficulty In-Reply-To: <3d2f29dc0805211459n2e69687dxa682e2ee74522bc2@mail.gmail.com> References: <20080521214850.49a9fff6@io.solnet> <3d2f29dc0805211252l1def8f15pf6972f92e211c528@mail.gmail.com> <20080521220532.361f3d4e@io.solnet> <3d2f29dc0805211308y628e6697w34c0b8233529ae5b@mail.gmail.com> <20080521221815.1e95f5b6@io.solnet> <3d2f29dc0805211459n2e69687dxa682e2ee74522bc2@mail.gmail.com> Message-ID: <930bfd5c0805221124g64435eb7sa8f356db9ed15f8b@mail.gmail.com> Jesper, people, Here I found this short tutorial for restrict the input in a text entry only to numbers, quite useful.. maybe it's what are u looking for, it's in Spanish but I'm sure you can understand the code.., it also let you download a .tar.gz with the code. Link: http://www.developarts.com/limitar_la_captura_de_un_entry Regards, Pedro Guridi On Wed, May 21, 2008 at 6:59 PM, Chris Howie wrote: > On Wed, May 21, 2008 at 4:18 PM, Jesper K. Pedersen wrote: >> The software I am writing is for assisting aviation mechanics in >> registering their use of aircraft spare parts (I am the leader of an >> spare parts inventory in a small company). >> >> The form is a parts entry registration form where I have a range of >> fields - of which 4 needs to be validated and correct until the system >> accept to add the information to its central database. >> >> I fear that if the validation comes at the point of the mechanic being >> "done" with entering data (some is entered via a barcode reader) and >> there are problems the mechanic will have a difficulty resolving the >> issues. Some of the issues can actually force the mechanic to have to >> leave the terminal to get further data before he can finish up - so to >> assist the mechanic I have each field validated at entry time and the >> most significant done as the very first entry (dont know if that makes >> sense). >> >> I have also tried to make the system as "mechanic friendly" by having it >> tell you what is wrong with the entry - and where possible it >> will suggest what needs to be done to fix it (like suggesting >> partnumbers if a partnumber isnt recognized in the inventory system) > > Then checking on lost focus seems like the most appropriate thing to > do. Note that when I say validate, I do *not* mean the type of > validation that pops up horribly annoying dialog boxes on failure. > (We have stuff like that where I work. I could rant about it for > days.) I'm talking about the kind of validation that will annotate > invalid fields with some indicator and disable all mechanisms that > could be used to submit the form (like the Accept button). Clicking > the indicator could provide further explanation in a dialog. > > An even better idea would be to keep the error messages short and > display them below the field itself. > > I'm not sure how doing this on-blur would be an issue. > > -- > Chris Howie > http://www.chrishowie.com > http://en.wikipedia.org/wiki/User:Crazycomputers > _______________________________________________ > Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list > From mjamon at ntsp.nec.co.jp Fri May 23 07:18:43 2008 From: mjamon at ntsp.nec.co.jp (Marc Glenn) Date: Fri, 23 May 2008 19:18:43 +0800 Subject: [Gtk-sharp-list] Dialog in a Taskbar Message-ID: <4836A813.4010108@mnl.ntsp.nec.co.jp> Hello guys, I wanted to create a Pop-Up dialog for my application. But I want this pop-up dialog also to be accessible through the taskbar. I tried searching for the properties of Gtk.Window and Gtk.Dialog on how to do this but I can't find any. Does anyone know how I can do this in gtk-sharp? Btw, im using mono 1.2.6 and gtk-sharp 2.10 on Windows Xp. Thanks, Marc Glenn -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080523/7ca7bfce/attachment.html From adam at morrison-ind.com Fri May 23 08:31:57 2008 From: adam at morrison-ind.com (Adam Tauno Williams) Date: Fri, 23 May 2008 08:31:57 -0400 Subject: [Gtk-sharp-list] Dialog in a Taskbar In-Reply-To: <4836A813.4010108@mnl.ntsp.nec.co.jp> References: <4836A813.4010108@mnl.ntsp.nec.co.jp> Message-ID: <1211545917.4704.3.camel@WM_ADAM1.morrison.iserv.net> > I wanted to create a Pop-Up dialog for my application. > But I want this pop-up dialog also to be accessible through the > taskbar. > I tried searching for the properties of Gtk.Window and Gtk.Dialog on > how to do this but I can't find any. > Does anyone know how I can do this in gtk-sharp? > Btw, im using mono 1.2.6 and gtk-sharp 2.10 on Windows Xp. Add a button to the toolbar with an event handler that creates the dialog box. From cdhowie at gmail.com Fri May 23 08:37:57 2008 From: cdhowie at gmail.com (Chris Howie) Date: Fri, 23 May 2008 08:37:57 -0400 Subject: [Gtk-sharp-list] Dialog in a Taskbar In-Reply-To: <4836A813.4010108@mnl.ntsp.nec.co.jp> References: <4836A813.4010108@mnl.ntsp.nec.co.jp> Message-ID: <3d2f29dc0805230537p5be1e266ge189e1c7c6d6d8e7@mail.gmail.com> On Fri, May 23, 2008 at 7:18 AM, Marc Glenn wrote: > Hello guys, > > I wanted to create a Pop-Up dialog for my application. > But I want this pop-up dialog also to be accessible through the > taskbar. > > I tried searching for the properties of Gtk.Window and Gtk.Dialog on > how to do this but I can't find any. > > Does anyone know how I can do this in gtk-sharp? > > Btw, im using mono 1.2.6 and gtk-sharp 2.10 on Windows Xp. You might try: yourDialog.SkipTaskbarHint = false; -- Chris Howie http://www.chrishowie.com http://en.wikipedia.org/wiki/User:Crazycomputers From adam at morrison-ind.com Fri May 23 09:11:44 2008 From: adam at morrison-ind.com (Adam Tauno Williams) Date: Fri, 23 May 2008 09:11:44 -0400 Subject: [Gtk-sharp-list] gtk.entry validation difficulty In-Reply-To: <930bfd5c0805221124g64435eb7sa8f356db9ed15f8b@mail.gmail.com> References: <20080521214850.49a9fff6@io.solnet> <3d2f29dc0805211252l1def8f15pf6972f92e211c528@mail.gmail.com> <20080521220532.361f3d4e@io.solnet> <3d2f29dc0805211308y628e6697w34c0b8233529ae5b@mail.gmail.com> <20080521221815.1e95f5b6@io.solnet> <3d2f29dc0805211459n2e69687dxa682e2ee74522bc2@mail.gmail.com> <930bfd5c0805221124g64435eb7sa8f356db9ed15f8b@mail.gmail.com> Message-ID: <1211548304.4704.10.camel@WM_ADAM1.morrison.iserv.net> > Here I found this short tutorial for restrict the input in a text > entry only to numbers, quite useful.. maybe it's what are u looking > for, it's in Spanish but I'm sure you can understand the code.., it > also let you download a .tar.gz with the code. > Link: http://www.developarts.com/limitar_la_captura_de_un_entry Nice article, only problem I see is that it negates the ability to Tab / Shift-Tab to advance to the next or previous fields. I use - [GLib.ConnectBefore] protected virtual void OnEndKeyPressEvent (object o, Gtk.KeyPressEventArgs args) { if ((Array.IndexOf(dateChars, Convert.ToChar(args.Event.Key)) > -1) || (args.Event.Key == Gdk.Key.BackSpace) || (args.Event.Key == Gdk.Key.Tab) || (args.Event.Key == Gdk.Key.ISO_Left_Tab)) { args.RetVal = false; return; } args.RetVal = true; } /* end OnEndKeyPressEvent */ - where Array dateChars = "1234567890-".ToCharArray(); From cdhowie at gmail.com Fri May 23 14:05:44 2008 From: cdhowie at gmail.com (Chris Howie) Date: Fri, 23 May 2008 14:05:44 -0400 Subject: [Gtk-sharp-list] Dialog in a Taskbar In-Reply-To: <4836C8AF.7070906@mnl.ntsp.nec.co.jp> References: <4836A813.4010108@mnl.ntsp.nec.co.jp> <3d2f29dc0805230537p5be1e266ge189e1c7c6d6d8e7@mail.gmail.com> <4836C8AF.7070906@mnl.ntsp.nec.co.jp> Message-ID: <3d2f29dc0805231105w3a8544a1j165347cb501e4daa@mail.gmail.com> On Fri, May 23, 2008 at 9:37 AM, Marc Glenn wrote: > Hello Chris, > > I tried using Glade to create my dialogs and the skip taskbar property > works well if I set it using the Glade Interface Builder. > However, if I try to create my dialogs without using Glade, it does not > work even if I set the SkipTaskbarHint property to false. > > Attached is a sample code. > This code is compiling but the dialog "Sample" is not in the taskbar. > > Hope you can help me figure this out. > > Regards, > Marc Glenn Odd. In fact, false is the default value of that property anyway. Not sure I have an answer for this one... You might try asking the people in #gtk+ on Freenode too. They're pretty friendly to people using wrappers like Gtk#. -- Chris Howie http://www.chrishowie.com http://en.wikipedia.org/wiki/User:Crazycomputers From christian_hoff at gmx.net Sun May 25 14:30:14 2008 From: christian_hoff at gmx.net (Christian Hoff) Date: Sun, 25 May 2008 20:30:14 +0200 Subject: [Gtk-sharp-list] Support for custom GObject properties in Gtk# Message-ID: <4839B036.9060309@gmx.net> Hi, I have added a new feature to Gtk# which makes it possible to register managed properties within the GObject type system. A scenario where this feature proves really useful is when developing custom cell renderers and you want to set an attribute mapping to make it display the data of a tree model. So after having the attached patch applied(with "patch -p0 > patchfile" from the gtk-sharp svn directory) it is possible to write MyTreeView.AppendColumn("European article number", EANRenderer, "ean", 0); or MyColumn.AddAttribute(EANRenderer, "ean", 0); And in the cell renderer you could write: [GLib.RegisterPropertyAttribute("ean")] public System.Int64 EAN { get { // .... } set { // .... } } The patch was really a lot of work(although it is not as much new code as I have expected) and I would be great if you commit it to SVN or give me any feedback on the patch. I have also included a demo application with MonoDevelop which is attached, too. Christian Hoff -------------- next part -------------- A non-text attachment was scrubbed... Name: CellRendererAttributeTest.tar.gz Type: application/gzip Size: 5923 bytes Desc: not available Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080525/fdb3e890/attachment-0002.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: gtk-vtable-properties-patch.patch Type: text/x-diff Size: 11359 bytes Desc: not available Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080525/fdb3e890/attachment-0003.bin From mjamon at ntsp.nec.co.jp Mon May 26 02:05:37 2008 From: mjamon at ntsp.nec.co.jp (Marc Glenn) Date: Mon, 26 May 2008 14:05:37 +0800 Subject: [Gtk-sharp-list] How to Use TextTag Message-ID: <483A5331.7050001@mnl.ntsp.nec.co.jp> Hello guys, I am creating an application that uses Gtk.TextView. My problem is how can I format the text in the TextView like setting to bold, adjusting font-size, foreground color. Is this possible with TextTag? Do you know any sample code on how to use this? Thanks in advance. Regards, Marc Glenn From gtk-sharp-list at thomasweiser.de Mon May 26 08:05:16 2008 From: gtk-sharp-list at thomasweiser.de (Thomas Weiser) Date: Mon, 26 May 2008 14:05:16 +0200 Subject: [Gtk-sharp-list] How to Use TextTag In-Reply-To: <483A5331.7050001@mnl.ntsp.nec.co.jp> References: <483A5331.7050001@mnl.ntsp.nec.co.jp> Message-ID: <483AA77C.4080503@thomasweiser.de> Hello Marc, to apply formatting to portions of a text buffer you can use a TextTag like this: TextView textView = new TextView (); TextBuffer buffer = textView .Buffer; buffer .Text = "abcdefghijk"; TextTag tagBold = new TextTag ("bold"); tagBold .Weight = Pango .Weight .Bold; buffer .TagTable .Add (tagBold); TextIter iter1 = buffer .GetIterAtOffset (3); TextIter iter2 = buffer .GetIterAtOffset (6); buffer .ApplyTag (tagBold, iter1, iter2); You can find a longer example in the GtkDemo application that comes with GTK#. The relevant source file is also here: http://code.google.com/p/slickr-dotnet/source/browse/trunk/SlickrGtk/DemoTextView.cs?r=2 And there is a good tutorial for TextView here (it's written for the C-version of GTK+): http://www.bravegnu.org/gtktext/ Regards Thomas Weiser Marc Glenn schrieb: > Hello guys, > > I am creating an application that uses Gtk.TextView. > My problem is how can I format the text in the TextView like > setting to bold, adjusting font-size, foreground color. > > Is this possible with TextTag? Do you know any sample code on how > to use this? > Thanks in advance. > > Regards, > Marc Glenn > > _______________________________________________ > Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list > From adamtaunowilliams at gmail.com Mon May 12 16:09:44 2008 From: adamtaunowilliams at gmail.com (Adam Tauno Williams) Date: Mon, 12 May 2008 16:09:44 -0400 Subject: [Gtk-sharp-list] Printing Text for Multiple Pages In-Reply-To: <1208355027.19578.3.camel@inspidel.lan> References: <1208355027.19578.3.camel@inspidel.lan> Message-ID: <1210622984.4663.6.camel@WM_ADAM1.morrison.iserv.net> On Wed, 2008-04-16 at 08:10 -0600, John M. Anderson wrote: > I'm trying to fix the Tomboy print code to use GTK Printing rather than > gnome print... Thanks for the excellent BLOB post on this topic! From fr.daniil at gmail.com Tue May 20 04:04:14 2008 From: fr.daniil at gmail.com (daniil00) Date: Tue, 20 May 2008 01:04:14 -0700 (PDT) Subject: [Gtk-sharp-list] Gtk nonrectangular window Message-ID: <17335292.post@talk.nabble.com> Hy guys, Can you provide me with a code sample in making a non rectangular window in gtk? With winforms it was easy using the Region property, but I can't find something similar in gtk. -- View this message in context: http://www.nabble.com/Gtk-nonrectangular-window-tp17335292p17335292.html Sent from the Mono - Gtk# mailing list archive at Nabble.com. From fr.daniil at gmail.com Thu May 22 15:13:32 2008 From: fr.daniil at gmail.com (daniil00) Date: Thu, 22 May 2008 12:13:32 -0700 (PDT) Subject: [Gtk-sharp-list] Gtk nonrectangular window In-Reply-To: <17335292.post@talk.nabble.com> References: <17335292.post@talk.nabble.com> Message-ID: <17411467.post@talk.nabble.com> I figured out myself. If anyone else wants to know: public class WinUtil { public static bool ModifyWindowShape( System.Drawing.Bitmap bmp, Gtk.Window window ) { bool ret = false; try { //save bitmap to stream System.IO.MemoryStream stream = new System.IO.MemoryStream(); bmp.Save( stream, System.Drawing.Imaging.ImageFormat.Png ); //verry important: put stream on position 0 stream.Position = 0; //get the pixmap mask Gdk.Pixbuf buf = new Gdk.Pixbuf( stream, bmp.Width, bmp.Height ); Gdk.Pixmap map1, map2; buf.RenderPixmapAndMask( out map1, out map2, 255 ); //shape combine window window.ShapeCombineMask( map2, 0, 0 ); //dispose buf.Dispose(); map1.Dispose(); map2.Dispose(); bmp.Dispose(); //if evrything is ok return true; ret = true; } catch(Exception ex) { Console.WriteLine( ex.Message + "\r\n" + ex.StackTrace ); } return ret; } } and in your window class add this: using System.Drawing; [...] // initialize your form code here, and then: this.ShowAll(); Bitmap bmp = new Bitmap( 640, 480 ); Graphics g = Graphics.FromImage( bmp ); Brush b = new SolidBrush( Color.Red ); g.FillEllipse( b, 0,0,bmp.Width,bmp.Height ); g.Dispose(); WinUtil.ModifyWindowShape( bmp, this ); daniil00 wrote: > > Hy guys, > > Can you provide me with a code sample in making a non rectangular window > in gtk? > With winforms it was easy using the Region property, but I can't find > something similar in gtk. > > > -- View this message in context: http://www.nabble.com/Gtk-nonrectangular-window-tp17335292p17411467.html Sent from the Mono - Gtk# mailing list archive at Nabble.com. From vladimir.giszpenc at gmail.com Wed May 28 09:38:08 2008 From: vladimir.giszpenc at gmail.com (Vladimir Giszpenc) Date: Wed, 28 May 2008 09:38:08 -0400 Subject: [Gtk-sharp-list] NodeStore Message-ID: <8ed5cbac0805280638oc592ad2v42444765f99cf2@mail.gmail.com> Hi all, Is there an easy way to check if a NodeStore contains a Node? I see the Data property but I am not sure if it is what I need. There is Add and Remove, but no Contains on the NodeStore itself. Is this omission by design and is it something that could change? Thanks! Vlad From elmar at haneke.de Fri May 30 03:12:56 2008 From: elmar at haneke.de (Elmar Haneke) Date: Fri, 30 May 2008 09:12:56 +0200 Subject: [Gtk-sharp-list] Exception in TimooutProxy.Handler Message-ID: <483FA8F8.1000603@haneke.de> What can raise this error? It seems to happen on some Windows Machines: Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object at (wrapper native-to-managed) TimeoutProxy.Handler () <0x00000> at (wrapper managed-to-native) Gtk.Application.gtk_main () <0x00004> at Gtk.Application.Run () <0x00007> at DlgUtils.DlgTools.RunApplication () <0x00032> at TurboPlaner.MainClass.Main (string[]) <0x0009a> From david.anes at gmail.com Fri May 30 10:26:27 2008 From: david.anes at gmail.com (David Anes) Date: Fri, 30 May 2008 16:26:27 +0200 Subject: [Gtk-sharp-list] GtkGLArea Sharp for Windows In-Reply-To: <4818DC75.8040403@terra.cl> References: <1209160832.10706.118.camel@cjac.intra.cardomain.com> <25D7CB21-4C3D-4159-9C49-2D23473E77DF@colliertech.org> <48178475.9090600@terra.cl> <4818DC75.8040403@terra.cl> Message-ID: <12783c860805300726m253109c6o728957b508b9b78a@mail.gmail.com> ?Maybe someone can add support for Gtk Quartz under MacOS to this managed gl widget? 2008/4/30 Mauricio Henriquez : > Is great man!!!, work like a charm.., finally a really cross-plataform > gl windget for Gtk, is really great!!!, the GtkGlArea is a really > mess...I have a GtkVideoPlayer that can play v4l sources and is based in > the DrawingArea widget, with this widget I can use the texture > performance of opengl to improve the videoplayer widget!!!... > > Thanks a gain for such a great controll.. > > Mauricio > > James Talton wrote: >> Gtk.GLWidget for GtkSharp >> http://www.golem3d.com/?q=node/40 >> >> After several requests and questions from different sources I decided >> to look into getting the GLWidget code working better on Linux. (Using >> Ubuntu 8.04) >> * Code works beautifully under Linux and Windows. >> * Compiled library that acts as a widget library for MonoDevelop. >> * Example project and executable on web site. >> >> I would love to hear about any successes or questions. >> James > > _______________________________________________ > Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list > -- David "kraptor" Anes Alcolea http://www.kraptor.com From fr.daniil at gmail.com Sat May 31 14:45:57 2008 From: fr.daniil at gmail.com (daniil00) Date: Sat, 31 May 2008 11:45:57 -0700 (PDT) Subject: [Gtk-sharp-list] Gtk-sharp widget library released ! Message-ID: <17578339.post@talk.nabble.com> Hy there, I'm proud to present you with my last two weeks work - a gtk-sharp custom control library compatible 100% with monodevelop/stetic. Url: http://code.google.com/p/holly-gtk-widgets/ (yeah, I have screen shots there ) Widgets ( custom controls ) in holly-widgets library: HFontPicker - A office like font picker widget HDateEdit - A date-time picker supporting custom formatting options HSimpleList - A simple list widget, inspired by the Winforms Listbox control ( has the nice Items collection, the OwnerDrawn property and the OnMeasureItem, OnDrawItem events ). HSimpleComboBox - A simple combobox widget, inspired by the Winforms Combobox control HRegExEntry - A simple entry with regular expressions validation. Has a small icon that changes if the content is valid or invalid. HColorPicker - A simple color picker drop-down ( office like ) HToolTip - A nice ballon tooltip window HIpEntry - A widget that alows the user to enter an IPv4 address HTreeView - A simple to use TreeView? widget, similar to the winforms one HComboTree - A easy to use combobox with a treeview ( HTreeView ) inside HComboFolder - A combobox widget with a folder tree popup Hope you will enjoy this and excuse my bad English. Daniel. -- View this message in context: http://www.nabble.com/Gtk-sharp-widget-library-released-%21-tp17578339p17578339.html Sent from the Mono - Gtk# mailing list archive at Nabble.com. From pipiten at gmail.com Sat May 31 14:59:40 2008 From: pipiten at gmail.com (Pedro Guridi) Date: Sat, 31 May 2008 15:59:40 -0300 Subject: [Gtk-sharp-list] Gtk-sharp widget library released ! In-Reply-To: <17578339.post@talk.nabble.com> References: <17578339.post@talk.nabble.com> Message-ID: <930bfd5c0805311159y6e4aeee7x2fe82a794d4189f6@mail.gmail.com> Hi!, Great job!.. congratulations!. I found the HRegExEntry incredible usefull!!. Thanks for your contribution. Regards, Pedro Guridi On Sat, May 31, 2008 at 3:45 PM, daniil00 wrote: > > Hy there, > > I'm proud to present you with my last two weeks work - a gtk-sharp custom > control library compatible 100% with monodevelop/stetic. > > Url: http://code.google.com/p/holly-gtk-widgets/ (yeah, I have screen shots > there ) > > Widgets ( custom controls ) in holly-widgets library: > > HFontPicker - A office like font picker widget > HDateEdit - A date-time picker supporting custom formatting options > HSimpleList - A simple list widget, inspired by the Winforms Listbox control > ( has the nice Items collection, the OwnerDrawn property and the > OnMeasureItem, OnDrawItem events ). > HSimpleComboBox - A simple combobox widget, inspired by the Winforms > Combobox control > HRegExEntry - A simple entry with regular expressions validation. Has a > small icon that changes if the content is valid or invalid. > HColorPicker - A simple color picker drop-down ( office like ) > HToolTip - A nice ballon tooltip window > HIpEntry - A widget that alows the user to enter an IPv4 address > HTreeView - A simple to use TreeView? widget, similar to the winforms one > HComboTree - A easy to use combobox with a treeview ( HTreeView ) inside > HComboFolder - A combobox widget with a folder tree popup > > Hope you will enjoy this and excuse my bad English. > > Daniel. > -- > View this message in context: http://www.nabble.com/Gtk-sharp-widget-library-released-%21-tp17578339p17578339.html > Sent from the Mono - Gtk# mailing list archive at Nabble.com. > > _______________________________________________ > Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list > From awilliam at whitemice.org Sat May 31 17:33:21 2008 From: awilliam at whitemice.org (Adam Tauno Williams) Date: Sat, 31 May 2008 17:33:21 -0400 Subject: [Gtk-sharp-list] Gtk-sharp widget library released ! In-Reply-To: <17578339.post@talk.nabble.com> References: <17578339.post@talk.nabble.com> Message-ID: <1212269601.7694.26.camel@aleph> > I'm proud to present you with my last two weeks work - a gtk-sharp custom > control library compatible 100% with monodevelop/stetic. > Url: http://code.google.com/p/holly-gtk-widgets/ (yeah, I have screen shots > there ) > Widgets ( custom controls ) in holly-widgets library: > HFontPicker - A office like font picker widget > HDateEdit - A date-time picker supporting custom formatting options Sweet! Finally a decent date picker. As soon as my mono/cairo catches up with the version you used I'll certainly use these. They look really nice. Ever thought of making a nice calendar widget? I've got the start of one but currently not the time to polish/finish it ? Or maybe my code is so horrible it isn't worth looking at. :) -- Consonance: an Open Source .NET OpenGroupware client. Contact:awilliam at whitemiceconsulting.com http://freshmeat.net/projects/consonance/ From fr.daniil at gmail.com Sat May 31 18:01:48 2008 From: fr.daniil at gmail.com (daniil00) Date: Sat, 31 May 2008 15:01:48 -0700 (PDT) Subject: [Gtk-sharp-list] Gtk-sharp widget library released ! In-Reply-To: <1212269601.7694.26.camel@aleph> References: <17578339.post@talk.nabble.com> <1212269601.7694.26.camel@aleph> Message-ID: <17580032.post@talk.nabble.com> Thanks ! Sound's exciting, I've never done a control like that. Any winforms calendar control that you've seen and like ? I will add it for sure in my todo list for the 2.0 version of holly-widgets. If you are an adept with Gtk# and would be willing to take a look at our use of Gtk#'s ... calendar widget code and to offer us concrete suggestions to make it better/faster we'd almost certainly be willing to send you pizza/beverage-of-your-choice! Waiting for the beer :) Adam Tauno Williams wrote: > >> I'm proud to present you with my last two weeks work - a gtk-sharp custom >> control library compatible 100% with monodevelop/stetic. >> Url: http://code.google.com/p/holly-gtk-widgets/ (yeah, I have screen >> shots >> there ) >> Widgets ( custom controls ) in holly-widgets library: >> HFontPicker - A office like font picker widget >> HDateEdit - A date-time picker supporting custom formatting options > > Sweet! Finally a decent date picker. As soon as my mono/cairo catches > up with the version you used I'll certainly use these. They look really > nice. > > Ever thought of making a nice calendar widget? I've got the start of > one but currently not the time to polish/finish it > ? Or maybe my code > is so horrible it isn't worth looking at. :) > -- > Consonance: an Open Source .NET OpenGroupware client. > Contact:awilliam at whitemiceconsulting.com > http://freshmeat.net/projects/consonance/ > > _______________________________________________ > Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list > > -- View this message in context: http://www.nabble.com/Gtk-sharp-widget-library-released-%21-tp17578339p17580032.html Sent from the Mono - Gtk# mailing list archive at Nabble.com. From awilliam at whitemice.org Sat May 31 18:26:12 2008 From: awilliam at whitemice.org (Adam Tauno Williams) Date: Sat, 31 May 2008 18:26:12 -0400 Subject: [Gtk-sharp-list] Gtk-sharp widget library released ! In-Reply-To: <17580032.post@talk.nabble.com> References: <17578339.post@talk.nabble.com> <1212269601.7694.26.camel@aleph> <17580032.post@talk.nabble.com> Message-ID: <1212272772.7694.35.camel@aleph> > Sound's exciting, I've never done a control like that. Any winforms > calendar control that you've seen and like ? There are several commercial ones. The only Open Source one I've seen was with "monocalendar" which is unmaintained, and possibly incomplete. I originally based mine very roughly off their code. Commercials ones are and here > I will add it for sure in my todo list for the 2.0 version of holly-widgets. > If you are an adept with Gtk# and would be willing to take a look at our use > of Gtk#'s ... calendar widget code and to offer us concrete suggestions to > make it better/faster we'd almost certainly be willing to send you > pizza/beverage-of-your-choice! I'm certainly not! I've muddle through, on a good day. But I'm certainly willing to co-operate with anyone on making a decent calendar. Basically I'm just trying to make something that displays n-number of days and unto which events can be placed. The widget handles the packing for overlapping events (what I find to be the really hard part). Events can be dragged around and right-clicked for a context menu. Dragging is crude but it works. The ability to set event color and possibly an icon would be nice. Multi-day events currently work. It might be better if each event was its own event box - not sure. This calendar is in its own DLL, code is at in the trunk/Gtk/Calendar folder. From olivier at lethanh.be Sat May 31 19:23:58 2008 From: olivier at lethanh.be (Olivier Le Thanh Duong) Date: Sun, 1 Jun 2008 01:23:58 +0200 Subject: [Gtk-sharp-list] Gtk-sharp widget library released ! In-Reply-To: <1212272772.7694.35.camel@aleph> References: <17578339.post@talk.nabble.com> <1212269601.7694.26.camel@aleph> <17580032.post@talk.nabble.com> <1212272772.7694.35.camel@aleph> Message-ID: <9f171cf00805311623r1529b9e8s774661ec1c6c1236@mail.gmail.com> 2008/6/1 Adam Tauno Williams : >> Sound's exciting, I've never done a control like that. Any winforms >> calendar control that you've seen and like ? > > There are several commercial ones. The only Open Source one I've seen > was with "monocalendar" which is unmaintained, and possibly incomplete. > I originally based mine very roughly off their code. > > Commercials ones are and here > > >> I will add it for sure in my todo list for the 2.0 version of holly-widgets. >> If you are an adept with Gtk# and would be willing to take a look at our use >> of Gtk#'s ... calendar widget code and to offer us concrete suggestions to >> make it better/faster we'd almost certainly be willing to send you >> pizza/beverage-of-your-choice! > > I'm certainly not! I've muddle through, on a good day. But I'm > certainly willing to co-operate with anyone on making a decent calendar. > > Basically I'm just trying to make something that displays n-number of > days and unto which events can be placed. The widget handles the > packing for overlapping events (what I find to be the really hard part). > Events can be dragged around and right-clicked for a context menu. > Dragging is crude but it works. The ability to set event color and > possibly an icon would be nice. Multi-day events currently work. It > might be better if each event was its own event box - not sure. > > This calendar is in its own DLL, code is at > in the > trunk/Gtk/Calendar folder. Pimlico Dates [1] has a pretty good calendar widget in GTK, with several level of view : date, week, year. Unfortunately it's written in C, but it might be easier to port it to GTK# or create a binding than recreating a whole new widget. Olivier L? Thanh Duong. [1] http://pimlico-project.org/dates.html From mhenriquezs at terra.cl Sat May 31 21:23:44 2008 From: mhenriquezs at terra.cl (Mauricio Henriquez) Date: Sat, 31 May 2008 21:23:44 -0400 Subject: [Gtk-sharp-list] Gtk-sharp widget library released ! In-Reply-To: <17578339.post@talk.nabble.com> References: <17578339.post@talk.nabble.com> Message-ID: <4841FA20.3090605@terra.cl> really great man!!, congratulations.. Mauricio daniil00 wrote: > Hy there, > > I'm proud to present you with my last two weeks work - a gtk-sharp custom > control library compatible 100% with monodevelop/stetic. > > Url: http://code.google.com/p/holly-gtk-widgets/ (yeah, I have screen shots > there ) > > Widgets ( custom controls ) in holly-widgets library: > > HFontPicker - A office like font picker widget > HDateEdit - A date-time picker supporting custom formatting options > HSimpleList - A simple list widget, inspired by the Winforms Listbox control > ( has the nice Items collection, the OwnerDrawn property and the > OnMeasureItem, OnDrawItem events ). > HSimpleComboBox - A simple combobox widget, inspired by the Winforms > Combobox control > HRegExEntry - A simple entry with regular expressions validation. Has a > small icon that changes if the content is valid or invalid. > HColorPicker - A simple color picker drop-down ( office like ) > HToolTip - A nice ballon tooltip window > HIpEntry - A widget that alows the user to enter an IPv4 address > HTreeView - A simple to use TreeView? widget, similar to the winforms one > HComboTree - A easy to use combobox with a treeview ( HTreeView ) inside > HComboFolder - A combobox widget with a folder tree popup > > Hope you will enjoy this and excuse my bad English. > > Daniel. > From awilliam at whitemice.org Sat May 31 21:58:22 2008 From: awilliam at whitemice.org (Adam Tauno Williams) Date: Sat, 31 May 2008 21:58:22 -0400 Subject: [Gtk-sharp-list] Gtk-sharp widget library released ! In-Reply-To: <9f171cf00805311623r1529b9e8s774661ec1c6c1236@mail.gmail.com> References: <17578339.post@talk.nabble.com> <1212269601.7694.26.camel@aleph> <17580032.post@talk.nabble.com> <1212272772.7694.35.camel@aleph> <9f171cf00805311623r1529b9e8s774661ec1c6c1236@mail.gmail.com> Message-ID: <1212285502.7694.39.camel@aleph> > > Basically I'm just trying to make something that displays n-number of > > days and unto which events can be placed. The widget handles the > > packing for overlapping events (what I find to be the really hard part). > > Events can be dragged around and right-clicked for a context menu. > > Dragging is crude but it works. The ability to set event color and > > possibly an icon would be nice. Multi-day events currently work. It > > might be better if each event was its own event box - not sure. > > This calendar is in its own DLL, code is at > > in the > > trunk/Gtk/Calendar folder. > Pimlico Dates [1] has a pretty good calendar widget in GTK, with > several level of view : date, week, year. That does look nice , do you now if it handles overlapping events? > Unfortunately it's written > in C, but it might be easier to port it to GTK# or create a binding > than recreating a whole new widget. I'd much prefer a managed widget to a binding.