At 22:17 05/10/2005, you wrote:
Eduardo wrote:
Can be used Lazarus make a dinamic GUI using gtk for? I want to read the configuration file and change my app GUI. I don't want a skin style, just put buttons, checkboxs, edit fileds, etc.. depending the conf file.

That is quite easy. You just have to create the components by hand. Just create the components on the OnCreate event of your form:

procudure TMyForm.OnCreate(Sender: TObject);
<cutted text>
end;

Declare the component namas as variables on your TMyForm.

You may want to create the configuration file on xml, but you need to learn how to use XML DOM if you do so, for sure this is the more elegant way.

In fact the configuration file is the output of another app which i can't modify, so no xml.

Also take notice that it is not necessary to use gtk call directly for this, so this is a multi-platform approach. In fact you don't need to draw the form to have one on Lazarus. You can simple have the entire form create by hand just by calling the correct methods and setting the correct properties, but on most cases it is easier to draw the form.

It can be done in fpc, but i'm trying to not call and manage gtk myself, so lazarus make the dirty work.

Another approach is to create the components with the form designer but set their Visible property to False and then set it to True when you want.

I can't do that, i don't now in advance which and how many controls must use.

If you want an unknown number of components to be created you may create a dinamyc array of components, maybe this works.

Felipe

Yes, i need an unknown number of componentes and types, so the dynamic array will be the way.

Thanks a lot.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------
Scientists have shown that the moon is moving away at a tiny yet measurable distance from the earth every year. If you do the math, you can calculate that 85 million years ago the moon was orbiting the earth at a distance of about 35 feet from the earth's surface. This would explain the death of the dinosaurs. The tallest ones, anyway.
_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to