(Sorry if this is too long for hand held chatters.) Hi, I am starting to program for X Window and Xt. I am having a few problems. I have been reading extensively several books and much internet stuff, but unfortunately most examples are 'simple' and have limited usefullness and then the authors jump straight into some other system such as Qt. I would appreciate some discussion. Thank you, Colin The essence of my code: hMain = XtAppCreateShell(..., applicationShellWidgetClass, ...); // XResizeWindow: XtSetValues(hMain, args, NumArgs); (This works correctly.) // add a panel: hPanel = XtCreateManagedWidget("panel", panedWidgetClass, hMain, ...); point A // repeat the following paragraph as often required: strcpy( szTemp, "File"); Menu_button[++TopMenuID] = XtCreateManagedWidget( szTemp, menuButtonWidgetClass, hPanel, ...) point B Notes: args used for Setting button size: NumArgs = 0; XtSetArg(args[NumArgs], XtNwidth, MenuButtonWidth); NumArgs++; XtSetArg(args[NumArgs], XtNheight, MenuButtonHeight); NumArgs++; lines to be placed at either point A or point B : (initially at A) XtRealizeWidget(hMain); XtMapWidget( hPanel ); XFlush(TheDisplay); first problem: Button size is ignored - Why? Sizing works okay for main window/panel. Buttons appear full width "stacked" vertically so that the first dominates the screen and others can be seen as edges below first: ------------- : : : : : B1 : <-- this is on top : : : : ------------- : B2 : ------------- : B3 : ------------- second question: If I move the three lines from point A to point B then there is a reverse stack: Why? ------------- : B1 : ------------- : B2 : ------------- : : : : : B3 : <-- this is on top : : : : ------------- third question: If I create the buttons into the main window (not panel) thus: Menu_button[++TopMenuID] = XtCreateManagedWidget( szTemp, menuButtonWidgetClass, hMain, ...) the buttons are the correct size, but all are stacked exactly on top of each other so that only the last button is visible/accessable. Why? fourth question: Do you know how to (using the last version) space the buttons uniformly across the window? Regards, Colin PS: Please snip viscously after first read. PS: I don't want a lecture on "Why don't you use Qt, C++, Java, Basic, Pearl..." We have been through all that, and this is a question on X Window and Xt. It would be good to start a discussion on coding directly for X11 and maybe we can share ideas. Thank you.
On Thursday 12 May 2005 22:29, Colin Carter wrote:
(Sorry if this is too long for hand held chatters.) Hi, I am starting to program for X Window and Xt. I am having a few problems. I have been reading extensively several books and much internet stuff, but unfortunately most examples are 'simple' and have limited usefullness and then the authors jump straight into some other system such as Qt. I would appreciate some discussion.
[snip... Xt geometry management problems ...] I think it may be because the children widgets are not set up to be managed (and when you did try XtManage...() it probably just wasn't done right.) Start here: http://www.linuxforum.net/chinese/doc/motif/guide/MotifProgGuide/en_US/Xlib,... This points to: http://www.linuxforum.net/chinese/doc/motif/guide/MotifProgGuide/en_US/Makin... Here's an Xt Instrinsic FAQ containing lots of interesting factoids: http://www.cs.uu.nl/wais/html/na-dir/Xt-FAQ.html Most discussion I found about geometry management seem to make their way to the window manager (Motif), so here's something about that: http://www.linuxforum.net/chinese/doc/motif/guide/MotifProgGuide/en_US/Manag... If you are using Motif, this has some examples, that includes one that manages a ton of buttons on an xmRowColumnWidget: http://www.oreilly.com/catalog/motifref2/vol6a/Vol6a_html/ch02.html This is part of a FAQ that discusses why Xt widgets can do weird things with size, again it also uses Motif: http://www.faqs.org/faqs/motif-faq/part4/section-16.html
Synthetic Cartoonz wrote:
On Thursday 12 May 2005 22:29, Colin Carter wrote:
(Sorry if this is too long for hand held chatters.) Hi, I am starting to program for X Window and Xt. I am having a few problems. I have been reading extensively several books and much internet stuff, but unfortunately most examples are 'simple' and have limited usefullness and then the authors jump straight into some other system such as Qt. I would appreciate some discussion.
[snip... Xt geometry management problems ...]
I think it may be because the children widgets are not set up to be managed (and when you did try XtManage...() it probably just wasn't done right.)
Start here: http://www.linuxforum.net/chinese/doc/motif/guide/MotifProgGuide/en_US/Xlib,...
This points to: http://www.linuxforum.net/chinese/doc/motif/guide/MotifProgGuide/en_US/Makin...
Here's an Xt Instrinsic FAQ containing lots of interesting factoids: http://www.cs.uu.nl/wais/html/na-dir/Xt-FAQ.html
Most discussion I found about geometry management seem to make their way to the window manager (Motif), so here's something about that: http://www.linuxforum.net/chinese/doc/motif/guide/MotifProgGuide/en_US/Manag...
If you are using Motif, this has some examples, that includes one that manages a ton of buttons on an xmRowColumnWidget: http://www.oreilly.com/catalog/motifref2/vol6a/Vol6a_html/ch02.html
This is part of a FAQ that discusses why Xt widgets can do weird things with size, again it also uses Motif: http://www.faqs.org/faqs/motif-faq/part4/section-16.html
I second the motion on Motif, I know 1st hand that the rowColumn widget will do what I think you want, and most of the common desktops (Gnome & KDE) have de-facto Motif support intrinsic. -- William A. Mahaffey III --------------------------------------------------------------------- Remember, ignorance is bliss, but willful ignorance is LIBERALISM !!!!
Hi William III, good to hear from you again. On Friday 13 May 2005 22:56, William A. Mahaffey III wrote:
Synthetic Cartoonz wrote:
On Thursday 12 May 2005 22:29, Colin Carter wrote:
[snip... Xt geometry management problems ...] Start here: http://www.linuxforum.net/chinese/doc/motif/guide/MotifProgGuide/en_US/Xli b,_Xt,_and_Motif.html http://www.linuxforum.net/chinese/doc/motif/guide/MotifProgGuide/en_US/Mak ing_Widgets_Visible.html#managing_widgets Here's an Xt Instrinsic FAQ containing lots of interesting factoids: http://www.cs.uu.nl/wais/html/na-dir/Xt-FAQ.html Most discussion I found about geometry management seem to make their way to the window manager (Motif), so here's something about that: http://www.linuxforum.net/chinese/doc/motif/guide/MotifProgGuide/en_US/Man aging_Geometry.html If you are using Motif, this has some examples, that includes one that manages a ton of buttons on an xmRowColumnWidget: http://www.oreilly.com/catalog/motifref2/vol6a/Vol6a_html/ch02.html This is part of a FAQ that discusses why Xt widgets can do weird things with size, again it also uses Motif: http://www.faqs.org/faqs/motif-faq/part4/section-16.html
I second the motion on Motif, I know 1st hand that the rowColumn widget will do what I think you want, and most of the common desktops (Gnome & KDE) have de-facto Motif support intrinsic. Thanks for this. I am using KDE. I don't understand your last sentence about 'Motif intrinsics' (in fact I asked about this in my reply). Do you mean support for the developer, or for the user? From the developer's point of view I thought that Motif routines resolved to X Window routines; which meant that the final executeable relied on just X11 routines. Comment please :-)
Regards, Colin
Colin Carter wrote:
Hi William III, good to hear from you again.
On Friday 13 May 2005 22:56, William A. Mahaffey III wrote:
Synthetic Cartoonz wrote:
On Thursday 12 May 2005 22:29, Colin Carter wrote:
[snip... Xt geometry management problems ...] Start here: http://www.linuxforum.net/chinese/doc/motif/guide/MotifProgGuide/en_US/Xli b,_Xt,_and_Motif.html http://www.linuxforum.net/chinese/doc/motif/guide/MotifProgGuide/en_US/Mak ing_Widgets_Visible.html#managing_widgets Here's an Xt Instrinsic FAQ containing lots of interesting factoids: http://www.cs.uu.nl/wais/html/na-dir/Xt-FAQ.html Most discussion I found about geometry management seem to make their way to the window manager (Motif), so here's something about that: http://www.linuxforum.net/chinese/doc/motif/guide/MotifProgGuide/en_US/Man aging_Geometry.html If you are using Motif, this has some examples, that includes one that manages a ton of buttons on an xmRowColumnWidget: http://www.oreilly.com/catalog/motifref2/vol6a/Vol6a_html/ch02.html This is part of a FAQ that discusses why Xt widgets can do weird things with size, again it also uses Motif: http://www.faqs.org/faqs/motif-faq/part4/section-16.html
I second the motion on Motif, I know 1st hand that the rowColumn widget will do what I think you want, and most of the common desktops (Gnome & KDE) have de-facto Motif support intrinsic.
Thanks for this. I am using KDE. I don't understand your last sentence about 'Motif intrinsics' (in fact I asked about this in my reply). Do you mean support for the developer, or for the user?
From the developer's point of view I thought that Motif routines resolved to X Window routines; which meant that the final executeable relied on just X11 routines. Comment please :-)
Regards, Colin
For the user, i.e. if you write a Motif application, KDE handles it OK at runtime. As for developement support, which is what I *think* you just asked about, everything I needed was installed (by default, I *think*) on this box, SuSE 8.2, 933 MHz PIII, installed about 2 years ago. I might have had to go get some developement files (header & library packages) from a mirror, I unfortunately can't recall. I do Xt/Motif CAD developement as a hobby/sporadic business & this box handles everything AOK. -- William A. Mahaffey III --------------------------------------------------------------------- Remember, ignorance is bliss, but willful ignorance is LIBERALISM !!!!
On Saturday 14 May 2005 13:40, William A. Mahaffey III wrote:
Colin Carter wrote:
Hi William III, good to hear from you again. On Friday 13 May 2005 22:56, William A. Mahaffey III wrote:
Synthetic Cartoonz wrote:
On Thursday 12 May 2005 22:29, Colin Carter wrote: [snip... Xt geometry management problems ...] Thanks for this. I am using KDE. I don't understand your last sentence about 'Motif intrinsics' (in fact I asked about this in my reply). Do you mean support for the developer, or for the user?
From the developer's point of view I thought that Motif routines resolved to X Window routines; which meant that the final executeable relied on just X11 routines. Comment please :-) Regards, Colin
For the user, i.e. if you write a Motif application, KDE handles it OK at runtime. As for developement support, which is what I *think* you just asked about, everything I needed was installed (by default, I *think*) on this box, SuSE 8.2, 933 MHz PIII, installed about 2 years ago. I might have had to go get some developement files (header & library packages) from a mirror, I unfortunately can't recall. I do Xt/Motif CAD developement as a hobby/sporadic business & this box handles everything AOK. Thanks for this William. I note that you said you use SuSE 8.2 Was this at the time that Motif was briefly in the Open Source domain? Your interest in CAD interests me; I think that 3D perspective drawings from engineering/architect drawings ( vanishing points etc) is good fun. Regards, Colin
Colin Carter wrote:
On Saturday 14 May 2005 13:40, William A. Mahaffey III wrote:
Colin Carter wrote:
Hi William III, good to hear from you again. On Friday 13 May 2005 22:56, William A. Mahaffey III wrote:
Synthetic Cartoonz wrote:
On Thursday 12 May 2005 22:29, Colin Carter wrote: [snip... Xt geometry management problems ...]
Thanks for this. I am using KDE. I don't understand your last sentence about 'Motif intrinsics' (in fact I asked about this in my reply). Do you mean support for the developer, or for the user?
From the developer's point of view I thought that Motif routines resolved to X Window routines; which meant that the final executeable relied on just X11 routines. Comment please :-) Regards, Colin
For the user, i.e. if you write a Motif application, KDE handles it OK at runtime. As for developement support, which is what I *think* you just asked about, everything I needed was installed (by default, I *think*) on this box, SuSE 8.2, 933 MHz PIII, installed about 2 years ago. I might have had to go get some developement files (header & library packages) from a mirror, I unfortunately can't recall. I do Xt/Motif CAD developement as a hobby/sporadic business & this box handles everything AOK.
Thanks for this William. I note that you said you use SuSE 8.2 Was this at the time that Motif was briefly in the Open Source domain? Your interest in CAD interests me; I think that 3D perspective drawings from engineering/architect drawings ( vanishing points etc) is good fun. Regards, Colin
You could well be right on your Motif point, being *temporarily* Open Source (open then, not now), others pointed you to libs & headers. KDE has full OpenGL support if you install those packages as well ;-). -- William A. Mahaffey III --------------------------------------------------------------------- Remember, ignorance is bliss, but willful ignorance is LIBERALISM !!!!
On Saturday 14 May 2005 22:27, William A. Mahaffey III wrote:
Colin Carter wrote:
On Saturday 14 May 2005 13:40, William A. Mahaffey III wrote:
Colin Carter wrote:
Hi William III, good to hear from you again. On Friday 13 May 2005 22:56, William A. Mahaffey III wrote:
Synthetic Cartoonz wrote:
On Thursday 12 May 2005 22:29, Colin Carter wrote: [snip... Xt geometry management problems ...] snip> You could well be right on your Motif point, being *temporarily* Open Source (open then, not now), others pointed you to libs & headers. KDE has full OpenGL support if you install those packages as well ;-). Hi, Yes, I am very interested in OpenGL. Do you use it? I've written 3D dynamic graphics code in the past, but I think that OpenGL is the future, so will hope to master it before the end of this year. Regards, Colin
On Friday 13 May 2005 20:55, Synthetic Cartoonz wrote: Hi, Good to hear from you again, and Thanks very much for your response.
On Thursday 12 May 2005 22:29, Colin Carter wrote: [snip... Xt geometry management problems ...] I think it may be because the children widgets are not set up to be managed (and when you did try XtManage...() it probably just wasn't done right.) True. I tried XtCreateManagedWidget(..., XwrowColWidgetClass, ...) but XwrowColWidgetClass was not recognised. I searched throught the header files (64 bit) but could find no reference. I also tried XmCreateMenuBar(...) but the function was not recognised. I didn't deliberately install Motif, so guessed that it wasn't an automatic install by SuSE (by the way, I am using 9.1) I also tried XtCreateManagedWidget(... XwformWidgetClass, ... but no XwformWidgetClass
Do you know what I need to 'install' to 'access' the above items?
Start here: http://www.linuxforum.net/chinese/doc/motif/guide/MotifProgGuide/en_US/Xlib ,_Xt,_and_Motif.html This points to: http://www.linuxforum.net/chinese/doc/motif/guide/MotifProgGuide/en_US/Maki ng_Widgets_Visible.html#managing_widgets Here's an Xt Instrinsic FAQ containing lots of interesting factoids: http://www.cs.uu.nl/wais/html/na-dir/Xt-FAQ.html Most discussion I found about geometry management seem to make their way to the window manager (Motif), so here's something about that: http://www.linuxforum.net/chinese/doc/motif/guide/MotifProgGuide/en_US/Mana ging_Geometry.html If you are using Motif, this has some examples, that includes one that manages a ton of buttons on an xmRowColumnWidget: http://www.oreilly.com/catalog/motifref2/vol6a/Vol6a_html/ch02.html This is part of a FAQ that discusses why Xt widgets can do weird things with size, again it also uses Motif: http://www.faqs.org/faqs/motif-faq/part4/section-16.html
Thanks for the references - I will get back to you in 2007 when I've finished reading them. :-) Seriously, I will never get through this lot, but they are a great resource, and I will get started. I am concerned about using Motif: I am still under the impression that Motif is proprietary software. (Am I correct in assuming that code written using Motif resolves to only calling the user's X11 routines? ) I feel that I would be happy enough just using the X, Xt, Xaw and Xw functions. I am using: gcc MyProg.c -o MyProg -I/usr/X11/include -lXt -lX11 -L/usr/X11/lib64 -L/usr/X11/include/Xw -lXaw -L/usr/X11R6/lib/ -lm Does this look okay, or have I over-done things/redundancy? And what is Xaw3d ? Thanks for your help. Regards, Colin
On Thursday 12 May 2005 22:29, Colin Carter wrote:
(Sorry if this is too long for hand held chatters.) Hi, I am starting to program for X Window and Xt. I am having a few problems. I have been reading extensively several books and much internet stuff, but unfortunately most examples are 'simple' and have limited usefullness and then the authors jump straight into some other system such as Qt. I would appreciate some discussion. Thank you, Colin
[snip]
PS: Please snip viscously after first read. PS: I don't want a lecture on "Why don't you use Qt, C++, Java, Basic, Pearl..." We have been through all that, and this is a question on X Window and Xt. It would be good to start a discussion on coding directly for X11 and maybe we can share ideas. Thank you.
Solution to Colin Carter's Dilema http://www.kenjennings.cc/st/stprograms.html#testxt
participants (3)
-
Colin Carter
-
Synthetic Cartoonz
-
William A. Mahaffey III