Make gtkDialog appear in a given screen location? [Solved]

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#16 Post by 8-bit »

I found that it is not a good idea to use negative values for position with gtkdialog.
If you use "gtkdialog3 -p myprogram --geometry 0x0+200+400" for instance that says 200pixels from left edge of screen and 400 pixels from top of screen.
And it stays consistent when running program multiple times.
But, if you use "gtkdialog3 -p myprogram --geometry 0x0-400-400" and run the program multiple times the program window position will change.
Negative values are measured from the right edge and bottom edge of screen.
Don't believe my heresay, try it with a small gtkdialog script.

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#17 Post by 8-bit »

BarryK wrote:sunburnt,
The intention is to phase-out gtkdialog2 sometime. I might have one or two scripts that still use gtkdialog2.

I recall that --geometry was buggy in earlier versions of gtkdialog, don't recall specifically about our gtkdialog2 though.

gtkdialog3 should work. It really is the best to use, the very latest from source patched by gposil.
Is gposil's patched version going to be included in future Puppy versions and does it expand on Patriot's version?

Also, where is the gposil version?

And lastly, will the modified versions work with exsisting gtkdialog scripts?

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#18 Post by sunburnt »

8-bit; The movement may be what I found that is the desktop`s "cascade" windows effect.
I had to subtract a small amount from the X and Y positions before saving the GUI`s location.
See my code above in the "cancel() {" function.

technosaurus; Mine is a working script also, but I have a fairly complete GUI for it.
Unfortunately I forgot to mention that it`s gtkDialog2, but written years ago it`d have to be.
### Is your script for gtkDialog3 ? If it is then I`m guessing that our scripts are similar...

### I think I`ll start a thread for developing a GUI builder that makes gtkDialog3 GUIs.
### The problem is I can`t remember ever getting a gtkDialog3 script to work yet...

Barry; I figured as much, it`s the circle of life ( or cycle of code... :lol: ).

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#19 Post by BarryK »

8-bit wrote:
BarryK wrote:sunburnt,
The intention is to phase-out gtkdialog2 sometime. I might have one or two scripts that still use gtkdialog2.

I recall that --geometry was buggy in earlier versions of gtkdialog, don't recall specifically about our gtkdialog2 though.

gtkdialog3 should work. It really is the best to use, the very latest from source patched by gposil.
Is gposil's patched version going to be included in future Puppy versions and does it expand on Patriot's version?

Also, where is the gposil version?

And lastly, will the modified versions work with exsisting gtkdialog scripts?
Oh sorry, I meant Patriot's patch, not gposil.
[url]https://bkhome.org/news/[/url]

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#20 Post by 8-bit »

After playing with Zigbert's example script, and not having it work correctly, it dawned on me that the /tmp/geometry file was not being run upon rerunning the script.
I made 2 changes to it and now it works.
First, I moved the action line so that the ok button saved changes and added a cancel button for ease of exiting the program.
Those changes did not help in the script using the new parameters.
So after looking at "The benefits of a Configuration file" example,
I then added ". /tmp/geometry" right after the first line of the script.
This ran the /tmp/geometry file to pass the saved parameters to the script.

And in running it settings were retained and used on the next run of the script.

If you want to see my mods to his script in their entirety, I will post it as code.

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#21 Post by zigbert »

8-bit wrote:After playing with Zigbert's example script, and not having it work correctly, it dawned on me that the /tmp/geometry file was not being run upon rerunning the script.
True, - I thought that was the question. Save size and placement for next run :oops: Foolish me :)

Pmusic uses this technique.


Sigmund

Post Reply