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 22 Aug 2014, 00:14
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
GtkDialog - tips
Post new topic   Reply to topic View previous topic :: View next topic
Page 9 of 64 [947 Posts]   Goto page: Previous 1, 2, 3, ..., 7, 8, 9, 10, 11, ..., 62, 63, 64 Next
Author Message
Patriot


Joined: 15 Jan 2009
Posts: 734

PostPosted: Sun 25 Oct 2009, 20:39    Post subject:  

Hmmm .....

zigbert,

zigbert wrote:
..... I have to test your workaround more, but it seems to work excellent. .....

Please do all the testing you want. I've tested only the signal events that made sense to me. The window hide signal seems to be the best workaround for the menubar issue ...

Hmmm, the launch/closewindow issue kept cropping up in my head, so I had to do something about it ... I wrote a small utility to close window by id but it's a lame fix .. So, I took another peek (yeah, one last peek and poke) at it and made a quick fix at the sources. I've made several quick tests and I can now launch and close the child window properly. I think since it's just one fix, maybe we should call this gtkdialog3 1/4 ..... Smile

So, that's another carrot dangling ... do you want it ?


Some final comments:

1. Drag-n-drop: I believe it's not fully implemented the way you wished for it to be ... This needs a lot of time to sort out ...

2. The right click stuff: It seems to be widget dependent. The code looks like it won't support much ... but I could be incorrect ...

3. "Click on <table> header doesn't sort": No it wont. Currently, I have no idea of the intended behaviour or how this should work in gtkdialog ... Actual GTK2 GtkTable is for widgets, not for spreadsheet-like stuffs ...

4. "Allows user to select multiple items in list, But gtkdialog doesn't output any value": Nope, there's no code to support multi-selected output ... It may multi-select but it doesn't get stored nor printed ... This needs a lot of time to sort out ...

Well, I've only skimmed, peeked and poked at the sources. The launch/closewindow issue doesn't bug me anymore, but I couldn't spend more time on this ... Really zigbert, gtkdialog IS a simple implementation of some GTK2 widgets but looking at how it is implemented, well I guess I know why I get dizzy .....


Rgds
Back to top
View user's profile Send private message 
zigbert


Joined: 29 Mar 2006
Posts: 5675
Location: Valåmoen, Norway

PostPosted: Mon 26 Oct 2009, 14:39    Post subject:  

Patriot
Very Happy Of course we want it. All fixes are wonderful!

Hopefully, the bugfix will help me with Pmusic.

I have updated main post with the <menubar> workaround. It works great!!!


Thanks a lot
Sigmund

_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
technosaurus


Joined: 18 May 2008
Posts: 4335

PostPosted: Mon 26 Oct 2009, 17:01    Post subject:  

The biggest feedback I get from people trying to learn puppy is that we don't have the mouseover dialogs that give a short explanation of what stuff does. If someone could figure this out there would be a lot of happy Puppy's.

I looked through the source code before but couldn't really follow how the widgets were set up - I last coded in C in 1997. I was hoping for a template for each widget that I could just modify and add. Anyhow mouseover was all I was wanting to do and it didn't seem like a straightforward cut and paste job....

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
Patriot


Joined: 15 Jan 2009
Posts: 734

PostPosted: Mon 26 Oct 2009, 20:33    Post subject:  

Hmmm .....

zigbert,
Ok, you got it ... The sources and pet is attached below ...

To close the child window, we just specify any var name defined in the child script. The recommend method would be to define the same var name as the exported bash var name for easy reference:
Code:
#!/bin/sh
# Requires the fixed gtkdialog3-pe1

export CHILD_DIALOG='
<window title="Separate Child Dialog">
  <vbox width-request="180">
   <frame>
     <text><label> I am coming </label></text>
     <text><label> out to play. </label></text>
     <text><label> But since I have my own PID, I cant act on my parent dialog. </label></text>
   </frame>
   <button><label>increase number</label>
     <action>A=$(cat /tmp/tmp); echo $(($A+1)) > /tmp/tmp</action>
     <action>refresh:TEXT</action>
   </button>
  </vbox>
