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 22 May 2013, 07:26
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Backport gtkdialog 0.59.8 to use gtk1/gtk2: gtkdialog1-1.0
Post new topic   Reply to topic View previous topic :: View next topic
Page 12 of 12 [176 Posts]   Goto page: Previous 1, 2, 3, ..., 10, 11, 12
Author Message
goingnuts

Joined: 07 Dec 2008
Posts: 626

PostPosted: Thu 25 Oct 2012, 00:04    Post subject:  

Code:
<entry>
<variable>ENTRY</variable>
<visible>password</visible>
</entry>

I will look at the possibilities to add tooltips - at least to buttons if possible.
Update: Tooltip is quite easy to implement on buttons, radiobuttons, checkbox and entry. Atm. set for a syntax like:
Code:
<button>
<label>Button with tooltip</label>
<tooltip>gtkdialog1 rocks!</tooltip>
</button>

which seems different from the younger gtkdialog way of doing it...
Present patches for GtkDialog1-1.1 attached:
Quote:
Added tooltips to entry, button, radiobutton, checkbox and menu.
automaton.c - fix of LABPIX button missing right paddding.
widget.c added default - setting it to be first item in list in
fill_list_by_items

Add 20121027: Working "hard" on making GtkDialog1 more compatible with the other gtkdialog versions. As an example the below action syntax is now supported:
Code:
<action>Enable:ENTRY</action>
<action enable>ENTRY</action>
<action type="enable">ENTRY</action>
which should make more of the script running by default...Attached the present state as static build gtk1.2 - rename to gtkdialog1
gtkdialog1.gz
Description  static build 20121027 - test version gtk1.2
gz

 Download 
Filename  gtkdialog1.gz 
Filesize  493.48 KB 
Downloaded  166 Time(s) 
october_2012_patches.tar.gz
Description 
gz

 Download 
Filename  october_2012_patches.tar.gz 
Filesize  2.6 KB 
Downloaded  176 Time(s) 
tooltip.png
 Description   
 Filesize   22.69 KB
 Viewed   460 Time(s)

tooltip.png

Back to top
View user's profile Send private message Visit poster's website 
goingnuts

Joined: 07 Dec 2008
Posts: 626

PostPosted: Sun 28 Oct 2012, 16:45    Post subject:  

While back in GtkDialog1 I found my notes on the swallow widget and decided to give it another try. So attached static gtk1 version accepts the following script:
Code:
#!/bin/sh
#swallow demo for GtkDialog1 - experimental...!
#20121028goingnuts
#launch the app and establish the window ID
APP="${1}"
${1} &
while :; do
   if [ "$(wmctrl -l | grep -i "${APP}" | cut -d " " -f1)" = "" ]; then
      usleep 50
   else
      WINID=$(wmctrl -l | grep -i "${APP}" | cut -d " " -f1)
      break
   fi
done
export MAIN_DIALOG='
<vbox>
   <swallow>
      <label>'${WINID}'</label>
   </swallow>
   <button ok></button>
</vbox>
'
gtkdialog1 --program=MAIN_DIALOG

You will need the wmctrl which is also attached as a static build. It is huge as it needs glib-2 - but we might be able to reduce size by backport to glib-1 or eliminate the need for glib. Note that wmctrl also can show the pid of the windows (wmctrl -l -p) which might be a more secure way of finding the windows ID than the name used in above script (${APP} &) - then get the pid of the process and find the window ID with wmctrl -l -p (+ some grep/cut stuff)...

The widget still need some error checking/fix for resize and might fail to launch some applications. Not sure if it add value to gtkdialog1..
snap0010.png
 Description   example of running "swallow Links"
 Filesize   63.32 KB
 Viewed   417 Time(s)

snap0010.png

gtkdialog1.gz
Description  gtkdialog1 gtk1 static build with support for swallow - experimental
gz

 Download 
Filename  gtkdialog1.gz 
Filesize  493.84 KB 
Downloaded  158 Time(s) 
wmctrl.gz
Description  wmctrl-1.07 static build - fake .gz-file
gz

 Download 
Filename  wmctrl.gz 
Filesize  535.08 KB 
Downloaded  165 Time(s) 
Back to top
View user's profile Send private message Visit poster's website 
technosaurus


Joined: 18 May 2008
Posts: 3843

PostPosted: Sun 28 Oct 2012, 17:32    Post subject:  

sounds great - what exactly is it that wmctrl does? if it is just getting the window id, xwinifo can do that (IIRC there is also an port to xcb that compiles pretty small statically)
Code:
eval `xwininfo -root -all -int |awk '/'$APPNAME'/{print "WINID="$1 }'`
here is the result from mupdf (just grepping the xwininfo output for mupdf - no awk):
Code:
10485769 "txtbk.pdf - 201/816 (161 dpi)": ("mupdf" "MuPDF")  1274x747+3+22  +3+22

windowID "title bar info" (class? name?) widthxheight+?+? +xoffset+yoffset
(I think the +3+22 has to do with the window border left and top)

