XmeGetDesktopColorCells and manual init...
I wish to pick a visual and private colormap for an application. I am
using the XRT widgets in the application. I followed a Motif manual
and initialized as such,
XtToolkitInitialize ();
app_context = XtCreateApplicationContext ();
xDisplay = XtOpenDisplay ( app_context, NULL,
"my_program", "ProgramClass",
NULL, 0, &argc, argv);
I can enumerate the possible visuals for the display and see if my
target exists [an 8-bit pseudo-color]. I can then populate the
private color map with the colors my application needs and pass this
to XtAppCreateShell().
However, I find it impossible to display the XRT widgets. If I create
an application shell and realize it before managing the XRT widgets, I
can use XtScreen(widget) to feed XmeGetDesktopColorCells(). However,
this means that the shell window will appear briefly on the screen.
Once the default desktop colors are in the color map, everything seems
to be fine [ie. displaying XRT widgets].
How can you get a "Screen *" without having created a widget in an
application? I tried to use XrmGetResource() with an XtRScreen and
XtCScreen. However, I am a bit feeble in understanding how to get
from use XtRScreen to a default "Screen *".
Ok, I understand that is rather specific and you might want to ask why
am I doing this. I wish to display gray scale images over a slow
network. The 8-bit visual seems to give far better performance on a
10Mb unswitch ethernet, than the default 24bit true color. The images
might have arbitrary bits depths (1,2,4,6,8), but I wish to keep only
a 6 bit color map for the application. Full 8 bit gray scale images
would have color information truncated.
tia,
Bill Pringlemeir.
--
Married men live longer than single men, but married men are much more
willing to die - Dilworth
Re: XmeGetDesktopColorCells and manual init...
Bill Pringlemeir wrote:
[color=blue]
> I wish to pick a visual and private colormap for an application. I am
> using the XRT widgets in the application. I followed a Motif manual
> and initialized as such,
>
> XtToolkitInitialize ();
> app_context = XtCreateApplicationContext ();
> xDisplay = XtOpenDisplay ( app_context, NULL,
> "my_program", "ProgramClass",
> NULL, 0, &argc, argv);
>[/color]
---8<---[color=blue]
> How can you get a "Screen *" without having created a widget in an
> application?[/color]
Did you try
scr_ptr = DefaultScreenOfDisplay(xDisplay);
or
scr_ptr = ScreenOfDisplay(xDisplay, scr_number)
?
Re: XmeGetDesktopColorCells and manual init...
In article <1134179228.255948.309400@g14g2000cwa.googlegroups.com> [email]nojunk@gate.cpmet.ufpel.tche.br[/email] writes:
[color=blue]
>Bill Pringlemeir wrote:[/color]
[color=blue][color=green]
>> How can you get a "Screen *" without having created a widget in an
>> application?[/color]
>
>Did you try
>
> scr_ptr = DefaultScreenOfDisplay(xDisplay);
>
>or
> scr_ptr = ScreenOfDisplay(xDisplay, scr_number)
>
>?[/color]
For figuring out this type of thing I highly recommend the X AND MOTIF QUICK
REFERENCE GUIDE by Randi J. Rost from Digital Press.
-Pete Zakel
(phz@seeheader.nospam)
"You could get a new lease on life -- if only you didn't need the first
and last month in advance."
Re: XmeGetDesktopColorCells and manual init...
> Bill Pringlemeir wrote:
[color=blue][color=green]
>> How can you get a "Screen *" without having created a widget in an
>> application?[/color][/color]
On 9 Dec 2005, [email]nojunk@gate.cpmet.ufpel.tche.br[/email] wrote:
[color=blue]
> Did you try[/color]
[color=blue]
> scr_ptr = DefaultScreenOfDisplay(xDisplay);[/color]
[color=blue]
> or
> scr_ptr = ScreenOfDisplay(xDisplay, scr_number)[/color]
Sorry, I did grep the X11 headers for "Screen *", but I missed these
functions and went off on a tangent thinking it wasn't so obvious...
Regards,
Bill Pringlemeir.
--
Schrodinger on QED: I don't like it, and I'm sorry I ever had anything
to do with it.
Re: XmeGetDesktopColorCells and manual init...
Bill Pringlemeir wrote:
[color=blue][color=green]
>>scr_ptr = DefaultScreenOfDisplay(xDisplay);[/color]
>[color=green]
>>or
>>scr_ptr = ScreenOfDisplay(xDisplay, scr_number)[/color]
>
> Sorry, I did grep the X11 headers for "Screen *", but I missed these
> functions and went off on a tangent thinking it wasn't so obvious...[/color]
That is because it is a macro, not a function.
Dušan Peterc
[url]http://www.arahne.si[/url]
Re: XmeGetDesktopColorCells and manual init...
> Bill Pringlemeir wrote:
[color=blue][color=green]
>> Sorry, I did grep the X11 headers for "Screen *", but I missed
>> these functions and went off on a tangent thinking it wasn't so
>> obvious...[/color][/color]
On 12 Dec 2005, [email]arahne@arahne.si[/email] wrote:
[color=blue]
> That is because it is a macro, not a function.[/color]
[X]*DefaultScreenOfDisplay() and [X]*ScreenOfDisplay() have both a
function and a macro actually [at least on the system I am working
with]. The "Xlib - C Language X interface" specification says that
there should be both. Many standards provide this as you may need to
take the address of a function in some cases [The 'C' standards,
ctype.h comes to mind].
Sorry, you can not disprove my incompetence.
fwiw,
Bill Pringlemeir.
--
Some people are alive because it's against the law to kill them.