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 Thu 27 Nov 2014, 01:36
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Can gtkDialog GUI refresh another GUI in same script?
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: 5042
Location: Arizona, U.S.A.

PostPosted: Wed 07 Apr 2010, 20:18    Post_subject:  Can gtkDialog GUI refresh another GUI in same script?  

Look below at script code...
Edited_time_total
Back to top
View user's profile Send_private_message 
8-bit


Joined: 03 Apr 2007
Posts: 3393
Location: Oregon

PostPosted: Wed 07 Apr 2010, 23:01    Post_subject:  

Did you include a line to export your functions?
example:

export function1 function2 function3

This allows your program to see and use the functions.
Back to top
View user's profile Send_private_message 
sunburnt


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

PostPosted: Thu 08 Apr 2010, 01:24    Post_subject:  

Code:
#! /bin/sh
. $1/guiinfo
menu() {
  echo '###   '$1   $2
  POS=`$1/driveman guiPOS DM`
  X=echo $POS |sed 's/,.*$//' ; Y=echo $POS |sed 's/^.*,//'
export DM_MENU="
<window title=\"\" skip_taskbar_hint=\"true\" window_position=\"2\">
  <vbox>
  <tree hover-selection=\"true\" headers-visible=\"false\">
    <variable>POPMENU</variable><label>$2</label>
    <item>ROX_Filer</item><item>Mt-UnMt</item>
    <item>Set_Boot</item><item>Settings</item>
    <item>-------------</item>
    <item>Exit_DM</item><item>Exit_Menu</item>
    <action signal=\"button-release-event\" type=\"clear\">DRIVES</action>
    <action signal=\"button-release-event\" type=\"refresh\">DRIVES</action>
    <action signal=\"button-release-event\">$1/driveman clkMENU \$POPMENU $2</action>
  </tree>
  </vbox>
</window>"
gtkdialog3 -p DM_MENU -G +"$X"+"$Y" &
}
export -f menu

export DRIVEMAN="
<window title=\"DM\"><vbox>
  <table><variable>DRIVES</variable><label>Drives|M|B</label><input>cat /tmp/drvinfo</input>
    <action signal=\"button-release-event\">menu $1 \$DRIVES</action></table>
</vbox></window>"
gtkdialog3 -p DRIVEMAN --class DM -G "$2"x"$3"+"$X"+"$Y" &

DRIVEMAN calls the menu function that`s a TreeBox used as a popup menu.
I have it working nicely as two scripts but the menu GUI can`t refresh the DriveMan GUI.
With this arrangement I have to kill DriveMan and then run it again to force a refresh.
##### Update:
Now it`s working but the menu GUI will not refresh the DriveMan GUI in the same script.
I altered the code to try to get the "button-release-event" to trigger the clear and refresh.
Apparently GUIs in the same script can`t reference the others Variables. ( different shells? )
Maybe because the second GUI is being run in a function makes it a different shell.
gtkDialog2 had <action launchwindow> that ran another GUI without it being in a function.

Edited_times_total
Back to top
View user's profile Send_private_message 
sunburnt


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

PostPosted: Thu 08 Apr 2010, 06:09    Post_subject:  

Script posted for the DriveMan GUI ( Above ). It shows the Menu, but doesn`t refresh...

It sure would be nice if a script could control and refresh a gtkDialog GUI that`s running.
Not to mention it`d be nice to change and refresh text and displayed icons on controls.
Something like:
Code:
gtkdialog3 -ref DRIVEMAN      # refresh ALL the controls on the DriveMan GUI
gtkdialog3 -ref DRIVEMAN DRIVES   # refresh just the control with the Variable: DRIVES
gtkdialog3 -ref DRIVEMAN Exit      # refresh the control text of the Label: Exit

It would be better if ALL controls had a "Name" to uniquely identify it ( like Visual Basic ).
Then like Visual Basic, you could assign ( set ) the property values for the control.
Code:
FileList.Visible=true
FileList.Width=200
FileList.Font=Ariel

This just makes too much sense I guess, and it`s certainly much easier to read and write...
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 » Off-Topic Area » Programming
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.0537s ][ Queries: 12 (0.0056s) ][ GZIP on ]