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 01 Oct 2014, 10:43
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
GtkDialog1-1.3
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 12 of 14 Posts_count   Goto page: Previous 1, 2, 3, ..., 10, 11, 12, 13, 14 Next
Author Message
goingnuts

Joined: 07 Dec 2008
Posts: 780

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  451 Time(s) 
october_2012_patches.tar.gz
Description 
gz

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

tooltip.png

Back to top
View user's profile Send_private_message Visit_website 
goingnuts

Joined: 07 Dec 2008
Posts: 780

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   775 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  446 Time(s) 
wmctrl.gz
Description  wmctrl-1.07 static build - fake .gz-file
gz

 Download 
Filename  wmctrl.gz 
Filesize  535.08 KB 
Downloaded  479 Time(s) 
Back to top
View user's profile Send_private_message Visit_website 
technosaurus


Joined: 18 May 2008
Posts: 4351

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

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
goingnuts

Joined: 07 Dec 2008
Posts: 780

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  410 Time(s) 
Back to top
View user's profile Send_private_message Visit_website 
goingnuts

Joined: 07 Dec 2008
Posts: 780

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_website 
amigo

Joined: 02 Apr 2007
Posts: 2252

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: 780

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_website 
amigo

Joined: 02 Apr 2007
Posts: 2252

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: 780

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  432 Time(s) 
Back to top
View user's profile Send_private_message Visit_website 
goingnuts

Joined: 07 Dec 2008
Posts: 780

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  413 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   639 Time(s)

snap0011.png

Back to top
View user's profile Send_private_message Visit_website 
goingnuts

Joined: 07 Dec 2008
Posts: 780

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   567 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  412 Time(s) 
Back to top
View user's profile Send_private_message Visit_website 
goingnuts

Joined: 07 Dec 2008
Posts: 780

PostPosted: Thu 30 May 2013, 15:56    Post_subject:  

A couple of more patches...
033_edit_widget_variable.diff
* Added get variable from edit widget.
* Added width/height to buttons width images
* Added attribute <position> to lexer...plan to use for buttons
and notebook if possible - to get cleaner xml-syntax...
034_vhscale_widget_and_various.diff
* Added tooltip to edit + combo-widget.
* Added widget h/vscale.
* Added attribute min & max

The last patch gives access to simple h & vscale - view attached image of gsmix-0.1 using this...gtk2 & gtk1 versions...

Update 20130612: Added a new patch - 035_scale_refresh_eventbox_pixmap_text.diff:
* Added example gsmix
* Added eventbox to widget pixmap & text (action/tooltip)
* Added refresh widget to h/vscale
* Code clean up in widgets.c
* Fixed gtk2 warning when insert file in edit widget
* Clean up the icon generation in create_button.
* Changed gtk1 stock icon wrapper to look for the stock-name given.
035_scale_refresh_eventbox_pixmap_text.diff.gz
Description 
gz

 Download 
Filename  035_scale_refresh_eventbox_pixmap_text.diff.gz 
Filesize  41.33 KB 
Downloaded  162 Time(s) 
snap0003.png
 Description   
 Filesize   29 KB
 Viewed   248 Time(s)

snap0003.png

034_vhscale_widget_and_various.diff.gz
Description 
gz

 Download 
Filename  034_vhscale_widget_and_various.diff.gz 
Filesize  10.74 KB 
Downloaded  157 Time(s) 
033_edit_widget_variable.diff.gz
Description 
gz

 Download 
Filename  033_edit_widget_variable.diff.gz 
Filesize  4.79 KB 
Downloaded  163 Time(s) 
Back to top
View user's profile Send_private_message Visit_website 
goingnuts

Joined: 07 Dec 2008
Posts: 780

PostPosted: Sun 16 Jun 2013, 10:37    Post_subject:  

Yet another patch:
* Another revise of the gtk wrappers gtk_image_new_from_stock
& gtk_image_new_from_file
* Added handling (partly) of the position tag to buttons
* Added use of the default tag to buttons to reflect the relief style
* Added demo pmspeak-01.sh - a frontend for speak (text2speech)

Below the main GUI for pmspeak running showing the new tag <position> in use + using <default>none</default> to remove the relief from the buttons. Also the hscale is in use here...
snap0007.png
 Description   
 Filesize   21.59 KB
 Viewed   189 Time(s)

snap0007.png

036_button_position_relief_rev_gtk_image_wrappers.diff.gz
Description 
gz

 Download 
Filename  036_button_position_relief_rev_gtk_image_wrappers.diff.gz 
Filesize  16.79 KB 
Downloaded  159 Time(s) 
Back to top
View user's profile Send_private_message Visit_website 
amigo

Joined: 02 Apr 2007
Posts: 2252

PostPosted: Sun 16 Jun 2013, 13:03    Post_subject:  

But the fool on the hill,
sees the sun going down
and the eyes in his head
see the world spinning round...

I was just thinking about you and the last few patches. I'm not very motivated about coding when it's Summer, but I'm gonna try to make an incremented version with the last few patches. I must say, I've tried a few of the newer examples with only limited success.
Back to top
View user's profile Send_private_message 
goingnuts

Joined: 07 Dec 2008
Posts: 780

PostPosted: Sun 16 Jun 2013, 13:45    Post_subject:  

amigo: I was trying to get speak to sing - launch several instances with different voices - all singing the good old "Fool on the hill..."

I know its not the optimal season for working on this - but some of the days here are quite autumn-like and well suited for interior activities...
The latest examples need some external programs (aumix, speak and lame) but I might also have missed part of a needed patch - not likely but possible Smile
If you keep having problems getting the examples to run I can post a full patch between 1,1 and my present source.
Before making a new release I still have some TODOs I would like to include.
I tried to get the toolbar included but failed - and with the newly added tags for the buttons it seems less needed.
I also tried to implement the use of gtk_rc_get_theme_dir but additional I needed a way to find the button-images - and here I failed too. But I have sort of success by putting the gtk 2.12-stock icons in /usr/local/share/themes/Default/gtk/icons and modify the locate-script to:
Code:
#!/bin/sh

try=$(find /usr/local/share/themes -iname ${1##*/})
if [ ! "${try}" = "" ]; then
   echo "${try}"
   exit
fi

try=$(find /usr/share/icons -iname ${1##*/})
if [ ! "${try}" = "" ]; then
   echo "${try}"
   exit
else
   echo ""
fi

after changing gtkdialog's internal search as well (trying locate before looking in /usr/share/pixmaps).

Thanks for testing!
Below gtkdialog1 running a slightly modified version of technosaurus Xarchive2 GUI front end - quite nice I think...
snap0008.png
 Description   
 Filesize   20.82 KB
 Viewed   146 Time(s)

snap0008.png

Back to top
View user's profile Send_private_message Visit_website 
Display_posts:   Sort by:   
Page 12 of 14 Posts_count   Goto page: Previous 1, 2, 3, ..., 10, 11, 12, 13, 14 Next
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.1039s ][ Queries: 13 (0.0079s) ][ GZIP on ]