</window>
'

export LAUNCHED_DIALOG='
<variable>LAUNCHED_DIALOG</variable>
  <vbox>
    <text>
      <label>This is a launched dialog window.</label>
    </text>
    <button><label>increase number</label>
      <action>A=$(cat /tmp/tmp); echo $(($A+1)) > /tmp/tmp</action>
      <action>refresh:TEXT</action>
    </button>
    <button>
      <label>Close me</label>
      <action type="closewindow">LAUNCHED_DIALOG</action>
    </button>
  </vbox>
'

export MAIN_DIALOG='
<window title="Main Dialog" tooltip-text="Copyleft by Patriot and zigbert">
  <vbox width-request="240">
  <text width-chars="40"><label>"Clickity click to open"</label></text>
  <text width-chars="40"><label>"Clickity click to close"</label></text>
  <text width-chars="40"><label>"Clickity click to exit"</label></text>
   <frame>
   <text width-chars="40" height-request="120"><variable>TEXT</variable><input>cat /tmp/tmp</input></text>
   </frame>
   <button><label>Open child dialog with unique PID</label>
     <variable>OCD</variable>
     <action>gtkdialog3 -p CHILD_DIALOG -c &</action>
     <action>echo $(ps ax|awk '"'"'{if (match($7, "CHILD_DIALOG")) print $1}'"'"')>/tmp/child.pid</action>
     <action>enable:CCD</action>
     <action>disable:OCD</action>
   </button>
   <button sensitive="false"><label>close child dialog with unique PID</label>
     <variable>CCD</variable>
     <action>[ -f /tmp/child.pid ] && p=$(cat /tmp/child.pid) && kill $p</action>
     <action>enable:OCD</action>
     <action>disable:CCD</action>
   </button>

   <button><label>launch child dialog</label>
     <action type="launch">LAUNCHED_DIALOG</action>
   </button>
   <button><label>close child dialog (but look what happens)</label>
     <action type="closewindow">LAUNCHED_DIALOG</action>
   </button>

   <button tooltip-text=" Exit? Really? "><label>Exit </label>
   <action>exit:Exit</action>
   </button>
  </vbox>
</window>>
'
echo 1 > /tmp/tmp

# Requires the fixed gtkdialog3-pe1

gtkdialog3 -p MAIN_DIALOG -c
unset CHILD_DIALOG
unset MAIN_DIALOG



technosaurus wrote:
The biggest feedback I get from people trying to learn puppy is that we don't have the mouseover dialogs that give a short explanation of what stuff does. ........

Is tooltips the one you're looking for ? If it is, then it's already covered on the main page of this thread. The above code also shows an example of tooltips ..... If you meant having a customized popup dialog, then the signal events allows you to do so ...


Rgds
gtkdialog3-0.7.20-pe1-i486.pet
Description  gtkdialog3 pe1 binary only pet. It will overwrite existing gtkdialog3.
pet

 Download 
Filename  gtkdialog3-0.7.20-pe1-i486.pet 
Filesize  47.23 KB 
Downloaded  450 Time(s) 
gtkdialog3-0.7.20-pe-1.tar.gz
Description  This was originally gtkdialog3-0720-patched2 sources. Fixed child launch/closewindow.
gz

 Download 
Filename  gtkdialog3-0.7.20-pe-1.tar.gz 
Filesize  307.53 KB 
Downloaded  418 Time(s) 
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4335

PostPosted: Mon 26 Oct 2009, 20:47    Post subject:    

Thanks Patriot,

That is exactly what I needed. I guess it helps to know what you are looking for.

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
01micko


Joined: 11 Oct 2008
Posts: 7794
Location: qld

PostPosted: Tue 27 Oct 2009, 03:23    Post subject:  

