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 Wed 27 Aug 2014, 07:21
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
Gtkdialog Development
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 55 of 55 Posts_count   Goto page: Previous 1, 2, 3, ..., 53, 54, 55
Author Message
don570


Joined: 10 Mar 2010
Posts: 3259
Location: Ontario

PostPosted: Wed 21 Aug 2013, 15:45    Post_subject:  

When you create a button to do an action you can also
set how the exit variable is set. For instance
<action>exit:EXIT</action> sets the exit variable to "EXIT"
When you run your script in the terminal the variable is printed.
(a nice feature of terminal Cool )

Code:
funcbtnType0Create3() {
   echo '<button image-position="'$1'" use-stock="true"   tooltip-text="'$(gettext 'Relaunch Bulldog Finder')'">
         <input file stock="gtk-ok"></input>
         <label>"'$(gettext 'Relaunch')'"</label>
          <action>bulldog-finder "$FPATH" &</action>
          <action>exit:EXIT</action>
        </button>'


Then after gtkdialog has run you can put a line that can
decide what is done next . Here's an example in my bulldog-finder
program.

Code:
for STATEMENTS in  $($GTKDIALOG -c -p SETTINGS); do
  eval $STATEMENTS
done
IFS=$I

if [ "$EXIT" = "EXIT" ] || [ "$EXIT" = "abort" ];then  # delete temp
rm -rf $TEMPDIR
exit 0
fi


In my example I do a deletion , in your case you would want to launch
gtkdialog again
Back to top
View user's profile Send_private_message 
simargl7

Joined: 05 Oct 2013
Posts: 18

PostPosted: Sat 19 Oct 2013, 05:29    Post_subject:  

Will there be stable Gtk3 based version soon?

In Gtk 3.10 icons from menus are removed without option for user to enable them, Gtk.Stock is deprecated. Icons on menus and buttons must be explicitly added by application's developer.
Back to top
View user's profile Send_private_message 
don570


Joined: 10 Mar 2010
Posts: 3259
Location: Ontario

PostPosted: Sat 19 Oct 2013, 16:06    Post_subject:  

Thunor has looked into a GTK3 version but he
doesn't seem to feel there's a high priority.

________________________________________-
Back to top
View user's profile Send_private_message 
jfi

Joined: 15 Nov 2013
Posts: 1

PostPosted: Fri 15 Nov 2013, 17:47    Post_subject: memory leak?  

Am I doing this wrong or is there a memory leak in gtkdialog?

I ran a gtkdialog script that I'm working on for a day. After about 8 hours it ran out of RAM (there wasn't very much available to start with). The script was sitting idle all day only updating clock display twice a second so I tried removing the clock. Gtkdialog process stopped growing.

Then I narrowed it down to this script that just updates date and time:

Code:

    #!/bin/bash
     
    GTKDIALOG=gtkdialog
     
    MAIN_DIALOG='
    <window title="memory leak test">
      <vbox>
        <text use-markup="true">
          <variable>TIMEDISPLAY</variable>
            <input>date +%H:%M:%S</input>
        </text>
        <text>
            <variable>DATEDISPLAY</variable>
            <input>date +%A\ %-d.%m.%Y</input>
        </text>
        <timer milliseconds="true" interval="50" visible="false">
          <action>clear:TIMEDISPLAY</action>
          <action>refresh:TIMEDISPLAY</action>
          <action>clear:DATEDISPLAY</action>
          <action>refresh:DATEDISPLAY</action>
        </timer>
      </vbox>
    </window>
    '
     
    export MAIN_DIALOG
    $GTKDIALOG --program=MAIN_DIALOG


and watched it grow:

Code:
chmod u+x leaktest
./leaktest&
while [ 1 ]; do date; ps -C "gtkdialog" u; sleep 10; done



I tried this under Ubuntu 10.04 Lucid Lynx (x86_64 desktop) and an A13-OLinuXino-WIFI board running Debian Wheezy (armhf). Bash versions are 4.1.5 for the desktop and 4.2.20 for the arm board.
I tried gtkdialog 0.8.3 tarball on both platforms and on desktop I also tried svn rev 514. All kept growing.

P.S. Those "clear" actions were added for testing, it leaks without them as well. The timer was originally 500 ms, I sped it up to maybe get it to leak more.
Back to top
View user's profile Send_private_message 
don570


Joined: 10 Mar 2010
Posts: 3259
Location: Ontario

PostPosted: Sat 16 Nov 2013, 16:49    Post_subject:  

Additional info: Thunor did a timer example. The shell may be important.
Thunor used the bash 3.0 shell.

Ubuntu uses dash.

