Joined: Apr 2010 Gender: Male Posts: 952 Location: The Hague, The Netherlands Karma: 9
Re: Request more parameters for HUG WINDOW functio « Reply #1 on Apr 1, 2011, 4:28pm »
Hi Barry,
Quote:
The HUG WINDOW function is somewhat limited, the parameters are just title and x and y coords.
Yes, you are right. The downside of an abstraction layer is that the resulting API is somewhat limited. Of course one can always use regular GTK functions in addition to the default HUG calls but I can imagine this is a little bit ugly.
Nevertheless there may be an interesting solution: we can add a HUG function like PROPERTY(widget, "name", "value") to set any property of a widget?
Your request below can be set with the following properties:
Re: Request more parameters for HUG WINDOW functio « Reply #4 on Apr 3, 2011, 1:25pm »
Wow, I was away for a couple of days, and I come back to read this forum and there is a very nice and elegant implementation for window properties.
Yes, a window can be started minimised.
There is also a property that the window can send a hint to the window manager or tray manager not to register in the tray. I just noticed yesterday that gtkdialog implements that property:
...this is very handy if you want a popup window that you don't want to appear in the tray. Sometimes secondary windows that are not the main window would benefit from this.
Anyway, great development, I will download latest HUG and play with it!
Joined: Apr 2010 Gender: Male Posts: 952 Location: The Hague, The Netherlands Karma: 9
Re: Request more parameters for HUG WINDOW functio « Reply #7 on Apr 7, 2011, 12:25pm »
Hi Barry,
The IMPORT definition would be this:
Code:
IMPORT "PROPERTY(long,char*,...)" FROM HUG_lib$ TYPE void
However, currently PROPERTY is defined as a macro and cannot be IMPORT'ed from a shared object
You may wonder why it is done like that. Thing is that PROPERTY accepts variable types for the property, like a char or long or anything else.
This cannot be wrapped in a regular function as the C 'varargs' API to obtain a variable list of arguments must cast the incoming values using a type. And we don't know the type of the value in advance.
Best regards Peter
PS I forgot to mention that you do not need to import PROPERTY. It is defined in the INIT function. So as soon as INIT is imported also PROPERTY will be available.
Joined: Apr 2010 Gender: Male Posts: 952 Location: The Hague, The Netherlands Karma: 9
Re: Request more parameters for HUG WINDOW functio « Reply #9 on Apr 8, 2011, 2:37pm »
Hi Barry,
Well you are right and I must apologize - I have mixed up the way you import functions from a Shared Object on the one hand with the selective INCLUDE method on the other hand.
However, you are importing from HUG as a shared object. Then this doesn't work because the PROPERTY directive is defined as a macro which needs a preprocessor.
I am looking for a solution and will come back to this.
...the strange thing about this program is that the window displays with decorations, however the other two properties do work.
I am puzzled by this, as Vovchik wrote an application named 'psplash' that can set the 'decorated' property to FALSE and psplash does work. I looked at Vovchik's code and can't see anything significantly different.
I am using Puppy Linux Quirky 141 with JWM 500 window manager.