Recent

Author Topic: Libglade style funtionality  (Read 5894 times)

jamie

  • Guest
Libglade style funtionality
« on: October 27, 2003, 01:11:48 pm »
Hi,

I strongly suggest that lazarus develops a similar feature to libglade which will allow the user interface of applications to be changed at runtime without recompiling  :D . I believe this feature is a must have for future devlopment especially under gnome with its strict HIG.

Any chance that this feature would be incorporated in future versions?

jamie.

gorilla

  • Newbie
  • Posts: 4
Libglade style funtionality
« Reply #1 on: October 28, 2003, 10:14:10 am »
You want the user interface to be seperate from the program..???!!

You could do this without a functionality change to fpc or lazarus. Just have a config file that will specify where the wdiget will sit on the form and read it in at startup. You could use dynamic array of controls to add/remove buttons.

The problem is while you can change the user interface dynamically,  how do you intend modifying the code (which is compiled and not easily modifiable) by the program itself. However this could also be done by altering the program inmemory but you need to be very careful. Write to a memory location that you don't "own" and your program will crash.

Programs have be modifing themselves under windows for years (I first read about this idea when i was learning Microsoft Visual Basic 3.

Anyway, Jamie, nice idea but not overly practical. I could be wrong though.

Anonymous

  • Guest
Libglade style funtionality
« Reply #2 on: October 28, 2003, 12:23:31 pm »
You dont need to modifiy the code cause only the events are being redirected. Take for example an onClick event - this could be remapped at runtime to any other control that has an onClick event (TButton, TSpeedButton, TMenuItem etc). This therefore allows say a menu item to be replaced by a toolbar item at runtime. Future Gnome apps are gonna have this feature (as they will be using LibGlade and they have stated their intention to do this) .

LibGlade already has this feature working (http://www.daa.com.au/~james/software/libglade/). They use an XML format  for the form interface with the event pointers in them.

It would be nice to have a similar feature - I could write it myself as a component but it would be better built in. Also a runtime editor would be needed to change the user interface.

jamie.