[Gtk-sharp-list] Gtk-sharp-list Digest, Vol 34, Issue 5

Darwin Reynoso monouser at gmail.com
Mon Feb 11 22:36:05 EST 2008


On Mon, Feb 11, 2008 at 12:18 PM,
<gtk-sharp-list-request at lists.ximian.com> wrote:
> Send Gtk-sharp-list mailing list submissions to
>         gtk-sharp-list at lists.ximian.com
>
>  To subscribe or unsubscribe via the World Wide Web, visit
>         http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
>  or, via email, send a message with subject or body 'help' to
>         gtk-sharp-list-request at lists.ximian.com
>
>  You can reach the person managing the list at
>         gtk-sharp-list-owner at lists.ximian.com
>
>  When replying, please edit your Subject line so it is more specific
>  than "Re: Contents of Gtk-sharp-list digest..."
>
>
>  Today's Topics:
>
>    1. More finetuned error/exception handling in gapi (Philip Van Hoof)
>    2. Help with GTK sharp (Dan Smithers)
>    3. Re: Help with GTK sharp (Mikkel Kruse Johnsen)
>    4. problem building c#-bindings for libccc (Sascha Dewald)
>    5. problem building c#-bindings for libccc (Sascha Dewald)
>    6. Re: Help with GTK sharp (Adam Tauno Williams)
>    7. Re: Help, textview (Chris Howie)
>    8. Re: Help with GTK sharp (Andrew York)
>
>
>  ----------------------------------------------------------------------
>
>  Message: 1
>  Date: Sun, 10 Feb 2008 22:39:46 +0100
>  From: Philip Van Hoof <spam at pvanhoof.be>
>  Subject: [Gtk-sharp-list] More finetuned error/exception handling in
>         gapi
>  To: gtk-sharp-list at lists.ximian.com
>  Message-ID: <1202679586.8450.138.camel at schtrumpf>
>  Content-Type: text/plain
>
>  I noticed this one in MethodBody.cs:
>
>  public void HandleException (StreamWriter sw, string indent)
>  {
>         if (!ThrowsException)
>                 return;
>         sw.WriteLine (indent + "\t\t\tif (error != IntPtr.Zero) throw new GLib.GException (error);");
>  }
>
>  It would be nicer if I could put an exception creator here, in stead of
>  having to use GException. For example one that creates me a specific
>  type of Exception depending on the GError's domain and error code.
>
>  Just like last question, the one about the asynchronous APIs, is
>  something in place already to do this kind of things?
>
>  I took a look at GLib.ExceptionManager.UnhandledException but this
>  infrastructure doesn't make it possible for me to turn my exceptions
>  into specific ones.
>
>
>  I was thinking about something like this:
>
>  <add-node path="/api"><symbol name="ExceptionFactory" creater="Tny.ExceptionFactory.Create" /></add-node>
>
>
>  public class ExceptionFactory {
>         static ExceptionFactory instance = null;
>
>         static ExceptionFactory Instance {
>                 if (instance == null)
>                         instance = new ExceptionFactory ();
>                 return instance;
>         }
>
>         XmlElement elem = null;
>         public XmlElement Elem {
>                 get { return elem; }
>                 set { elem = value; }
>         }
>
>         public override string ToString () {
>                 if (elem != null)
>                         return elem.GetAttribute ("creater");
>                 return "new GLib.GException";
>         }
>  }
>
>  public void HandleException (StreamWriter sw, string indent)
>  {
>         if (!ThrowsException)
>                 return;
>         sw.WriteLine (indent + "\t\t\tif (error != IntPtr.Zero) throw {0} (error);",
>                 ExceptionFactory.Instance.ToString(););
>  }
>
>  And at Parser.cs:74:
>
>  case "symbol":
>  if (elem.GetAttribute ("name") == "ExceptionFactory")
>         ExceptionFactory.Instance.Elem = elem;
>  else
>         gens.Add (ParseSymbol (elem));
>  break;
>
>
>  --
>  Philip Van Hoof, freelance software developer
>  home: me at pvanhoof dot be
>  gnome: pvanhoof at gnome dot org
>  http://pvanhoof.be/blog
>  http://codeminded.be
>
>
>
>  ------------------------------
>
>  Message: 2
>  Date: Mon, 11 Feb 2008 12:02:53 +0000
>  From: Dan Smithers <dsmithers at talktalk.net>
>  Subject: [Gtk-sharp-list] Help with GTK sharp
>  To: gtk-sharp-list at lists.ximian.com
>  Message-ID: <47B0396D.4090802 at talktalk.net>
>  Content-Type: text/plain; charset=ISO-8859-1
>
>  Can anyone suggest a good reference for GTK sharp? I am struggling a bit
>  finding out how to use the interface as it seems to be different from
>  both GTK and .Net.
>
>  My current problem is trying to set the initial state of a combo box and
>  to get the result.
>
>  thanks
>
>  dan
>
>
>  ------------------------------
>
>  Message: 3
>  Date: Mon, 11 Feb 2008 13:37:12 +0100
>  From: Mikkel Kruse Johnsen <mikkel at linet.dk>
>  Subject: Re: [Gtk-sharp-list] Help with GTK sharp
>  To: Dan Smithers <dsmithers at talktalk.net>
>  Cc: gtk-sharp-list at lists.ximian.com
>  Message-ID: <1202733432.5529.6.camel at tux.lib.cbs.dk>
>  Content-Type: text/plain; charset="utf-8"
>
>  Hi Dan
>
>  The best is to look at the API http://www.go-mono.com/docs/
>
>  You say that it is different from GTK and .Net, not really sure what you
>  mean. Gtk-sharp is a wrapping of Gtk so it is eksactly the same, so
>  looking for examples written in C is easily converted to C#.
>
>  In the API of the Gtk.ComboBox you will se the Method: "SetActiveIter"
>  and "GetActiveIter" those are the functions you are looking for.
>
>  /Mikkel
>
>  On Mon, 2008-02-11 at 12:02 +0000, Dan Smithers wrote:
>
>  > Can anyone suggest a good reference for GTK sharp? I am struggling a bit
>  > finding out how to use the interface as it seems to be different from
>  > both GTK and .Net.
>  >
>  > My current problem is trying to set the initial state of a combo box and
>  > to get the result.
>  >
>  > thanks
>  >
>  > dan
>  > _______________________________________________
>  > Gtk-sharp-list maillist  -  Gtk-sharp-list at lists.ximian.com
>  > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
>
>  Med Venlig Hilsen / Kind Regards
>
>
>  Mikkel Kruse
>  Johnsen
>  Adm.Dir.
>
>  Linet
>  ?rholmgade 6 st tv
>  Copenhagen N 2200
>  Denmark
>
>  Work:    +45
>  21287793
>  Mobile: +45
>  21287793
>  Email:
>  mikkel at linet.dk
>  IM:
>  mikkel at linet.dk
>  (MSN)
>   Professional
>  Profile
>  Healthcare
>
>
>  Network
>  Consultant
>  -------------- next part --------------
>  An HTML attachment was scrubbed...
>  URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080211/10438a85/attachment-0001.html
>


