Re: How do you develop you GTK code?



Hi Diogo,

On Fri, 13 Apr 2007 23:57:12 -0300 you wrote:
> I am curious about it and really want to know: How do you develop your GTK
> codes?

Mostly by hand.

Before coming to GTK I had done some GUI apps on Windows with Borland C++ Builder, which is quite nice for drawing fixed size dialogs with a small selection of different widgets. I had also briefly tried customizing a GUI written in Tcl/Tk (and later Python/Tkinter) with no RAD support.

My first few GTK apps were hand written using tables of widgets. It does make it harder to visualize what you're creating as you go, but anyone that's done HTML will be accustomed to how tables work. If you draw your GUI out on paper, it's really not hard to code from that.

I tried Glade more recently, thinking it would be easier, like the Borland tool. Well, it does work as a drawing tool, and I guess if you use libglade and don't care how it ends up being implemented then it isn't too bad. But the code generator (now deprecated) produces something truly horrid.

The other thing to bear in mind is this:
  If you have a row or column of similar widgets, say buttons, then a tool like Glade or BCB requires you to place every one individually. Writing the code by hand lets you do:
     for ( cc=0; cc<10; cc++ )
    {
         MyButtons[cc] = gtk_button_new (......);
         gtk_box_pack_start ( .... );
    }

This is even more relevant if the number of buttons isn't known at design time!



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