Re: [gtk-list] Gtk-- please help understand testgtk--,testgtkmm



Peter Berlau wrote:
> 
> Hi,
> I have a look to testgtk-- and testgtkmm
> the sample programs for Gtk--..
> 

I don't know who wrote testgtkmm. I assume it was
Tero. Anyway, this is a new program. testgtk--
is intended to be a port of testgtk in the gtk+
distribution. I intended it to be a test program.
If it is a good example all the better, but I 
really wanted something a developer could run to 
see if changes had broken anything. Writting it
in the first place is also a good way to find what
is missing or awkward.

> In testgtk-- there a using of static functions
> and each derived class have a (static*) pointer to
> itself, there also is a Signal-Processing
> Classes and there "Childs" are correspondate(I assume)
> but I didnt really understand this :-(
> there is
> class TestFixture:public Gtk_Window {
> public:
>  ...
>  Signal1 <TextFixture*> finished;
> private:
> ...
> };
> and all derived classes have a statically method
> create(..)

I don't know whether you are looking in the latest 
branch or in the gtkmm_1_0 branch. I haven't been
adding to the latest branch. I have been updating
to the gtkmm_1_0 branch. So what you are looking at
may be out of date.

I agree that a lot of the structure of testgtk-- is
not what you would see in a "normal" program. It
was done that way to make it easier to add new test.
There are two things:
	TestFixture - I wrote this because I got tired
            of typing the same things over and over 
            again for each test.
	Making tests singletons - I only wanted one window
            open for each test. I also wanted it to be 
            easy to add new test to the main window. I 
            started testgtk-- with what felt more natural
            from experience writing real programs. After two 
            or three test, I realized that my strategy was
            making it too difficult to add new test. I wanted
            something more like the array in gtk's testgtk.
            I got as close as I could and I feel it is much
            better. To add a new test to the main window, 
            you only have to add the label for the button and 
            a pointer to the create function for that test in
            the testToTest array.

I think each test can make good example of how to use the
widget. The main program's structure does not make a good 
example of how to write gtk-- programs. This is mainly because
it is a strange program. 
	

> in testgtkmm there are a different way to add
> childrens
> no static, no list, feels, for me, more "naturally".
> there also a event-concept here, I don't really
> figured out yet, or understand it :-(
> 
> Is there a common method to create Gtk-- Apps and
> can testgtk-- or testgtkmm be a guideline to ?
> which should I have to preffer ?

Some of the other examples should make a better example of
your main program structure. The testgtk-- program should
show you how to use each particular feature of each widget.

Some people may disagree with my strategy for testgtk--. I
see it first as a test program and second as resource for
examples.

> -- I'm absolute new with Gtk--  --
> 
> Thanks for help
>   Peter
> 
> --
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null

Note that there is a gtk-- mailing list at gtkmm@modeemi.cs.tut.fi.
To subscribe, send 'subscribe gtkmm' in message body to
majordomo@modeemi.cs.tut.fi. (you need to be subscribed to send messages
to it) 

hope this helps,
Todd.

-- 
   | Todd Dukes                      E-MAIL:  tdukes@ibmoto.com |
   | Motorola Somerset                  Phone:   (512) 424-8008 |
   | 6200 Bridgepoint Parkway Building #4 MS OE70               |
   | Austin, Texas 78730                                        |



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]