[Gtk-sharp-list] Using GTK# on MS Windows and Linux. Questions
from a Mono newbie.
Simon Bain
sibain at tendotzero.com
Thu Mar 2 13:14:21 EST 2006
Hi
Sorry I am just replying to this to add it to the list (my fault when I
replied to you :-(
Cheers
Simon
--
Simon Bain
TENdotZERO
Mobile: 07793 769 846
Office: 0845 056 3377 - 44 (0) 1234 359090
Fax: 44 (0) 208 882 9411
<quote who="Redefined Horizons">
> Simon and Wes.
>
> You guys have helped immensley. Let me make sure I understand this
> correctly:
>
> In Mono we parse the Glade XML file to build the GUI at runtime, but
> we must write our own event handling code.
>
> If I am understanding this process correctly, then it makes perfect
> sense. I think I have a handle know on Glade's role in GUI design
> using GTK#.
>
> I'll wait for the answers to my other questions. :]
>
> Scott
>
> On 3/2/06, Simon Bain <sibain at tendotzero.com> wrote:
>> Hi.
>>
>> I am unable to answer all of your questions, but while waiting for
>> others
>> with more answers and in a bid to help yopu get started I will try on
>> some.
>>
>> > How do you use Glade to design GTK# applications?
>>
>> If you open glade and click on to "New" then New GTK+ Project (linux
>> use)
>> This will give you a new window. In the properties window you can then
>> change the title etc.
>> In the pallete you will see the top level GTK+Basic. In here you have a
>> few important widgets
>> HorizontalBox, VerticalBox, Fixed Position.
>>
>> These are all positioners for other widgets and are important. If I use
>> glade the one I use is Fixed. However it does have a few problems if you
>> wish to localise your app, because of the way other widgets are placed
>> and
>> fixed to it. However as a starting point it is excellent.
>>
>> When you save your file DO NOT compile. As you will not be using the C
>> code generated.
>>
>> OK I use C# so that is what I shall stay with. Whether GTK# works with
>> VB
>> I am unsure however I am guessing that it does not.
>>
>> In you app file you will need to add code in the class to initialise the
>> glade file and start the app:
>>
>> public myComputer(string[] args){
>>
>> try{
>> Application.Init();
>> Glade.XML gxml = new
>> Glade.XML("mycomputer.glade",
>> "mainWindow", null);
>> gxml.Autoconnect(this);
>> }
>> catch(Exception ex)
>> {
>> if(bDebug)
>> Console.WriteLine(ex.Message);
>> }
>>
>> Application.Init() //Initialises
>> Glade.XML. gxml = new Glade.XML("mycomputer.glade", "mainWindow", null);
>> // Sets the glade file and the main form
>> gxml.Autoconnect(this); //sets it in motion.
>>
>> If you are calling any of your widgets directly from the app, then you
>> have to name them in the class decleration EG
>> [Widget]ToolButton toolbutton1 = null; // This is a widget in the glade
>> file
>> While ToolButton tb = null; //Would be a new one dynamically created (no
>> [Widget]).
>>
>> Now after saying all of that. Glade is excellent but it will add another
>> file and a small overhead to your app. To use GTK# you do not need
>> glade.
>> It is possible (if not a little tricky) to create a user interface
>> within
>> the code directly and disense with teh glade xml file.
>>
>>
>> GTK# is directly related to GTK+ as far as the widgets are concerned.
>> The
>> calling code is different C# not C or C++, and you do not generate the
>> code with Glade.
>>
>>
>> OK as far as the other questions are concerned I will leave that to
>> others.
>>
>> If you would like a couple of example apps to look at one with a glade
>> file and one without please email me and I will send them over.
>>
>> All the bet
>>
>> Simon
>> --
>> Simon Bain
>> TENdotZERO
>> Mobile: 07793 769 846
>> Office: 0845 056 3377 - 44 (0) 1234 359090
>> Fax: 44 (0) 208 882 9411
>>
>> <quote who="Redefined Horizons">
>> > I am currently in the planning stages of an application that I was
>> > orignally going to write in SharpDevelop for Microsoft Windows.
>> > However, I have recently begun to use Linux as an operating system,
>> > and I would like to also support my application on Linux via Mono. So
>> > I had some newbie questions about GTK#. I appreciate your patience
>> > with my efforts to learn about this technology. :]
>> >
>> > Here are my questions:
>> >
>> > How do you use Glade to design GTK# applications?
>> >
>> > Is the Glade XML file simply parsed and the approporiate source code
>> > created?
>> >
>> > If this is true, what utility performs this function?
>> >
>> > Can this be done with Visual Basic .NET on Mono, or is GUI design with
>> > Glade only supported for C#?
>> >
>> > How does GTK# work, and how is it related to GTK+?
>> >
>> > Does the Mono virtual machine actually make calls to the GTK runtime
>> > at a binary level?
>> >
>> > Is the code in C#, or other languages supported by Mono converted to
>> > binary code that would match compiled C code that perform the same API
>> > calls to GTK+?
>> >
>> > Where can I learn more about how this all works so I can help with the
>> > development efforts?
>> >
>> > Who would I talk to about helping with the documentation, and how
>> > would I get started in this effort?
>> >
>> > Thanks,
>> >
>> > Scott Huey
>> > _______________________________________________
>> > Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com
>> > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
>> >
>>
>>
>
More information about the Gtk-sharp-list
mailing list