Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 24 Oct 2014, 16:36
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
Way for Bash to position apps. & bring to top?
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
sunburnt


Joined: 08 Jun 2005
Posts: 5037
Location: Arizona, U.S.A.

PostPosted: 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
View user's profile Send_private_message 
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: 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
View user's profile Send_private_message Visit_website 
Nathan F


Joined: 08 Jun 2005
Posts: 1760
Location: Wadsworth, OH (occasionally home)

PostPosted: 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
View user's profile Send_private_message AIM YIM MSNM 
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: 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
View user's profile Send_private_message Visit_website 
sunburnt


Joined: 08 Jun 2005
Posts: 5037
Location: Arizona, U.S.A.

PostPosted: 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
View user's profile Send_private_message 
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: 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
View user's profile Send_private_message Visit_website 
sunburnt


Joined: 08 Jun 2005
Posts: 5037
Location: Arizona, U.S.A.

PostPosted: 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
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0588s ][ Queries: 11 (0.0051s) ][ GZIP on ]