The time now is Mon 20 May 2013, 16:14
All times are UTC - 4 |
| Author |
Message |
sunburnt

Joined: 08 Jun 2005 Posts: 4001 Location: Arizona, U.S.A.
|
Posted: Mon 05 Jun 2006, 15:44 Post subject:
Way for Bash to position apps. & bring to top? |
|
A GUI util. I wrote pops up ROX & an xmessage dialog with instructions, xmessage tends to cover up ROX,
Can I move ROX or the xmessage dialog with Bash to place it on the screen, or can their calls position them?
|
|
Back to top
|
|
 |
MU

Joined: 24 Aug 2005 Posts: 13642 Location: Karlsruhe, Germany
|
Posted: Mon 05 Jun 2006, 17:20 Post subject:
|
|
Install this Dotpup, it has only 1 file:
/usr/local/bin/PB-movewindow
http://dotpups.de/dotpups/System_Utilities/PB-movewindow.pup
Usage:
PB-movewindow -getpos "WindowTitle"
or
PB-movewindow -exactpos "WindowTitle"
or
PB-movewindow -move x y "WindowTitle"
or
PB-movewindow -moveactivate x y "WindowTitle"
Difference -getpos and -exactpos:
-getpos gets the position ignoring the window-decoration (Border and titleheight).
So I added -exactpos, which moves the window slightly to calculate the correct position, what causes a short slight "flickering".
Difference -move and -moveactivate:
-move just moves the window, but does not make it active.
-moveactivate moves it, iconifies it, restores it. So it becomes the active, focussed window.
Usage in shellscripts:
| Code: | #!/bin/sh
rxvt -title "abc" &
pos=`PB-movewindow -getpos "abc"`
echo $pos
|
Mark
|
|
Back to top
|
|
 |
Nathan F

Joined: 08 Jun 2005 Posts: 1641 Location: Wadsworth, OH (occasionally home)
|
Posted: Mon 05 Jun 2006, 18:58 Post subject:
|
|
Ooohh, this is nice Mark. I was working on a way to do just this in a couple scripts, thank you.
Nathan
_________________ _________________________________________
Bring on the locusts ...
|
|
Back to top
|
|
 |
MU

Joined: 24 Aug 2005 Posts: 13642 Location: Karlsruhe, Germany
|
Posted: Mon 05 Jun 2006, 19:54 Post subject:
|
|
Puppybasic includes several such commands from Xlib.
If you look at the script in the Dotpup, you can for example replace xwin_move(...) with win_resize(...) to resize windows.
Like this you simply can create other tools to manipulate windows.
The implemented available commands are listed here:
http://noforum.de/wxBasicscript-documentation/wxbasicscript/xwin.htm
If you need something not listed there, I could add a new command to Puppybasic if you tell me, what you need.
A full set of Xlib-functions is listed here for example:
http://moonbase.wwc.edu/~davija/XLIB/top.html
Almost every attribute listed there could be added as a new function to Puppybasic similar to the existing ones.
Mark
|
|
Back to top
|
|
 |
sunburnt

Joined: 08 Jun 2005 Posts: 4001 Location: Arizona, U.S.A.
|
Posted: Mon 05 Jun 2006, 20:51 Post subject:
|
|
Thanks MU... gee, I just knew it'd be you providing an answer to this post.
Wow... that makes PuppyBasic very extensible in the relm of GUI manipulation.
I'll have to take another more serious look at it to see what the capabilities could be.
If it can be made to mimic VB's "(command).(property) = $value" syntax, it'd open up it's usability for GUI apps.
|
|
Back to top
|
|
 |
MU

Joined: 24 Aug 2005 Posts: 13642 Location: Karlsruhe, Germany
|
Posted: Mon 05 Jun 2006, 21:10 Post subject:
|
|
| Quote: | | If it can be made to mimic VB's "(command).(property) = $value" syntax, it'd open up it's usability for GUI apps. |
No, it won't.
Puppybasic is not object-oriented concerning Guis, as it just provides wrappers to other C-libraries.
The full wxBasic supports more visual-basic style syntax, but I did not compile the latest version yet.
http://wxbasic.sourceforge.net/phpBB2/viewtopic.php?t=969
But this just applies to the C++ based wxWidgets-bindings (a wrapper to Gtk in Linux, to the win32-Api in Windows, to Carbon in MacOSX), that were removed in Puppybasic to reduce the size from 6 MB to 150 kb.
Puppybasic just can handle additional commands via functions passing parameters:
returncodelist = functionxyz( option1 , option2)
example:
| Code: |
values = xwin_screensize()
sizex = values[0]
sizey = values[1]
|
This syntax is based on the way, how Puppybasic handles variables.
It internally does not use C-like *char or int, instead it uses it's own datatype wxVariant.
To be able to integrate external C-functions like xlib, I added some commands to convert these types.
This conversion was kind of complicated to achieve, the easiest way to add new functions I finally found out was this scheme of a function returning a list.
Using element.property.value = ... would need a much more complex construction, making it less easy to add a wrapper for other C based libraries.
Mark
|
|
Back to top
|
|
 |
sunburnt

Joined: 08 Jun 2005 Posts: 4001 Location: Arizona, U.S.A.
|
Posted: Tue 06 Jun 2006, 04:15 Post subject:
|
|
MU; I think I understand what your saying about trying to build a syntax that would do OOP for wxBasic.
Using the VB syntax for controlling data or control (GUI) properties doesn't have to mean an OOP approach.
Really it's just nothing more than a synatical expression, a rearrangement of the command words.
An interpereter interface (a converter) is all that should be needed to change the syntax of any language.
Rearranging the syntax isn't going to make it do anything more than what it already does now.
I had a type of basic a while back that converted to C code that then used a std. C compiler.
This is somewhat different than what I'm talking about, but in the same vein.
Thanks again MU, I'm trying to finish all the LanPup GUI utils., & all of this sure helps!
|
|
Back to top
|
|
 |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|