I suppose you can be forgiven for that techno... zigbert only recently discovered native gtkdialog support for tooltips, it is now documented in this thread! Zigbert even wrote his own workaround with 'Ptooltips' but I think 'Potong' pointed out to him the native support.

I have been using tooltips in all my recent work, (um, not that that amounts to much but it is something!).

Cheers

_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send private message Visit poster's website 
zigbert


Joined: 29 Mar 2006
Posts: 5675
Location: Valåmoen, Norway

PostPosted: Tue 27 Oct 2009, 12:29    Post subject:  

THANK YOU PATRIOT
I have uploaded your package to puppylinux.asia and made a red note in the main post.


Works great!!!
Sigmund

_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
8-bit


Joined: 03 Apr 2007
Posts: 3364
Location: Oregon

PostPosted: Tue 27 Oct 2009, 15:23    Post subject:  

This is just a thought on exiting a gtkdialog script with cleanup.
See my post on it Here
Back to top
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6427
Location: Auckland, New Zealand

PostPosted: Wed 28 Oct 2009, 16:17    Post subject:  

I'm not sure if it's already explained in this thread, but Argolance figured out how to escape apostrophes (= figured out how to use them in text in gtkdialog.
http://www.murga-linux.com/puppy/viewtopic.php?p=355706#355706

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4335

PostPosted: Thu 29 Oct 2009, 19:10    Post subject:  

Ultimate GtkDialog Challenge:

Requirements:
1. Knowledge of GtkDialog, sed, grep and bash scripting
2. Time

The challenge.

Phase 1
Write a gtkdialog that lets you select a command line program and it will run <program> --help, parse the options and then build a basic graphical interface to said program.

Phase 2
Add the description of each option to a tooltips description.

Phase 3
Add options to the parser that looks for hints whether an option requires a directory, file etc...

Phase 4
Add a configurable interim GtkDialog that can be tweaked for input types, default values, icons etc... (using phase 3 for default values) This would build the final GUI.

Is anyone up to the challenge?

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
01micko


Joined: 11 Oct 2008
Posts: 7794
Location: qld

PostPosted: Thu 29 Oct 2009, 20:08    Post subject:  

I am taking that challenge right now.... in the middle of it..
_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send private message Visit poster's website 
disciple

Joined: 20 May 2006
Posts: 6427
Location: Auckland, New Zealand

PostPosted: Fri 30 Oct 2009, 00:15    Post subject:  

Ummm... is that not what guicompletion (which you mentioned before) does?
_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4335

PostPosted: Sun 01 Nov 2009, 17:27    Post subject:  

This could be a fairly easy way to omit programs that aren't installed in all versions of Puppy.

Code:
if [ "`which NAME_of_PROGRAM`" != "" ];then
NAME_of_PROGRAM_ENTRY="<hbox>.......
</hbox>"
else
NAME_of_PROGRAM_ENTRY=""
#alternatively we could have a label telling them what is missing and an action button that does `petget <URL> &`
fi


then later in the gtkdialog window just substitute the code with $NAME_of_PROGRAM_ENTRY

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
Patriot


Joined: 15 Jan 2009
Posts: 734

PostPosted: Mon 02 Nov 2009, 09:10    Post subject:  

Hmmm .....

zigbert,

I'm looking for a way for gtkdialog3 to self update without user intervention. For example, a simple entry box that displays updated time every second. Do you know any simple methods? (The method I'm using is a bit too stretched ...)

Kindly please advise ...


Rgds
Back to top
View user's profile Send private message 
trio


Joined: 21 Dec 2008
Posts: 1788
Location: अनुमोदना

PostPosted: Mon 02 Nov 2009, 09:37    Post subject:  

Patriot

Pls post your script, so it will be easier to get help

_________________
PET Maker|WbarCC|My Website
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 9 of 64 [947 Posts]   Goto page: Previous 1, 2, 3, ..., 7, 8, 9, 10, 11, ..., 62, 63, 64 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

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
[ Time: 0.1071s ][ Queries: 13 (0.0163s) ][ GZIP on ]