Hi Dan, if you're using monodevelop then try this


protected virtual void onBtn1Clicked(object sender, System.EventArgs e)
{
	combobox.AppendText("item");    //get the idea
}

protected virtual void onBtn2Clicked(object sender, System.EventArgs e)
{
	Console.WriteLine("Item currently selected...{0}",combobox.ActiveText);
	
        Console.WriteLine("Index of selected
item...{0}",combobox.Active.ToString());
}

i hope this work for you

>  ------------------------------
>
>  Message: 4
>  Date: Mon, 11 Feb 2008 15:25:15 +0100
>  From: Sascha Dewald <sascha.dewald at googlemail.com>
>  Subject: [Gtk-sharp-list] problem building c#-bindings for libccc
>  To: gtk-sharp-list at lists.ximian.com
>  Message-ID: <47B05ACB.1000506 at googlemail.com>
>  Content-Type: text/plain; charset="iso-8859-15"
>
>  i have problems, building c#-bindings for libccc.
>
>  so i created two a patches (see attchments) - for gapi2-parser and
>  gapi2-codegen.
>
>  with this patches the creation of the c#-bindings will work.
>
>  please, have a look at the second regex, i think it should work fine,
>  and for libccc it does work, but i am unsure if it has any side-effect's
>  for building it against other c#-bindings
>
>  best regards
>  echnaton
>
>
>
>
>
>  -------------- next part --------------
>  A non-text attachment was scrubbed...
>  Name: patch_gtk-sharp-2.10.2.diff
>  Type: text/x-patch
>  Size: 550 bytes
>  Desc: not available
>  Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080211/76ba8fc6/attachment-0002.bin
>  -------------- next part --------------
>  A non-text attachment was scrubbed...
>  Name: patch_gtk-sharp-2.10.2__second.diff
>  Type: text/x-patch
>  Size: 493 bytes
>  Desc: not available
>  Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080211/76ba8fc6/attachment-0003.bin
>
>  ------------------------------
>
>  Message: 5
>  Date: Mon, 11 Feb 2008 15:30:25 +0100
>  From: Sascha Dewald <sascha.dewald at googlemail.com>
>  Subject: [Gtk-sharp-list] problem building c#-bindings for libccc
>  To: gtk-sharp-list at lists.ximian.com
>  Message-ID: <47B05C01.5060202 at googlemail.com>
>  Content-Type: text/plain; charset="iso-8859-15"
>
>  i have problems, building c#-bindings for libccc.
>
>  so i created two a patches (see attchments) - for gapi2-parser and
>  gapi2-codegen.
>
>  with this patches the creation of the c#-bindings will work.
>
>  please, have a look at the second regex, i think it should work fine,
>  and for libccc it does work, but i am unsure if it has any side-effect's
>  for building it against other c#-bindings
>
>  best regards
>  echnaton
>
>
>
>
>
>
>  -------------- next part --------------
>  A non-text attachment was scrubbed...
>  Name: patch_gtk-sharp-2.10.2.diff
>  Type: text/x-patch
>  Size: 550 bytes
>  Desc: not available
>  Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080211/7b435877/attachment-0002.bin
>  -------------- next part --------------
>  A non-text attachment was scrubbed...
>  Name: patch_gtk-sharp-2.10.2__second.diff
>  Type: text/x-patch
>  Size: 494 bytes
>  Desc: not available
>  Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080211/7b435877/attachment-0003.bin
>
>  ------------------------------
>
>  Message: 6
>  Date: Mon, 11 Feb 2008 10:19:07 -0500
>  From: Adam Tauno Williams <adam at morrison-ind.com>
>  Subject: Re: [Gtk-sharp-list] Help with GTK sharp
>  To: gtk-sharp-list at lists.ximian.com
>  Message-ID: <20080211101907.0uex5mc0sgk0s4sk at tyr.morrison.iserv.net>
>  Content-Type: text/plain;       charset=ISO-8859-1;     DelSp="Yes";
>         format="flowed"
>
>  > Can anyone suggest a good reference for GTK sharp?
>
>  Other than monodoc, no.  Fortunately there is more and more Gtk# code
>  around to look at.
>
>  http://www.mono-project.com/GtkSharp#Other_Gtk.23_Tutorials &
>  http://www.mono-project.com/GtkSharp#Beginning_to_use_GTK.23
>  has some stuff
>
>  > I am struggling a bit
>  > finding out how to use the interface as it seems to be different from
>  > both GTK and .Net.
>
>  I'm not clear on what you mean.  ".Net" isn't a UI toolkit, so that is
>  apples and oranges.  Gtk# is itself just a wrapper around Gtk;  which
>  means you can [*theoretically*] use examples in C,  but unless you are
>  pretty familiar with C that isn't very helpful.
>
>  > My current problem is trying to set the initial state of a combo box and
>  > to get the result.
>
>  Active & ActiveText / GetActiveIter
>
>
>
>  ------------------------------
>
>  Message: 7
>  Date: Mon, 11 Feb 2008 11:10:19 -0500
>  From: "Chris Howie" <cdhowie at gmail.com>
>  Subject: Re: [Gtk-sharp-list] Help, textview
>  To: "Darwin Reynoso" <monouser at gmail.com>,
>         gtk-sharp-list at lists.ximian.com
>  Message-ID:
>         <3d2f29dc0802110810l642f7e0bt83d5f22f9daf2a80 at mail.gmail.com>
>  Content-Type: text/plain; charset=UTF-8
>
>  On Feb 8, 2008 9:04 AM, Darwin Reynoso <monouser at gmail.com> wrote:
>  > Hi,
>  > how do i select a line in a textview.
>
>  private void SelectLine(TextView view, int line) {
>         TextBuffer buffer = view.Buffer;
>
>         TextIter start = buffer.GetIterAtLine(line);
>         TextIter end = buffer.GetIterAtLine(line + 1);
>
>         buffer.SelectRange(start, end);
>  }
>
>  P.S. Documentation is a wonderful thing.
>
>  --
>  Chris Howie
>  http://www.chrishowie.com
>  http://en.wikipedia.org/wiki/User:Crazycomputers
>
>
>  ------------------------------
>
>  Message: 8
>  Date: Mon, 11 Feb 2008 11:47:21 -0500
>  From: Andrew York <andy at brdstudio.net>
>  Subject: Re: [Gtk-sharp-list] Help with GTK sharp
>  To: Dan Smithers <dsmithers at talktalk.net>
>  Cc: gtk-sharp-list at lists.ximian.com
>  Message-ID: <47B07C19.70105 at brdstudio.net>
>  Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
>  If you know what you are looking for I will usually search
>  http://www.krugle.org/ and look at existing projects that use what I am
>  working with.
>
>  I hope that helps
>
>  Dan Smithers wrote:
>  > Can anyone suggest a good reference for GTK sharp? I am struggling a bit
>  > finding out how to use the interface as it seems to be different from
>  > both GTK and .Net.
>  >
>  > My current problem is trying to set the initial state of a combo box and
>  > to get the result.
>  >
>  > thanks
>  >
>  > dan
>  > _______________________________________________
>  > Gtk-sharp-list maillist  -  Gtk-sharp-list at lists.ximian.com
>  > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
>  >
>
>
>
>
>
>
>  ------------------------------
>
>  _______________________________________________
>  Gtk-sharp-list mailing list
>  Gtk-sharp-list at lists.ximian.com
>  http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
>
>
>  End of Gtk-sharp-list Digest, Vol 34, Issue 5
>  *********************************************
>


More information about the Gtk-sharp-list mailing list