later versions of gtkdialog use <TAG tooltip-text="tooltip text here"> though I prefer the <tooltip>tooltip text</tooltip> (seriously why even have an xml format if you aren't going to use it)

your method is much more extensible and readable
<tooltip>
<tooltip-text>.....</tooltip-text>
<tooltip-markup>.....</tooltip-markup>
<tooltip-font>.....</tooltip-font>
... any tags that can affect tooltips
</tooltip>

than trying to fit it all in the same tag and simplifies the parsing

_________________
Puppy Web Desktop Now with pet packages - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
goingnuts

Joined: 07 Dec 2008
Posts: 626

PostPosted: Mon 29 Oct 2012, 02:49    Post subject:  

I actually planed to do no more with the tooltip-tag...thought that the styling should be done via rcfile:
Code:
style "tooltips"
{
  bg[NORMAL] = "#ffd000"
  fg[NORMAL] = "#000000"
  font = "-adobe-helvetica-medium-r-normal--*-140-*-*-*-*-*-*"
}
widget "gtk-tooltip*" style "tooltips"
...I think the rcfile is like a css-file for the html-files...

wmctrl is used to get the window ID and anything, you can control to give you that, can be used. The swallow widget "only" needs the window ID passed (for now as a label tag).

Add: And the patches leading up to this attached. Found this which might be a solid way to get the window ID.
One problem remains with the swallow widget: Seems that the socket window is always on top - even when the gtkdialog1 window is minimized the swallow-window remains on top. Any solutions to this is very welcome!
october_2012_2_patches.tar.gz
Description  further patches...
gz

 Download 
Filename  october_2012_2_patches.tar.gz 
Filesize  6.8 KB 
Downloaded  154 Time(s) 
Back to top
View user's profile Send private message Visit poster's website 
goingnuts

Joined: 07 Dec 2008
Posts: 626

PostPosted: Fri 02 Nov 2012, 12:36    Post subject:  

Guess the swallow widget need some rest - tried a lot without getting one step further...
So started to add "drag-and-drop" support for widget edit, table(=tree) and list (that is dnd TO the gtkdialog widget for a starter). Got the edit working nicely so far...
Target is to get dnd for the relevant widgets without having to add anything in the gtk-dialog-script...
Back to top
View user's profile Send private message Visit poster's website 
amigo

Joined: 02 Apr 2007
Posts: 1758

PostPosted: Sat 03 Nov 2012, 04:29    Post subject:  

GN, I've downloaded the patches from just above. Are there others which are not included there since last release. I've been following the thread. I just haven't had anything to add as Coding Season has not started here yet...
Back to top
View user's profile Send private message 
goingnuts

Joined: 07 Dec 2008
Posts: 626

PostPosted: Sat 03 Nov 2012, 08:26    Post subject:  

@amigo: I have posted to sets of patch lately:
october_2012_patches
and
october_2012_2_patches (the one above). They should represent my changes since we released GtkDialog1-1.1.
Back to top
View user's profile Send private message Visit poster's website 
amigo

Joined: 02 Apr 2007
Posts: 1758

PostPosted: Sat 03 Nov 2012, 11:25    Post subject:  

Thanks GN. Let me know if you need/want anything vis-a-vis a new release.
Back to top
View user's profile Send private message 
goingnuts

Joined: 07 Dec 2008
Posts: 626

PostPosted: Sat 03 Nov 2012, 16:09    Post subject:  

Thanks amigo - atm I am just following up upon some ideas. Attached the next patch which gives simple drag and drop to widget edit, table(tree) and list. Also gives APPEND-action to table(tree) and repair a bug in PIXMAP causing gtk2 build to segfault.

The dnd thing is quite handy - just throw a bunch of files to a list/tree-widget to get them all included - or drag a file over the edit widget to get it loaded/shown...
030_simple_dnd_added.diff.gz
Description 
gz

 Download 
Filename  030_simple_dnd_added.diff.gz 
Filesize  13.7 KB 
Downloaded  152 Time(s) 
Back to top
View user's profile Send private message Visit poster's website 
goingnuts

Joined: 07 Dec 2008
Posts: 626

PostPosted: Mon 05 Nov 2012, 14:52    Post subject:  

Another patch which:
* Added drag and drop for widget entry.
* Added scrollable to widget NOTEBOOK (use scroll="any value" in notebook header) - handy if you have lots of pages.
* Added tab position to widget NOTEBOOK (use tabpos="top/bottom/left/right)" in notebook header),
* Fixed pixmap "error" in parser.y

If the notebook additions should be named otherwise input are welcome!
031_notebook_div_dnd_entry.diff.gz
Description 
gz

 Download 
Filename  031_notebook_div_dnd_entry.diff.gz 
Filesize  4.2 KB 
Downloaded  140 Time(s) 
snap0011.png
 Description   notebook running with:
<notebook labels="Checkbox|Radiobutton|Tree|No 1|No 2|No 3|No 4"
tabpos="left" scroll="yes">
 Filesize   9.04 KB
 Viewed   280 Time(s)

snap0011.png

Back to top
View user's profile Send private message Visit poster's website 
goingnuts

Joined: 07 Dec 2008
Posts: 626

PostPosted: Mon 19 Nov 2012, 14:29    Post subject:  

* Added "-" as part of string in attributes to lexer.l.
* Added support for show-tabs="yes/no" and show-border="yes/no" to widget NOTEBOOK. Small changes to tabpos code as well...
* Added attribute "margin=" to vbox and hbox.
Patch for this attached...
snap0012.png
 Description   
 Filesize   11.4 KB
 Viewed   232 Time(s)

snap0012.png

032_more_notebooks_tags_margin2hbox_vbox.diff.gz
Description 
gz

 Download 
Filename  032_more_notebooks_tags_margin2hbox_vbox.diff.gz 
Filesize  5.43 KB 
Downloaded  126 Time(s) 
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 12 of 12 [176 Posts]   Goto page: Previous 1, 2, 3, ..., 10, 11, 12
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.0741s ][ Queries: 13 (0.0092s) ][ GZIP on ]