Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2001-07

Glade - the GTK+ Gui Builder

5 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Alexander Stohr

Hello,

Is there any FreePascal (or at least some ObjectPascal or gpc) export filter support known for the XML files which can be made by use of the glade application?

glade is some advanced GTK+ gui builder. Its a tool that is partially comparaeble to the features of MS-VC environment.

Sorry if that is a dumb question which is mentioned in some FAQ or already answered in some Dokumentation. I am really not up to date with current FPC developments any more. Anyways, i am still in progress with finding a viable solution for my previous question concerning "writing portable software" interconnected to some database.

If there is no support like queried above, then thats not a total problem but i might have to turn over to C for some while. Thats not a personal problem and a few involved folks would rather have less problems if using C rahter than Pascal.

Regards AlexS.

Reply by email

Brad Campbell
to Alexander Stohr

G'day all,

I have implemented a native replacement for the linux shell chvt command, however, I don't like the way in which I pass the terminal number paramater to the ioctl. I had to do some strange fudging to get this to work, as the last paramater of the ioctl routine in the linux unit must be a VOID_POINTER. The ioctl in the kernel expects an unsigned_longint. This works, verified by both function and running an strace on the program. Is there a better way?

Function ChVT(Terminal : Cardinal) : Boolean;
Const
	VT_ACTIVATE = $5606;
	VT_WAITACTIVE= $5607;
Var
	TTY : LongInt;
	test : Pointer;
Begin
TTY := fdOpen('/dev/tty',Open_RdWr);
If TTY = 0 then Exit(False);
Test := $0;
Test := Test + Terminal;
IOCTL(TTY,VT_ACTIVATE,Test);
IOCTL(TTY,VT_WAITACTIVE,Test);
fdClose(TTY);
ChVT := True;
End;

Cheers all..

Brad.... /"\ Save the Forests \ / ASCII RIBBON CAMPAIGN Burn a Greenie. X AGAINST HTML MAIL / \

Reply by email

Marco van de Voort
to Brad Campbell
Show quoted text 7 lines
G'day all, I have implemented a native replacement for the linux shell chvt command, however, I don't like the way in which I pass the terminal number paramater to the ioctl. I had to do some strange fudging to get this to work, as the last paramater of the ioctl routine in the linux unit must be a VOID_POINTER.

Typical C notation. Long is guaranteed large enough to contain pointer.

The ioctl in the kernel expects an unsigned_longint. This works, verified by both function and running an strace on the program. Is there a better way?

Probably this was done because Cardinal is newer as a type than pointer, and because people pass pointers to it anyway ;-)

Show quoted text 12 lines
Function ChVT(Terminal : Cardinal) : Boolean; Const VT_ACTIVATE = $5606; VT_WAITACTIVE= $5607; Var TTY : LongInt; test : Pointer; Begin TTY := fdOpen('/dev/tty',Open_RdWr); If TTY = 0 then Exit(False); Test := $0; Test := Test + Terminal;
IOCTL(TTY,VT_ACTIVATE,Test); IOCTL(TTY,VT_WAITACTIVE,Test);
IOCtl(TTY,VT_Activate,Pointer(Test));

Reply by email

Brad Campbell
to Marco van de Voort
Marco van de Voort wrote 7 lines
> IOCTL(TTY,VT_ACTIVATE,Test); > IOCTL(TTY,VT_WAITACTIVE,Test); IOCtl(TTY,VT_Activate,Pointer(Test));

Thankyou Marco, much more elegant.
This solves a couple of other problems I have also, I had forgotten about typecasting.

Brad.... /"\ Save the Forests \ / ASCII RIBBON CAMPAIGN Burn a Greenie. X AGAINST HTML MAIL / \

Reply by email

Peter Vreman
you wrote 5 lines
Hello, Is there any FreePascal (or at least some ObjectPascal or gpc) export filter support known for the XML files which can be made by use of the glade application?

No, currently there is nothing to read the glade files.

Peter

Reply by email