http://code.google.com/p/gtkdialog/source/browse/trunk/examples/timer/timer_advanced?spec=svn493&r=493

________________________________________
Back to top
View user's profile Send_private_message 
brokenman

Joined: 20 Oct 2011
Posts: 25

PostPosted: Wed 12 Feb 2014, 08:57    Post_subject: hide and show  

I am trying to hide a button on a 'notebook' page when the page is shown. The page has the an entry widget and radiobutton widgets (as well as the button). I can't seem to get the button to hide using signal="show" for any widgets. It hides OK if i put the action into a radiobutton 'if true' action.

Any ideas how I can realize this?

PS: Is there a donation system for gtkdialog?

Code:
<vbox margin="10">
   <hbox>
      <text><label>Select a file: </label></text>
      <entry fs-action="file" editable="false" block-function-signals="true">
         <variable>SELPKG</variable>
      </entry>
      <button>
         <label>Select</label>
         <action function="fileselect">SELPKG</action>
         <action>echo $SELPKG</action>
      </button>
   </hbox>
   <radiobutton>
      <label>Example</label>
   </radiobutton>
   <button>
      <label>Vanish</label>
      <variable>butDownload</variable>
   </button>
</vbox>

Edited_time_total
Back to top
View user's profile Send_private_message 
dejan555


Joined: 30 Nov 2008
Posts: 2647
Location: Montenegro

PostPosted: Wed 12 Feb 2014, 09:04    Post_subject:  

Did you try: <button visible="false"> ?
_________________


Back to top
View user's profile Send_private_message Visit_website MSNM 
brokenman

Joined: 20 Oct 2011
Posts: 25

PostPosted: Wed 12 Feb 2014, 09:09    Post_subject:  

I want the button to be visible until a certain 'notebook' page is shown. So what I need is something similar to an "onshow" parameter for one of the widgets. When the widget is shown, the button vanishes. The original state of the button should be visible so this attribute is no good for me. Thanks.

Essentially I would like the button in the above code to be invisible when the script is run, but done so without using anything within the button widget itself.
Back to top
View user's profile Send_private_message 
brokenman

Joined: 20 Oct 2011
Posts: 25

PostPosted: Wed 12 Feb 2014, 09:17    Post_subject:  

Ok I got it. Since the button I want to vanish is created after the other widgets, they can't do what I want since the button doesn't exist at the point when they are created. I need to have a widget somewhere in the code AFTER the button I want to vanish. Makes sense.

Code:
<vbox margin="10">
   <hbox>
      <text><label>Select a file: </label></text>
      <entry fs-action="file" editable="false" block-function-signals="true">
         <variable>SELPKG</variable>
      </entry>
      <button>
         <label>Select</label>
         <action function="fileselect">SELPKG</action>
         <action>echo $SELPKG</action>
      </button>
   </hbox>
   <radiobutton>
      <label>Example</label>
      <action>if true show:butDownload</action>
   </radiobutton>
   <radiobutton>
      <label>Example2</label>
      <action>if true hide:butDownload</action>
   </radiobutton>
   <button visible="true">
      <label>Vanish</label>
      <variable>butDownload</variable>
   </button>
<statusbar has-resize-grip="false">
   <variable>stb0</variable>
   <input>echo statusbar</input>
   <action signal="show">hide:butDownload</action>
</statusbar>
</vbox>
Back to top
View user's profile Send_private_message 
dejan555


Joined: 30 Nov 2008
Posts: 2647
Location: Montenegro

PostPosted: Wed 12 Feb 2014, 09:51    Post_subject:  

Not sure if I understand but why not put it inside one frame of notebook if that's only where it should be shown instead after notebook code?
_________________


Back to top
View user's profile Send_private_message Visit_website MSNM 
brokenman

Joined: 20 Oct 2011
Posts: 25

PostPosted: Wed 12 Feb 2014, 21:21    Post_subject:  

I should have explained more clearly, sorry. There is a set of buttons at the bottom of the application. They are static and exist to move from one notebook page to the next. Like a back button. While the notebook pages may change, these buttons stay where they are all the time.

For this reason they are the last widgets to be drawn (last in the code) and as such I believe the widgets above this can not affect them with a signal="show" action. I have found a solution in any case. Thanks.

BTW, I would still like to know about any donation options Thunor. I get a lot of mileage out of gtkdialog. Many thanks for your work.
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 55 of 55 Posts_count   Goto page: Previous 1, 2, 3, ..., 53, 54, 55
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Advanced Topics » Cutting edge
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.1089s ][ Queries: 12 (0.0269s) ][ GZIP on ]